示例#1
0
 public override void Change()
 {
     if (!(MyRule.Get(MyLogin.RoleId, "bbiSubsidiary") != "OK"))
     {
         if (MyRule.AllowAccess)
         {
             HRM_SUBSIDIARY hRMSUBSIDIARY = new HRM_SUBSIDIARY();
             object         cellValue     = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "SubsidiaryCode");
             if (cellValue != null)
             {
                 base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                 if (!(hRMSUBSIDIARY.Get(cellValue.ToString()) != "OK"))
                 {
                     this.DoHide();
                     xfmSubsidiaryAdd _xfmSubsidiaryAdd = new xfmSubsidiaryAdd(Actions.Update, hRMSUBSIDIARY);
                     _xfmSubsidiaryAdd.Updated += new xfmSubsidiaryAdd.UpdatedEventHander(this.frm_Updated);
                     _xfmSubsidiaryAdd.Added   += new xfmSubsidiaryAdd.AddedEventHander(this.frm_Added);
                     _xfmSubsidiaryAdd.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, "bbiSubsidiary") != "OK"))
     {
         if (MyRule.AllowAdd)
         {
             xfmSubsidiaryAdd _xfmSubsidiaryAdd = new xfmSubsidiaryAdd(Actions.Add);
             _xfmSubsidiaryAdd.Added += new xfmSubsidiaryAdd.AddedEventHander(this.frm_Added);
             _xfmSubsidiaryAdd.ShowDialog();
         }
         else
         {
             MyRule.Notify();
         }
     }
 }
示例#3
0
        private void glk_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            string name;

            if (e.Button.Kind == ButtonPredefines.Plus)
            {
                name = (sender as GridLookUpEdit).Name;
                if (name != null)
                {
                    if (name == "glkSubsidiary")
                    {
                        xfmSubsidiaryAdd _xfmSubsidiaryAdd = new xfmSubsidiaryAdd(Actions.Add);
                        _xfmSubsidiaryAdd.Added += new xfmSubsidiaryAdd.AddedEventHander((object s, HRM_SUBSIDIARY i) => (new HRM_SUBSIDIARY()).AddGridLookupEdit(this.glkSubsidiary));
                        _xfmSubsidiaryAdd.ShowDialog();
                        goto Label2;
                    }
                    else if (name == "glkBranch")
                    {
                        xfmBranchAdd _xfmBranchAdd = new xfmBranchAdd(Actions.Add);
                        _xfmBranchAdd.Added += new xfmBranchAdd.AddedEventHander((object s, HRM_BRANCH i) => {
                            HRM_BRANCH hRMBRANCH = new HRM_BRANCH();
                            if ((this.glkSubsidiary.EditValue == null ? false : !(this.glkSubsidiary.Text == "")))
                            {
                                this.glkBranch.Properties.DataSource = hRMBRANCH.GetListBySubsidiary(this.glkSubsidiary.EditValue.ToString());
                            }
                            else
                            {
                                this.glkBranch.Properties.DataSource = hRMBRANCH.GetList();
                            }
                        });
                        _xfmBranchAdd.ShowDialog();
                        goto Label2;
                    }
                    else
                    {
                        if (name != "glkDepartment")
                        {
                            goto Label2;
                        }
                        xfmDepartmentAdd _xfmDepartmentAdd = new xfmDepartmentAdd(Actions.Add);
                        _xfmDepartmentAdd.Added += new xfmDepartmentAdd.AddedEventHander((object s, HRM_DEPARTMENT i) => {
                            HRM_DEPARTMENT hRMDEPARTMENT = new HRM_DEPARTMENT();
                            if ((this.glkBranch.EditValue == null ? false : !(this.glkBranch.Text == "")))
                            {
                                hRMDEPARTMENT.AddGridLookupEdit(this.glkDepartment, this.glkBranch.EditValue.ToString());
                            }
                            else
                            {
                                this.glkDepartment.Properties.DataSource = hRMDEPARTMENT.GetList();
                            }
                        });
                        _xfmDepartmentAdd.ShowDialog();
                        goto Label2;
                    }
                }
                Label2 :;
            }
            else if (e.Button.Kind == ButtonPredefines.Delete)
            {
                name = (sender as GridLookUpEdit).Name;
                if (name != null)
                {
                    if (name == "glkSubsidiary")
                    {
                        this.glkSubsidiary.EditValue = null;
                        goto Label0;
                    }
                    else if (name == "glkBranch")
                    {
                        this.glkBranch.EditValue = null;
                        goto Label0;
                    }
                    else
                    {
                        if (name != "glkDepartment")
                        {
                            goto Label0;
                        }
                        this.glkDepartment.EditValue = null;
                        goto Label0;
                    }
                }
                Label0 :;
            }
        }