From b5f4743d8d20a59010dc0c51a5cc5f633834f8b3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 14 Jul 2022 12:41:21 +0200 Subject: [PATCH] =?UTF-8?q?Update=20modalit=C3=A0=20cancellazione=20x=20sp?= =?UTF-8?q?eedup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppData/AppData.csproj | 15 +- AppData/packages.config | 3 +- ELMA/App.config | 2 +- ELMA/ELMA.csproj | 19 +- ELMA/LogAnalyzer.Designer.cs | 39 +- ELMA/LogAnalyzer.cs | 759 ++++++++++++++++++----------------- ELMA/packages.config | 4 +- 7 files changed, 453 insertions(+), 388 deletions(-) diff --git a/AppData/AppData.csproj b/AppData/AppData.csproj index ef51366..ecb31b2 100644 --- a/AppData/AppData.csproj +++ b/AppData/AppData.csproj @@ -1,5 +1,6 @@  + Debug @@ -12,6 +13,8 @@ v4.6.2 512 true + + true @@ -32,10 +35,10 @@ - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll @@ -63,4 +66,12 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/AppData/packages.config b/AppData/packages.config index 4ab4fa4..5f81378 100644 --- a/AppData/packages.config +++ b/AppData/packages.config @@ -1,5 +1,4 @@  - - + \ No newline at end of file diff --git a/ELMA/App.config b/ELMA/App.config index da141b4..b54efaf 100644 --- a/ELMA/App.config +++ b/ELMA/App.config @@ -19,6 +19,6 @@ - + \ No newline at end of file diff --git a/ELMA/ELMA.csproj b/ELMA/ELMA.csproj index 865c5d4..cab4bb3 100644 --- a/ELMA/ELMA.csproj +++ b/ELMA/ELMA.csproj @@ -1,5 +1,6 @@  + Debug @@ -12,6 +13,8 @@ 512 true true + + AnyCPU @@ -34,13 +37,13 @@ - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -131,4 +134,12 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/ELMA/LogAnalyzer.Designer.cs b/ELMA/LogAnalyzer.Designer.cs index e546306..341ae4e 100644 --- a/ELMA/LogAnalyzer.Designer.cs +++ b/ELMA/LogAnalyzer.Designer.cs @@ -45,6 +45,8 @@ this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.tsslNumRec = new System.Windows.Forms.ToolStripStatusLabel(); this.gboxFiltri = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.txtMaxRow = new System.Windows.Forms.TextBox(); this.btnDeleteSel = new System.Windows.Forms.Button(); this.chkUsers = new System.Windows.Forms.CheckBox(); this.chkStatus = new System.Windows.Forms.CheckBox(); @@ -62,8 +64,6 @@ this.currentConfigToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.txtMaxRow = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bsErrors)).BeginInit(); this.statusStrip1.SuspendLayout(); @@ -239,6 +239,24 @@ this.gboxFiltri.TabStop = false; this.gboxFiltri.Text = "Filtri"; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(813, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(65, 13); + this.label1.TabIndex = 19; + this.label1.Text = "Max Record"; + // + // txtMaxRow + // + this.txtMaxRow.Location = new System.Drawing.Point(816, 31); + this.txtMaxRow.Name = "txtMaxRow"; + this.txtMaxRow.Size = new System.Drawing.Size(80, 20); + this.txtMaxRow.TabIndex = 18; + this.txtMaxRow.Text = "1000"; + this.txtMaxRow.TextChanged += new System.EventHandler(this.txtMaxRow_TextChanged); + // // btnDeleteSel // this.btnDeleteSel.Location = new System.Drawing.Point(690, 31); @@ -411,23 +429,6 @@ this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // - // txtMaxRow - // - this.txtMaxRow.Location = new System.Drawing.Point(816, 31); - this.txtMaxRow.Name = "txtMaxRow"; - this.txtMaxRow.Size = new System.Drawing.Size(80, 20); - this.txtMaxRow.TabIndex = 18; - this.txtMaxRow.Text = "1000"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(813, 15); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 13); - this.label1.TabIndex = 19; - this.label1.Text = "Max Record"; - // // LogAnalyzer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/ELMA/LogAnalyzer.cs b/ELMA/LogAnalyzer.cs index 734cb40..39e1233 100644 --- a/ELMA/LogAnalyzer.cs +++ b/ELMA/LogAnalyzer.cs @@ -1,32 +1,406 @@ -using System; +using AppData; +using Newtonsoft.Json; +using System; using System.Collections.Generic; -using System.ComponentModel; using System.Data; using System.Data.Entity; -using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -using AppData; -using Newtonsoft; -using Newtonsoft.Json; namespace ELMA { public partial class LogAnalyzer : Form { - - #region setup - - ElmahModel model = new ElmahModel(); + #region Public Fields /// - /// Oggetto conf setup + /// Oggetto conf setup /// public eSetup activeSetup = new eSetup(); + #endregion Public Fields + + #region Public Constructors + + public LogAnalyzer() + { + InitializeComponent(); + myInit(); + startTimers(); + } + + #endregion Public Constructors + + #region Protected Properties + + protected string selApp + { get { return listApp.SelectedItem.ToString(); } } + protected string selHost + { get { return listHost.SelectedItem.ToString(); } } + + protected string selStatus + { + get + { + string answ = ""; + if (chkStatus.Checked) + { + if (listStatus.SelectedItem != null) + { + answ = listStatus.SelectedItem.ToString(); + } + } + return answ; + } + } + + protected string selType + { get { return listType.SelectedItem.ToString(); } } + protected string selUser + { get { return listUsers.SelectedItem.ToString(); } } + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Calcola path applicazione partendo da bassePath + /// + /// + /// + protected string getAppPath(string application) + { + return application.Replace(activeSetup.appBasePath, ""); + } + + #endregion Protected Methods + + #region Private Fields + + private ElmahModel model = new ElmahModel(); + + #endregion Private Fields + + #region Private Methods + + /// + /// Elimino record selezionati + /// + /// + /// + private void btnDeleteSel_Click(object sender, EventArgs e) + { + deleteSelRows().ConfigureAwait(false); + } + + private void checkFilterVisibility() + { + // Verifico TUTTI i filtri + listApp.Enabled = chkApp.Checked && listApp.Items.Count > 0; + listHost.Enabled = chkHost.Checked && listHost.Items.Count > 0; + listStatus.Enabled = chkStatus.Checked && listStatus.Items.Count > 0; + listType.Enabled = chkType.Checked && listType.Items.Count > 0; + listUsers.Enabled = chkUsers.Checked && listUsers.Items.Count > 0; + } + + private void chkApp_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + private void chkHost_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + private void chkStatus_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + private void chkType_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + private void chkUsers_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + private void currentConfigToolStripMenuItem_Click(object sender, EventArgs e) + { + ConfigMan currConfig = new ConfigMan(); + currConfig.currSetup = activeSetup; + currConfig.Owner = this; + currConfig.doUpdate(); + currConfig.Show(); + } + + private void deleteRecordFiltered() + { + // elimino 1:1 da selezione + foreach (var item in getFiltData()) + { + model.ELMAH_Error.Remove(item); + } + + // salvo + model.SaveChangesAsync(); + // aggiorno!! + setupFilterData(); + doUpdate(); + } + + private async Task deleteSelRows() + { + List selIdx = new List(); + Guid ErrorId; + // num max x ogni step... + int maxBatch = 500; + // SOLO SE selezionato in dgv... + int totRow = ErrorsDGV.SelectedRows.Count; + if (totRow > 0) + { + foreach (DataGridViewRow riga in ErrorsDGV.SelectedRows) + { + selIdx.Add($"'{((ELMAH_Error)riga.DataBoundItem).ErrorId}'"); +#if false + // chiudo! + ErrorId = ((ELMAH_Error)riga.DataBoundItem).ErrorId; + try + { + model.ELMAH_Error.Remove((ELMAH_Error)riga.DataBoundItem); + } + catch + { } +#endif + // verifico se cancellare + if (selIdx.Count >= maxBatch) + { + await deleteList(selIdx); + // resetto + selIdx = new List(); + } + } + } + if (selIdx.Count > 0) + { + await deleteList(selIdx); + } + // aggiorno!! + doUpdate(); + } + + private async Task deleteList(List selIdx) + { + // scrivo query x cancellare tutti... + string stringOfIds = string.Join(",", selIdx); + await model.Database.ExecuteSqlCommandAsync($"DELETE FROM ELMAH_Error WHERE ErrorId IN ({stringOfIds})"); + // salvo/eseguo + await model.SaveChangesAsync(); + } + + /// + /// Aggiornamento visualizzazioni + /// + private void doUpdate() + { + checkFilterVisibility(); + updateSelection(); + } + + private void ErrorsDGV_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + // seleziono riga + } + + private void ErrorsDGV_DoubleClick(object sender, EventArgs e) + { + // recupero valore... + Guid ErrorId; + string appPath = ""; + string pageUrl = ""; + // SOLO SE selezionato in dgv... + if (ErrorsDGV.SelectedRows.Count > 0) + { + foreach (DataGridViewRow riga in ErrorsDGV.SelectedRows) + { + // recupero dati + ErrorId = ((ELMAH_Error)riga.DataBoundItem).ErrorId; + appPath = getAppPath(((ELMAH_Error)riga.DataBoundItem).Application); + // SE appPAth !="" accodo... + if (!string.IsNullOrEmpty(appPath)) + { + pageUrl = $"{activeSetup.baseUrl}/{appPath}/elmah.axd/detail?id={ErrorId}"; + } + else + { + pageUrl = $"{activeSetup.baseUrl}/elmah.axd/detail?id={ErrorId}"; + } + // mostro form + var newBrowser = new WBrowser(); + newBrowser.pageUrl = pageUrl; + newBrowser.Show(); + } + } + } + + private int allRecord = 0; + + private List getFiltData() + { + var dbSet = model.ELMAH_Error; + int statusCode = 0; + int.TryParse(selStatus, out statusCode); + string selApp = listApp.SelectedItem.ToString(); + // inizio azione filtraggio.. + IQueryable subset = dbSet.Where(x => x.Sequence > 0); + if (chkApp.Checked) + { + subset = subset.Where(x => x.Application == selApp); + } + if (chkHost.Checked) + { + subset = subset.Where(x => x.Host == selHost); + } + if (chkStatus.Checked) + { + subset = subset.Where(x => x.StatusCode == statusCode); + } + if (chkType.Checked) + { + subset = subset.Where(x => x.Type == selType); + } + if (chkUsers.Checked) + { + subset = subset.Where(x => x.User == selUser); + } + int maxRec = 100; + int.TryParse(txtMaxRow.Text, out maxRec); + // calcolo tutti ir ecord filtrati... + allRecord = subset.Count(); + // se + di maxRec --> filtro + if (allRecord > maxRec) + { + subset = subset.Take(maxRec); + } + return subset.OrderByDescending(x => x.TimeUtc).ToList(); + } + + private void listApp_SelectedIndexChanged(object sender, EventArgs e) + { + if (chkApp.Checked) + doUpdate(); + } + + private void listHost_SelectedIndexChanged(object sender, EventArgs e) + { + if (chkHost.Checked) + doUpdate(); + } + + private void listStatus_SelectedIndexChanged(object sender, EventArgs e) + { + if (chkStatus.Checked) + doUpdate(); + } + + private void listType_SelectedIndexChanged(object sender, EventArgs e) + { + if (chkType.Checked) + doUpdate(); + } + + private void listUsers_SelectedIndexChanged(object sender, EventArgs e) + { + if (chkUsers.Checked) + doUpdate(); + } + + /// + /// Carica la conf corrente + /// + /// + private void loadConf(string filePath) + { + if (File.Exists(filePath)) + { + try + { + activeSetup = JsonConvert.DeserializeObject(File.ReadAllText(filePath)); + } + catch + { } + } + } + + private void loadToolStripMenuItem_Click(object sender, EventArgs e) + { + // salvo la conf corrente... + OpenFileDialog oFileDialog = new OpenFileDialog(); + oFileDialog.DefaultExt = "jset"; + oFileDialog.Filter = "Conf files (*.jset)|*.jset|All files (*.*)|*.*"; + oFileDialog.InitialDirectory = Utils.confDir; + oFileDialog.RestoreDirectory = true; + if (oFileDialog.ShowDialog() == DialogResult.OK) + { + // carico + loadConf(oFileDialog.FileName); + } + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + timerMain.Stop(); + } + + private void myInit() + { + setupConfig(); + setupFilterData(); + doUpdate(); + } + + private void resetFilter() + { + chkApp.Checked = false; + chkHost.Checked = false; + chkStatus.Checked = false; + chkType.Checked = false; + chkUsers.Checked = false; + } + + /// + /// Salva conf corrente sul file indicato + /// + /// + private void saveConf(string filePath) + { + // .. e lo salvo... + string rawData = JsonConvert.SerializeObject(activeSetup, Formatting.Indented); + File.WriteAllText(filePath, rawData); + } + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + // salvo la conf corrente... + SaveFileDialog sFileDialog = new SaveFileDialog(); + sFileDialog.DefaultExt = "jset"; + sFileDialog.Filter = "Conf files (*.jset)|*.jset|All files (*.*)|*.*"; + sFileDialog.InitialDirectory = Utils.confDir; + sFileDialog.RestoreDirectory = true; + if (sFileDialog.ShowDialog() == DialogResult.OK) + { + // salvo! + string rawData = JsonConvert.SerializeObject(activeSetup, Formatting.Indented); + saveConf(sFileDialog.FileName); + } + } + /// /// Setup configurazione da std file /// @@ -51,114 +425,6 @@ namespace ELMA saveConf(filePath); } } - /// - /// Carica la conf corrente - /// - /// - private void loadConf(string filePath) - { - if (File.Exists(filePath)) - { - try - { - activeSetup = JsonConvert.DeserializeObject(File.ReadAllText(filePath)); - } - catch - { } - } - } - - /// - /// Salva conf corrente sul file indicato - /// - /// - private void saveConf(string filePath) - { - // .. e lo salvo... - string rawData = JsonConvert.SerializeObject(activeSetup, Formatting.Indented); - File.WriteAllText(filePath, rawData); - } - - private void currentConfigToolStripMenuItem_Click(object sender, EventArgs e) - { - ConfigMan currConfig = new ConfigMan(); - currConfig.currSetup = activeSetup; - currConfig.Owner = this; - currConfig.doUpdate(); - currConfig.Show(); - } - - private void loadToolStripMenuItem_Click(object sender, EventArgs e) - { - // salvo la conf corrente... - OpenFileDialog oFileDialog = new OpenFileDialog(); - oFileDialog.DefaultExt = "jset"; - oFileDialog.Filter = "Conf files (*.jset)|*.jset|All files (*.*)|*.*"; - oFileDialog.InitialDirectory = Utils.confDir; - oFileDialog.RestoreDirectory = true; - if (oFileDialog.ShowDialog() == DialogResult.OK) - { - // carico - loadConf(oFileDialog.FileName); - } - } - - private void saveToolStripMenuItem_Click(object sender, EventArgs e) - { - // salvo la conf corrente... - SaveFileDialog sFileDialog = new SaveFileDialog(); - sFileDialog.DefaultExt = "jset"; - sFileDialog.Filter = "Conf files (*.jset)|*.jset|All files (*.*)|*.*"; - sFileDialog.InitialDirectory = Utils.confDir; - sFileDialog.RestoreDirectory = true; - if (sFileDialog.ShowDialog() == DialogResult.OK) - { - // salvo! - string rawData = JsonConvert.SerializeObject(activeSetup, Formatting.Indented); - saveConf(sFileDialog.FileName); - } - } - - #endregion - - #region area init & close - - public LogAnalyzer() - { - InitializeComponent(); - myInit(); - startTimers(); - } - - private void startTimers() - { - timerMain.Start(); - } - - - private void MainForm_FormClosing(object sender, FormClosingEventArgs e) - { - timerMain.Stop(); - } - - private void myInit() - { - setupConfig(); - setupFilterData(); - doUpdate(); - } - - private void timerMain_Tick(object sender, EventArgs e) - { -#if false - setupFilterData(); - doUpdate(); -#endif - } - - #endregion - - #region Utils e metodi dati private void setupFilterData() { @@ -217,35 +483,24 @@ namespace ELMA listType.SelectedIndex = 0; listUsers.SelectedIndex = 0; } - private void checkFilterVisibility() + + private void startTimers() { - // Verifico TUTTI i filtri - listApp.Enabled = chkApp.Checked && listApp.Items.Count > 0; - listHost.Enabled = chkHost.Checked && listHost.Items.Count > 0; - listStatus.Enabled = chkStatus.Checked && listStatus.Items.Count > 0; - listType.Enabled = chkType.Checked && listType.Items.Count > 0; - listUsers.Enabled = chkUsers.Checked && listUsers.Items.Count > 0; + timerMain.Start(); } - protected string selApp { get { return listApp.SelectedItem.ToString(); } } - protected string selStatus + private void timerMain_Tick(object sender, EventArgs e) { - get - { - string answ = ""; - if (chkStatus.Checked) - { - if (listStatus.SelectedItem != null) - { - answ = listStatus.SelectedItem.ToString(); - } - } - return answ; - } +#if false + setupFilterData(); + doUpdate(); +#endif + } + + private void txtMaxRow_TextChanged(object sender, EventArgs e) + { + doUpdate(); } - protected string selHost { get { return listHost.SelectedItem.ToString(); } } - protected string selType { get { return listType.SelectedItem.ToString(); } } - protected string selUser { get { return listUsers.SelectedItem.ToString(); } } private void updateSelection() { @@ -255,221 +510,9 @@ namespace ELMA { ErrorsDGV.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; } - tsslNumRec.Text = $"{subset.Count} rec"; + tsslNumRec.Text = $"{subset.Count}/{allRecord} rec"; } - private List getFiltData() - { - var dbSet = model.ELMAH_Error; - int statusCode = 0; - int.TryParse(selStatus, out statusCode); - string selApp = listApp.SelectedItem.ToString(); - // inizio azione filtraggio.. - IQueryable subset = dbSet.Where(x => x.Sequence > 0); - if (chkApp.Checked) - { - subset = subset.Where(x => x.Application == selApp); - } - if (chkHost.Checked) - { - subset = subset.Where(x => x.Host == selHost); - } - if (chkStatus.Checked) - { - subset = subset.Where(x => x.StatusCode == statusCode); - } - if (chkType.Checked) - { - subset = subset.Where(x => x.Type == selType); - } - if (chkUsers.Checked) - { - subset = subset.Where(x => x.User == selUser); - } - int maxRec = 100; - int.TryParse(txtMaxRow.Text, out maxRec); - // se + di maxRec --> filtro - if (subset.Count() > maxRec) - { - subset = subset.Take(maxRec); - } - return subset.OrderByDescending(x => x.TimeUtc).ToList(); - } - /// - /// Aggiornamento visualizzazioni - /// - private void doUpdate() - { - checkFilterVisibility(); - updateSelection(); - } - - private void deleteRecordFiltered() - { - // elimino 1:1 da selezione - foreach (var item in getFiltData()) - { - model.ELMAH_Error.Remove(item); - } - - // salvo - model.SaveChangesAsync(); - // aggiorno!! - setupFilterData(); - doUpdate(); - } - - private void deleteSelRows() - { - Guid ErrorId; - // SOLO SE selezionato in dgv... - if (ErrorsDGV.SelectedRows.Count > 0) - { - - foreach (DataGridViewRow riga in ErrorsDGV.SelectedRows) - { - // chiudo! - ErrorId = ((ELMAH_Error)riga.DataBoundItem).ErrorId; - try - { - model.ELMAH_Error.Remove((ELMAH_Error)riga.DataBoundItem); - } - catch - { } - } - } - - // salvo - model.SaveChanges(); - // aggiorno!! - doUpdate(); - } - - private void resetFilter() - { - chkApp.Checked = false; - chkHost.Checked = false; - chkStatus.Checked = false; - chkType.Checked = false; - chkUsers.Checked = false; - } - - #endregion - - #region area interazione - - private void listApp_SelectedIndexChanged(object sender, EventArgs e) - { - if (chkApp.Checked) - doUpdate(); - } - - private void listHost_SelectedIndexChanged(object sender, EventArgs e) - { - if (chkHost.Checked) - doUpdate(); - } - - private void listStatus_SelectedIndexChanged(object sender, EventArgs e) - { - if (chkStatus.Checked) - doUpdate(); - } - - private void listType_SelectedIndexChanged(object sender, EventArgs e) - { - if (chkType.Checked) - doUpdate(); - } - - private void listUsers_SelectedIndexChanged(object sender, EventArgs e) - { - if (chkUsers.Checked) - doUpdate(); - } - - private void chkApp_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } - - - private void chkType_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } - - private void chkStatus_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } - - private void chkHost_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } - - private void chkUsers_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } - - private void ErrorsDGV_CellDoubleClick(object sender, DataGridViewCellEventArgs e) - { - // seleziono riga - } - /// - /// Elimino record selezionati - /// - /// - /// - private void btnDeleteSel_Click(object sender, EventArgs e) - { - deleteSelRows(); - } - /// - /// Calcola path applicazione partendo da bassePath - /// - /// - /// - protected string getAppPath(string application) - { - return application.Replace(activeSetup.appBasePath, ""); - } - - private void ErrorsDGV_DoubleClick(object sender, EventArgs e) - { - // recupero valore... - Guid ErrorId; - string appPath = ""; - string pageUrl = ""; - // SOLO SE selezionato in dgv... - if (ErrorsDGV.SelectedRows.Count > 0) - { - - foreach (DataGridViewRow riga in ErrorsDGV.SelectedRows) - { - // recupero dati - ErrorId = ((ELMAH_Error)riga.DataBoundItem).ErrorId; - appPath = getAppPath(((ELMAH_Error)riga.DataBoundItem).Application); - // SE appPAth !="" accodo... - if (!string.IsNullOrEmpty(appPath)) - { - pageUrl = $"{activeSetup.baseUrl}/{appPath}/elmah.axd/detail?id={ErrorId}"; - } - else - { - pageUrl = $"{activeSetup.baseUrl}/elmah.axd/detail?id={ErrorId}"; - } - // mostro form - var newBrowser = new WBrowser(); - newBrowser.pageUrl = pageUrl; - newBrowser.Show(); - } - } - } - - #endregion - + #endregion Private Methods } -} +} \ No newline at end of file diff --git a/ELMA/packages.config b/ELMA/packages.config index 5b2dbc5..b247258 100644 --- a/ELMA/packages.config +++ b/ELMA/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file