Ejemplo n.º 1
0
        public override void Change()
        {
            if (MyRule.IsAccess("bbiDepartment"))
            {
                HRM_DEPARTMENT hRMDEPARTMENT       = new HRM_DEPARTMENT();
                object         focusedRowCellValue = this.gbList.GetFocusedRowCellValue("DepartmentCode");

                if (focusedRowCellValue != null)
                {
                    base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                    if (!(hRMDEPARTMENT.Get(focusedRowCellValue.ToString()) != "OK"))
                    {
                        this.DoHide();
                        xfmDepartmentAdd _xfmDepartmentAdd = new xfmDepartmentAdd(Actions.Update, hRMDEPARTMENT);
                        _xfmDepartmentAdd.Updated += new xfmDepartmentAdd.UpdatedEventHander(this.frm_Updated);
                        _xfmDepartmentAdd.Added   += new xfmDepartmentAdd.AddedEventHander(this.frm_Added);
                        _xfmDepartmentAdd.ShowDialog();
                    }
                    else
                    {
                        this.DoHide();
                        XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void Add()
        {
            xfmDepartmentAdd _xfmDepartmentAdd = new xfmDepartmentAdd(Actions.Add);

            _xfmDepartmentAdd.Added += new xfmDepartmentAdd.AddedEventHander(this.frm_Added);
            _xfmDepartmentAdd.ShowDialog();
        }
Ejemplo n.º 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 :;
            }
        }