private void btnDelete_Click(object sender, EventArgs e) { try { if (dgvExpense.CurrentRow != null) { SetSortedColumns(); frmExpenseEntry fExpense = new frmExpenseEntry((int)Constant.Mode.Delete, Convert.ToInt64(dgvExpense.CurrentRow.Cells["ExpenseID"].Value)); fExpense.ShowDialog(); setDefaultGridRecords(sender, e); btnDelete.Focus(); } } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Expense", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }
private void btnNew_Click(object sender, EventArgs e) { try { frmExpenseEntry fExpense = new frmExpenseEntry((int)Constant.Mode.Insert, 0); fExpense.ShowDialog(); LoadList(); DV = dtblExpense.DefaultView; DV.RowFilter = StrFilter; dgvExpense.DataSource = DV.ToTable(); lblTotRec.Text = Utill.Common.CommonMessage.TotalRecord + dgvExpense.RowCount.ToString(); } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Expense", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }