Bozza delete (manca reset + select ALL)

This commit is contained in:
Samuele E. Locatelli
2020-08-24 23:23:13 +02:00
parent e2cca000f1
commit 3d7a141a65
2 changed files with 149 additions and 86 deletions
+96 -84
View File
@@ -41,6 +41,12 @@
this.listStatus = new System.Windows.Forms.ListBox();
this.listType = new System.Windows.Forms.ListBox();
this.listUsers = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.btnLoad = new System.Windows.Forms.Button();
this.errorIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.applicationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.hostDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -51,14 +57,8 @@
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.bsErrors = new System.Windows.Forms.BindingSource(this.components);
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.btnLoad = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).BeginInit();
this.statusStrip1.SuspendLayout();
this.gboxFiltri.SuspendLayout();
@@ -85,15 +85,14 @@
this.userDataGridViewTextBoxColumn,
this.statusCodeDataGridViewTextBoxColumn,
this.timeUtcDataGridViewTextBoxColumn,
this.sequenceDataGridViewTextBoxColumn,
this.allXmlDataGridViewTextBoxColumn});
this.sequenceDataGridViewTextBoxColumn});
this.ErrorsDGV.DataSource = this.bsErrors;
this.ErrorsDGV.Location = new System.Drawing.Point(16, 134);
this.ErrorsDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ErrorsDGV.Name = "ErrorsDGV";
this.ErrorsDGV.ReadOnly = true;
this.ErrorsDGV.RowHeadersWidth = 51;
this.ErrorsDGV.Size = new System.Drawing.Size(1300, 389);
this.ErrorsDGV.Size = new System.Drawing.Size(1223, 389);
this.ErrorsDGV.TabIndex = 0;
//
// statusStrip1
@@ -106,7 +105,7 @@
this.statusStrip1.Location = new System.Drawing.Point(0, 528);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(1332, 26);
this.statusStrip1.Size = new System.Drawing.Size(1255, 26);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
@@ -131,6 +130,7 @@
//
this.gboxFiltri.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gboxFiltri.Controls.Add(this.btnDelete);
this.gboxFiltri.Controls.Add(this.btnLoad);
this.gboxFiltri.Controls.Add(this.label5);
this.gboxFiltri.Controls.Add(this.label4);
@@ -144,55 +144,120 @@
this.gboxFiltri.Controls.Add(this.listApp);
this.gboxFiltri.Location = new System.Drawing.Point(16, 12);
this.gboxFiltri.Name = "gboxFiltri";
this.gboxFiltri.Size = new System.Drawing.Size(1300, 115);
this.gboxFiltri.Size = new System.Drawing.Size(1223, 115);
this.gboxFiltri.TabIndex = 2;
this.gboxFiltri.TabStop = false;
this.gboxFiltri.Text = "Filtri";
//
// listApp
//
this.listApp.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listApp.FormattingEnabled = true;
this.listApp.ItemHeight = 16;
this.listApp.Location = new System.Drawing.Point(7, 38);
this.listApp.Name = "listApp";
this.listApp.Size = new System.Drawing.Size(210, 68);
this.listApp.Size = new System.Drawing.Size(176, 68);
this.listApp.TabIndex = 0;
this.listApp.SelectedIndexChanged += new System.EventHandler(this.listApp_SelectedIndexChanged);
//
// listHost
//
this.listHost.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listHost.FormattingEnabled = true;
this.listHost.ItemHeight = 16;
this.listHost.Location = new System.Drawing.Point(223, 38);
this.listHost.Location = new System.Drawing.Point(189, 38);
this.listHost.Name = "listHost";
this.listHost.Size = new System.Drawing.Size(116, 68);
this.listHost.Size = new System.Drawing.Size(92, 68);
this.listHost.TabIndex = 1;
this.listHost.SelectedIndexChanged += new System.EventHandler(this.listHost_SelectedIndexChanged);
//
// listStatus
//
this.listStatus.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listStatus.FormattingEnabled = true;
this.listStatus.ItemHeight = 16;
this.listStatus.Location = new System.Drawing.Point(345, 38);
this.listStatus.Location = new System.Drawing.Point(287, 38);
this.listStatus.Name = "listStatus";
this.listStatus.Size = new System.Drawing.Size(120, 68);
this.listStatus.Size = new System.Drawing.Size(87, 68);
this.listStatus.TabIndex = 2;
this.listStatus.SelectedIndexChanged += new System.EventHandler(this.listStatus_SelectedIndexChanged);
//
// listType
//
this.listType.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listType.FormattingEnabled = true;
this.listType.ItemHeight = 16;
this.listType.Location = new System.Drawing.Point(471, 38);
this.listType.Location = new System.Drawing.Point(380, 38);
this.listType.Name = "listType";
this.listType.Size = new System.Drawing.Size(506, 68);
this.listType.Size = new System.Drawing.Size(393, 68);
this.listType.TabIndex = 3;
this.listType.SelectedIndexChanged += new System.EventHandler(this.listType_SelectedIndexChanged);
//
// listUsers
//
this.listUsers.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listUsers.FormattingEnabled = true;
this.listUsers.ItemHeight = 16;
this.listUsers.Location = new System.Drawing.Point(983, 38);
this.listUsers.Location = new System.Drawing.Point(779, 38);
this.listUsers.Name = "listUsers";
this.listUsers.Size = new System.Drawing.Size(159, 68);
this.listUsers.Size = new System.Drawing.Size(135, 68);
this.listUsers.TabIndex = 4;
this.listUsers.SelectedIndexChanged += new System.EventHandler(this.listUsers_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(33, 17);
this.label1.TabIndex = 5;
this.label1.Text = "App";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(186, 18);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(37, 17);
this.label2.TabIndex = 6;
this.label2.Text = "Host";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(287, 18);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 17);
this.label3.TabIndex = 7;
this.label3.Text = "Status";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(377, 18);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 17);
this.label4.TabIndex = 8;
this.label4.Text = "Type";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(776, 18);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(45, 17);
this.label5.TabIndex = 9;
this.label5.Text = "Users";
//
// btnLoad
//
this.btnLoad.Location = new System.Drawing.Point(935, 38);
this.btnLoad.Name = "btnLoad";
this.btnLoad.Size = new System.Drawing.Size(131, 68);
this.btnLoad.TabIndex = 10;
this.btnLoad.Text = "SEARCH";
this.btnLoad.UseVisualStyleBackColor = true;
this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
//
// errorIdDataGridViewTextBoxColumn
//
@@ -284,79 +349,25 @@
this.sequenceDataGridViewTextBoxColumn.ReadOnly = true;
this.sequenceDataGridViewTextBoxColumn.Width = 125;
//
// allXmlDataGridViewTextBoxColumn
//
this.allXmlDataGridViewTextBoxColumn.DataPropertyName = "AllXml";
this.allXmlDataGridViewTextBoxColumn.HeaderText = "AllXml";
this.allXmlDataGridViewTextBoxColumn.MinimumWidth = 6;
this.allXmlDataGridViewTextBoxColumn.Name = "allXmlDataGridViewTextBoxColumn";
this.allXmlDataGridViewTextBoxColumn.ReadOnly = true;
this.allXmlDataGridViewTextBoxColumn.Width = 125;
//
// bsErrors
//
this.bsErrors.DataSource = typeof(AppData.ELMAH_Error);
//
// label1
// btnDelete
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(33, 17);
this.label1.TabIndex = 5;
this.label1.Text = "App";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(220, 18);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(37, 17);
this.label2.TabIndex = 6;
this.label2.Text = "Host";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(345, 18);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 17);
this.label3.TabIndex = 7;
this.label3.Text = "Status";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(468, 18);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 17);
this.label4.TabIndex = 8;
this.label4.Text = "Type";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(980, 18);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(45, 17);
this.label5.TabIndex = 9;
this.label5.Text = "Users";
//
// btnLoad
//
this.btnLoad.Location = new System.Drawing.Point(1163, 38);
this.btnLoad.Name = "btnLoad";
this.btnLoad.Size = new System.Drawing.Size(131, 68);
this.btnLoad.TabIndex = 10;
this.btnLoad.Text = "SEARCH";
this.btnLoad.UseVisualStyleBackColor = true;
this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
this.btnDelete.Location = new System.Drawing.Point(1086, 38);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(131, 68);
this.btnDelete.TabIndex = 11;
this.btnDelete.Text = "DELETE";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1332, 554);
this.ClientSize = new System.Drawing.Size(1255, 554);
this.Controls.Add(this.gboxFiltri);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.ErrorsDGV);
@@ -407,6 +418,7 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnLoad;
private System.Windows.Forms.Button btnDelete;
}
}
+53 -2
View File
@@ -84,6 +84,18 @@ namespace ELMA
private void btnLoad_Click(object sender, EventArgs e)
{
updateSelection();
//this.bsErrors.DataSource = model.ELMAH_Error.Local.ToBindingList();
}
private void updateSelection()
{
List<ELMAH_Error> subset = getFiltData();
this.bsErrors.DataSource = subset;
}
private List<ELMAH_Error> getFiltData()
{
var dbSet = model.ELMAH_Error;
int statusCode = 0;
@@ -97,8 +109,47 @@ namespace ELMA
&& x.Type == selType
&& x.User == selUser
).ToList();
this.bsErrors.DataSource = subset;
//this.bsErrors.DataSource = model.ELMAH_Error.Local.ToBindingList();
return subset;
}
private void listApp_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
}
private void listHost_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
}
private void listStatus_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
}
private void listType_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
}
private void listUsers_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
}
private void btnDelete_Click(object sender, EventArgs e)
{
// elimino 1:1 da selezione
foreach (var item in getFiltData())
{
model.ELMAH_Error.Remove(item);
}
// salvo
model.SaveChangesAsync();
// aggiorno
updateSelection();
}
}
}