예제 #1
0
 public override void Change()
 {
     if (!(MyRule.Get(MyLogin.RoleId, "bbiMachine") != "OK"))
     {
         if (MyRule.AllowAccess)
         {
             DIC_MACHINE dICMACHINE = new DIC_MACHINE();
             object      cellValue  = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "MachineCode");
             if (cellValue != null)
             {
                 base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                 if (!(dICMACHINE.Get(cellValue.ToString()) != "OK"))
                 {
                     this.DoHide();
                     xfmMachineAdd _xfmMachineAdd = new xfmMachineAdd(Actions.Update, dICMACHINE);
                     _xfmMachineAdd.Updated += new xfmMachineAdd.UpdatedEventHander(this.frm_Updated);
                     _xfmMachineAdd.Added   += new xfmMachineAdd.AddedEventHander(this.frm_Added);
                     _xfmMachineAdd.ShowDialog();
                 }
                 else
                 {
                     this.DoHide();
                     XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
             }
         }
         else
         {
             MyRule.Notify();
         }
     }
 }
예제 #2
0
 protected override void Add()
 {
     if (!(MyRule.Get(MyLogin.RoleId, "bbiMachine") != "OK"))
     {
         if (MyRule.AllowAdd)
         {
             xfmMachineAdd _xfmMachineAdd = new xfmMachineAdd(Actions.Add);
             _xfmMachineAdd.Added += new xfmMachineAdd.AddedEventHander(this.frm_Added);
             _xfmMachineAdd.ShowDialog();
         }
         else
         {
             MyRule.Notify();
         }
     }
 }