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