/// <summary> /// method to handle each column click /// </summary> /// <param name="sender">click</param> /// <param name="e">event</param> private void dgvLicence_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 8) { if (dgvLicence.Rows[e.RowIndex].Cells[8].Value.ToString() != "0") { string exepathName = dgvLicence.Rows[e.RowIndex].Cells[0].Value.ToString(); frmTransactions frm = new frmTransactions(System.IO.Path.GetFileName(exepathName)); frm.ShowDialog(); } } if (e.ColumnIndex == 9) { if (!string.IsNullOrEmpty(dgvLicence.Rows[e.RowIndex].Cells[0].Value.ToString())) { string exepathName = dgvLicence.Rows[e.RowIndex].Cells[0].Value.ToString(); var getLicences = Licence.GetInfo(exepathName); if (getLicences != null) { DialogResult x = MessageBox.Show("Are you Sure to Delete?", "Delete Confirmation", MessageBoxButtons.OKCancel); if (x == DialogResult.OK) { bool action = Licence.Delete(exepathName); if (action) { bindingLicenses.RemoveAt(e.RowIndex); bindingLicenses.ResetBindings(false); SingletonLogger.Instance.Info("Licencess of exe:" + exepathName + " has Successfully deleted"); } else { SingletonLogger.Instance.Error("Error while Deleting Licences of exe:" + exepathName); } } } else { bindingLicenses.RemoveAt(e.RowIndex); bindingLicenses.ResetBindings(false); } } else { int cc = bindingLicenses.Count - 1; bindingLicenses.RemoveAt(e.RowIndex); bindingLicenses.ResetBindings(false); } } }
/// <summary> /// Show all running instancess /// </summary> /// <param name="sender">All Instancess button Click</param> /// <param name="e">event</param> private void btnAllInstances_Click(object sender, EventArgs e) { frmTransactions frm = new frmTransactions(); frm.ShowDialog(); }