public override void Change() { if (!(MyRule.Get(MyLogin.RoleId, "bbiShift") != "OK")) { if (MyRule.AllowAccess) { DIC_SHIFT dICSHIFT = new DIC_SHIFT(); object cellValue = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "ShiftCode"); if (cellValue != null) { base.SetWaitDialogCaption("Đang kiểm tra dữ liệu...."); if (!(dICSHIFT.Get(cellValue.ToString()) != "OK")) { this.DoHide(); xfmShiftAdd _xfmShiftAdd = new xfmShiftAdd(Actions.Update, dICSHIFT); _xfmShiftAdd.Updated += new xfmShiftAdd.UpdatedEventHander(this.frm_Updated); _xfmShiftAdd.Added += new xfmShiftAdd.AddedEventHander(this.frm_Added); _xfmShiftAdd.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(); } } }
protected override void Add() { if (!(MyRule.Get(MyLogin.RoleId, "bbiShift") != "OK")) { if (MyRule.AllowAdd) { xfmShiftAdd _xfmShiftAdd = new xfmShiftAdd(Actions.Add); _xfmShiftAdd.Added += new xfmShiftAdd.AddedEventHander(this.frm_Added); _xfmShiftAdd.ShowDialog(); } else { MyRule.Notify(); } } }