private void btnNew_Click(object sender, EventArgs e) { try { frmAddEditRIS frm = new frmAddEditRIS(Models.MethodType.Add, new RISHeader() { PRId = PRId }); frm.ShowDialog(); Init(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnEditPQRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { UnitOfWork unitOfWork = new UnitOfWork(); if (this.RISGridView.GetFocusedRow() is RISHeader item) { frmAddEditRIS frm = new frmAddEditRIS(MethodType.Edit, item); frm.ShowDialog(); Init(); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }