private void btnNew_Click(object sender, EventArgs e) { try { frmItemEntry fItem = new frmItemEntry((int)Constant.Mode.Insert, 0); fItem.ShowInTaskbar = false; fItem.ShowDialog(); LoadList(); } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Item Register", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }
private void btnEdit_Click(object sender, EventArgs e) { try { if (dgvItemRegister.CurrentRow != null) { if (dgvItemRegister.SortedColumn != null) { sortedColumn = dgvItemRegister.SortedColumn; sortDirection = dgvItemRegister.SortOrder; } frmItemEntry fItem = new frmItemEntry((int)Constant.Mode.Modify, (Int64)dgvItemRegister.CurrentRow.Cells["ItemID"].Value); fItem.ShowInTaskbar = false; fItem.ShowDialog(); setDefaultGridRecords(sender, e); } } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("Item Register", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }