Beispiel #1
0
 private void btnEditORDetails_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (ORDetailsGridView.GetFocusedRow() is ORDetails item)
         {
             frmAddEditObligation frm = new frmAddEditObligation(MethodType.Edit, item.Obligations);
             frm.ShowDialog();
             loadObligations.Detail(item.Obligations);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Add Obligations"))
            {
                return;
            }

            frmPrompPR prompPR = new frmPrompPR();

            prompPR.ShowDialog();
            if (prompPR.CreateObR)
            {
                return;
            }
            var item = new Obligations();
            frmAddEditObligation frm = new frmAddEditObligation(MethodType.Add, item);

            frm.ShowDialog();
            loadObligations.Init();
            loadObligations.Detail(obligations);
        }