Aggiunto entity framework e prima visualizzazione dati (NO filtro...)

This commit is contained in:
Samuele E. Locatelli
2020-08-21 09:11:21 +02:00
parent 9971fcde42
commit bd26e61730
18 changed files with 5341 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ElmahModelEF" connectionString="data source=sql2016dev;initial catalog=Elmah;persist security info=True;user id=sa;password=keyhammer16;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{23EFF9A9-1968-450B-9679-F40BA92B822C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AppData</RootNamespace>
<AssemblyName>AppData</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ElmahModel.cs" />
<Compile Include="ELMAH_Error.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="sysdiagram.cs" />
<Compile Include="Tag.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+57
View File
@@ -0,0 +1,57 @@
namespace AppData
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public partial class ELMAH_Error
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public ELMAH_Error()
{
Tags = new HashSet<Tag>();
}
[Key]
public Guid ErrorId { get; set; }
[Required]
[StringLength(60)]
public string Application { get; set; }
[Required]
[StringLength(50)]
public string Host { get; set; }
[Required]
[StringLength(100)]
public string Type { get; set; }
[Required]
[StringLength(60)]
public string Source { get; set; }
[Required]
[StringLength(500)]
public string Message { get; set; }
[Required]
[StringLength(50)]
public string User { get; set; }
public int StatusCode { get; set; }
public DateTime TimeUtc { get; set; }
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Sequence { get; set; }
[Required]
public string AllXml { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Tag> Tags { get; set; }
}
}
+27
View File
@@ -0,0 +1,27 @@
namespace AppData
{
using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
public partial class ElmahModel : DbContext
{
public ElmahModel()
: base("name=ElmahModelEF")
{
}
public virtual DbSet<ELMAH_Error> ELMAH_Error { get; set; }
public virtual DbSet<sysdiagram> sysdiagrams { get; set; }
public virtual DbSet<Tag> Tags { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<ELMAH_Error>()
.HasMany(e => e.Tags)
.WithMany(e => e.ELMAH_Error)
.Map(m => m.ToTable("Tag2Err").MapLeftKey("ErrorId").MapRightKey("TagId"));
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("AppData")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AppData")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("23eff9a9-1968-450b-9679-f40ba92b822c")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+26
View File
@@ -0,0 +1,26 @@
namespace AppData
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public partial class Tag
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Tag()
{
ELMAH_Error = new HashSet<ELMAH_Error>();
}
public int TagId { get; set; }
[Required]
[StringLength(250)]
public string TagDescr { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ELMAH_Error> ELMAH_Error { get; set; }
}
}
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
<package id="EntityFramework.it" version="6.2.0" targetFramework="net462" />
</packages>
+24
View File
@@ -0,0 +1,24 @@
namespace AppData
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public partial class sysdiagram
{
[Required]
[StringLength(128)]
public string name { get; set; }
public int principal_id { get; set; }
[Key]
public int diagram_id { get; set; }
public int? version { get; set; }
public byte[] definition { get; set; }
}
}
+6
View File
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30225.117
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ELMA", "ELMA\ELMA.csproj", "{4342C0F9-646E-4197-97E2-AEE620EE0A99}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ELMA", "ELMA\ELMA.csproj", "{4342C0F9-646E-4197-97E2-AEE620EE0A99}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppData", "AppData\AppData.csproj", "{23EFF9A9-1968-450B-9679-F40BA92B822C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
{4342C0F9-646E-4197-97E2-AEE620EE0A99}.Debug|Any CPU.Build.0 = Debug|Any CPU {4342C0F9-646E-4197-97E2-AEE620EE0A99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4342C0F9-646E-4197-97E2-AEE620EE0A99}.Release|Any CPU.ActiveCfg = Release|Any CPU {4342C0F9-646E-4197-97E2-AEE620EE0A99}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4342C0F9-646E-4197-97E2-AEE620EE0A99}.Release|Any CPU.Build.0 = Release|Any CPU {4342C0F9-646E-4197-97E2-AEE620EE0A99}.Release|Any CPU.Build.0 = Release|Any CPU
{23EFF9A9-1968-450B-9679-F40BA92B822C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23EFF9A9-1968-450B-9679-F40BA92B822C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23EFF9A9-1968-450B-9679-F40BA92B822C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23EFF9A9-1968-450B-9679-F40BA92B822C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
+21 -4
View File
@@ -1,6 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <configSections>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</startup> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ElmahModelEF" connectionString="data source=sql2016dev;initial catalog=Elmah;persist security info=True;user id=sa;password=keyhammer16;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration> </configuration>
+21
View File
@@ -33,7 +33,14 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
@@ -54,6 +61,9 @@
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -63,6 +73,8 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
<None Include="packages.config" />
<None Include="Properties\DataSources\AppData.ELMAH_Error.datasource" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -76,5 +88,14 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppData\AppData.csproj">
<Project>{23eff9a9-1968-450b-9679-f40ba92b822c}</Project>
<Name>AppData</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\SteamWare.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
+210 -7
View File
@@ -1,6 +1,6 @@
namespace ELMA namespace ELMA
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// Variabile di progettazione necessaria. /// Variabile di progettazione necessaria.
@@ -28,13 +28,216 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.ClientSize = new System.Drawing.Size(800, 450); this.ErrorsDGV = new System.Windows.Forms.DataGridView();
this.Text = "Form1"; this.bsErrors = new System.Windows.Forms.BindingSource(this.components);
this.errorIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.applicationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.hostDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.typeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.sourceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.userDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.statusCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.timeUtcDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.sequenceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.allXmlDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tagsDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lblApp = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
this.lblVers = new System.Windows.Forms.ToolStripStatusLabel();
((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).BeginInit();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// ErrorsDGV
//
this.ErrorsDGV.AllowUserToAddRows = false;
this.ErrorsDGV.AllowUserToDeleteRows = false;
this.ErrorsDGV.AllowUserToOrderColumns = true;
this.ErrorsDGV.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ErrorsDGV.AutoGenerateColumns = false;
this.ErrorsDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ErrorsDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.errorIdDataGridViewTextBoxColumn,
this.applicationDataGridViewTextBoxColumn,
this.hostDataGridViewTextBoxColumn,
this.typeDataGridViewTextBoxColumn,
this.sourceDataGridViewTextBoxColumn,
this.messageDataGridViewTextBoxColumn,
this.userDataGridViewTextBoxColumn,
this.statusCodeDataGridViewTextBoxColumn,
this.timeUtcDataGridViewTextBoxColumn,
this.sequenceDataGridViewTextBoxColumn,
this.allXmlDataGridViewTextBoxColumn,
this.tagsDataGridViewTextBoxColumn});
this.ErrorsDGV.DataSource = this.bsErrors;
this.ErrorsDGV.Location = new System.Drawing.Point(12, 117);
this.ErrorsDGV.Name = "ErrorsDGV";
this.ErrorsDGV.ReadOnly = true;
this.ErrorsDGV.Size = new System.Drawing.Size(776, 308);
this.ErrorsDGV.TabIndex = 0;
//
// bsErrors
//
this.bsErrors.DataSource = typeof(AppData.ELMAH_Error);
//
// errorIdDataGridViewTextBoxColumn
//
this.errorIdDataGridViewTextBoxColumn.DataPropertyName = "ErrorId";
this.errorIdDataGridViewTextBoxColumn.HeaderText = "ErrorId";
this.errorIdDataGridViewTextBoxColumn.Name = "errorIdDataGridViewTextBoxColumn";
this.errorIdDataGridViewTextBoxColumn.ReadOnly = true;
//
// applicationDataGridViewTextBoxColumn
//
this.applicationDataGridViewTextBoxColumn.DataPropertyName = "Application";
this.applicationDataGridViewTextBoxColumn.HeaderText = "Application";
this.applicationDataGridViewTextBoxColumn.Name = "applicationDataGridViewTextBoxColumn";
this.applicationDataGridViewTextBoxColumn.ReadOnly = true;
//
// hostDataGridViewTextBoxColumn
//
this.hostDataGridViewTextBoxColumn.DataPropertyName = "Host";
this.hostDataGridViewTextBoxColumn.HeaderText = "Host";
this.hostDataGridViewTextBoxColumn.Name = "hostDataGridViewTextBoxColumn";
this.hostDataGridViewTextBoxColumn.ReadOnly = true;
//
// typeDataGridViewTextBoxColumn
//
this.typeDataGridViewTextBoxColumn.DataPropertyName = "Type";
this.typeDataGridViewTextBoxColumn.HeaderText = "Type";
this.typeDataGridViewTextBoxColumn.Name = "typeDataGridViewTextBoxColumn";
this.typeDataGridViewTextBoxColumn.ReadOnly = true;
//
// sourceDataGridViewTextBoxColumn
//
this.sourceDataGridViewTextBoxColumn.DataPropertyName = "Source";
this.sourceDataGridViewTextBoxColumn.HeaderText = "Source";
this.sourceDataGridViewTextBoxColumn.Name = "sourceDataGridViewTextBoxColumn";
this.sourceDataGridViewTextBoxColumn.ReadOnly = true;
//
// messageDataGridViewTextBoxColumn
//
this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message";
this.messageDataGridViewTextBoxColumn.HeaderText = "Message";
this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn";
this.messageDataGridViewTextBoxColumn.ReadOnly = true;
//
// userDataGridViewTextBoxColumn
//
this.userDataGridViewTextBoxColumn.DataPropertyName = "User";
this.userDataGridViewTextBoxColumn.HeaderText = "User";
this.userDataGridViewTextBoxColumn.Name = "userDataGridViewTextBoxColumn";
this.userDataGridViewTextBoxColumn.ReadOnly = true;
//
// statusCodeDataGridViewTextBoxColumn
//
this.statusCodeDataGridViewTextBoxColumn.DataPropertyName = "StatusCode";
this.statusCodeDataGridViewTextBoxColumn.HeaderText = "StatusCode";
this.statusCodeDataGridViewTextBoxColumn.Name = "statusCodeDataGridViewTextBoxColumn";
this.statusCodeDataGridViewTextBoxColumn.ReadOnly = true;
//
// timeUtcDataGridViewTextBoxColumn
//
this.timeUtcDataGridViewTextBoxColumn.DataPropertyName = "TimeUtc";
this.timeUtcDataGridViewTextBoxColumn.HeaderText = "TimeUtc";
this.timeUtcDataGridViewTextBoxColumn.Name = "timeUtcDataGridViewTextBoxColumn";
this.timeUtcDataGridViewTextBoxColumn.ReadOnly = true;
//
// sequenceDataGridViewTextBoxColumn
//
this.sequenceDataGridViewTextBoxColumn.DataPropertyName = "Sequence";
this.sequenceDataGridViewTextBoxColumn.HeaderText = "Sequence";
this.sequenceDataGridViewTextBoxColumn.Name = "sequenceDataGridViewTextBoxColumn";
this.sequenceDataGridViewTextBoxColumn.ReadOnly = true;
//
// allXmlDataGridViewTextBoxColumn
//
this.allXmlDataGridViewTextBoxColumn.DataPropertyName = "AllXml";
this.allXmlDataGridViewTextBoxColumn.HeaderText = "AllXml";
this.allXmlDataGridViewTextBoxColumn.Name = "allXmlDataGridViewTextBoxColumn";
this.allXmlDataGridViewTextBoxColumn.ReadOnly = true;
//
// tagsDataGridViewTextBoxColumn
//
this.tagsDataGridViewTextBoxColumn.DataPropertyName = "Tags";
this.tagsDataGridViewTextBoxColumn.HeaderText = "Tags";
this.tagsDataGridViewTextBoxColumn.Name = "tagsDataGridViewTextBoxColumn";
this.tagsDataGridViewTextBoxColumn.ReadOnly = true;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblApp,
this.toolStripProgressBar1,
this.lblVers});
this.statusStrip1.Location = new System.Drawing.Point(0, 428);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(800, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// lblApp
//
this.lblApp.Name = "lblApp";
this.lblApp.Size = new System.Drawing.Size(44, 17);
this.lblApp.Text = "SELMA";
//
// toolStripProgressBar1
//
this.toolStripProgressBar1.Name = "toolStripProgressBar1";
this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
//
// lblVers
//
this.lblVers.Name = "lblVers";
this.lblVers.Size = new System.Drawing.Size(40, 17);
this.lblVers.Text = "0.0.0.0";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.ErrorsDGV);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "Steamware Elma Log Monitor and Analysis";
((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
}
private System.Windows.Forms.DataGridView ErrorsDGV;
private System.Windows.Forms.BindingSource bsErrors;
private System.Windows.Forms.DataGridViewTextBoxColumn errorIdDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn applicationDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn hostDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn typeDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn sourceDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn userDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn statusCodeDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn timeUtcDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn sequenceDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn allXmlDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn tagsDataGridViewTextBoxColumn;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel lblApp;
private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
private System.Windows.Forms.ToolStripStatusLabel lblVers;
}
} }
+18 -5
View File
@@ -2,19 +2,32 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Data.Entity;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using AppData;
namespace ELMA namespace ELMA
{ {
public partial class Form1 : Form public partial class MainForm : Form
{
ElmahModel model = new ElmahModel();
public MainForm()
{ {
public Form1() InitializeComponent();
{ myInit();
InitializeComponent();
}
} }
private void myInit()
{
var dbSet = model.ELMAH_Error;
dbSet.Load();
this.bsErrors.DataSource = model.ELMAH_Error.Local.ToBindingList();
}
}
} }
+4791
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -16,7 +16,7 @@ namespace ELMA
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new MainForm());
} }
} }
} }
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ELMAH_Error" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AppData.ELMAH_Error, AppData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
</packages>