private void btnEditNew_Click(object sender, EventArgs e) { try { frmAddEditPayrollOT frm = new frmAddEditPayrollOT(MethodType.Add, new PayrollOT() { ObRId = this.obrId }); frm.ShowDialog(); Init(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEditPayrollRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { UnitOfWork unitOfWork = new UnitOfWork(); if (PayrollDiffGridView.GetFocusedRow() is PayrollOT item) { frmAddEditPayrollOT frm = new frmAddEditPayrollOT(MethodType.Edit, item); frm.ShowDialog(); Init(); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }