Пример #1
0
 public override void Change()
 {
     if (MyRule.IsAccess("bbiGroup"))
     {
         HRM_GROUP hRMGROUP            = new HRM_GROUP();
         object    focusedRowCellValue = this.gbList.GetFocusedRowCellValue("GroupCode");
         if (focusedRowCellValue != null)
         {
             base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
             if (!(hRMGROUP.Get(focusedRowCellValue.ToString()) != "OK"))
             {
                 this.DoHide();
                 xfmGroupAdd _xfmGroupAdd = new xfmGroupAdd(Actions.Update, hRMGROUP);
                 _xfmGroupAdd.Updated += new xfmGroupAdd.UpdatedEventHander(this.frm_Updated);
                 _xfmGroupAdd.Added   += new xfmGroupAdd.AddedEventHander(this.frm_Added);
                 _xfmGroupAdd.ShowDialog();
             }
             else
             {
                 this.DoHide();
                 XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
Пример #2
0
 private void LoadDepartment()
 {
     if (this.m_Level == 0)
     {
         this.txtDepartment.Text = "";
     }
     else if (this.m_Level == 1)
     {
         HRM_BRANCH hRMBRANCH = new HRM_BRANCH();
         hRMBRANCH.Get(this.m_Code);
         this.txtDepartment.Text = string.Concat("Đơn vị: ", hRMBRANCH.BranchName);
     }
     else if (this.m_Level == 2)
     {
         HRM_DEPARTMENT hRMDEPARTMENT = new HRM_DEPARTMENT();
         hRMDEPARTMENT.Get(this.m_Code);
         this.txtDepartment.Text = string.Concat("Đơn vị: ", hRMDEPARTMENT.DepartmentName);
     }
     else if (this.m_Level == 3)
     {
         HRM_GROUP hRMGROUP = new HRM_GROUP();
         hRMGROUP.Get(this.m_Code);
         this.txtDepartment.Text = string.Concat("Đơn vị: ", hRMGROUP.GroupName);
     }
 }
Пример #3
0
 public override void SetSearch(CHBK2014_N9.Common.Class.RowClickEventArgs e)
 {
     if (this._search)
     {
         HRM_GROUP hRMGROUP     = new HRM_GROUP();
         object    rowCellValue = this.gbList.GetRowCellValue(this.MRowClickEventArgs.RowIndex, "GroupCode");
         if (rowCellValue != null)
         {
             base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
             if (!(hRMGROUP.Get(rowCellValue.ToString()) != "OK"))
             {
                 this.DoHide();
                 this.RaiseItemSelectedEventHander(hRMGROUP);
             }
             else
             {
                 this.DoHide();
                 XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
Пример #4
0
        private void LoadTreeList(int Level, string Code)
        {
            object[] mCompanyName;
            //if (MyInfo.GetInfo() == "OK")
            //{
            //    this.m_CompanyName = MyInfo.Company;
            //}

            this.m_CompanyName = "Công ty ABC";
            this.dt            = new DataTable();
            this.dt.Columns.Add("ID");
            this.dt.Columns.Add("Name");
            this.dt.Columns.Add("ParentID");
            this.dt.Columns.Add("Type");
            this.dt.Columns.Add("FactQuantity");
            this.dt.Columns.Add("Quantity");
            this.dt.Columns.Add("ImageIndex");
            if (Level == 0)
            {
                DataRowCollection rows = this.dt.Rows;
                mCompanyName = new object[] { "All", this.m_CompanyName, "", "Company", 0, 0, 0 };
                rows.Add(mCompanyName);
                this.m_CompanyFactQuantity = 0;
                this.m_CompanyQuantity     = 0;
                this.AddSubsidiaryToDataTable(this.dt);
                this.AddBranchNullToDataTable(this.dt);
                this.AddDepartmentNullToDataTable(this.dt);
                this.dt.Rows[0]["Name"]         = string.Concat(this.dt.Rows[0]["Name"].ToString(), this.StringQuantity(this.m_CompanyFactQuantity, this.m_CompanyQuantity));
                this.dt.Rows[0]["FactQuantity"] = this.m_CompanyFactQuantity;
                this.dt.Rows[0]["Quantity"]     = this.m_CompanyQuantity;
            }
            else if (Level == 1)
            {
                HRM_SUBSIDIARY hRMSUBSIDIARY = new HRM_SUBSIDIARY();
                hRMSUBSIDIARY.Get(Code);
                DataRowCollection dataRowCollection = this.dt.Rows;
                mCompanyName = new object[] { hRMSUBSIDIARY.SubsidiaryCode, string.Concat(hRMSUBSIDIARY.SubsidiaryName, this.StringQuantity(hRMSUBSIDIARY.FactQuantity, hRMSUBSIDIARY.Quantity)), "", "Subsidiary", hRMSUBSIDIARY.FactQuantity, hRMSUBSIDIARY.Quantity, 1 };
                dataRowCollection.Add(mCompanyName);
                this.AddBranchToDataTable(hRMSUBSIDIARY.SubsidiaryCode, this.dt);
                this.AddDepartmentBySubsidiaryNotNullToDataTable(hRMSUBSIDIARY.SubsidiaryCode, this.dt);
            }
            else if (Level == 2)
            {
                HRM_BRANCH hRMBRANCH = new HRM_BRANCH();
                hRMBRANCH.Get(Code);
                DataRowCollection rows1 = this.dt.Rows;
                mCompanyName = new object[] { hRMBRANCH.BranchCode, string.Concat(hRMBRANCH.BranchName, this.StringQuantity(hRMBRANCH.FactQuantity, hRMBRANCH.Quantity)), "", "Branch", hRMBRANCH.FactQuantity, hRMBRANCH.Quantity, 2 };
                rows1.Add(mCompanyName);
                this.AddDepartmentByBranchToDataTable(hRMBRANCH.BranchCode, this.dt);
            }
            else if (Level == 3)
            {
                HRM_DEPARTMENT hRMDEPARTMENT = new HRM_DEPARTMENT();
                hRMDEPARTMENT.Get(Code);
                DataRowCollection dataRowCollection1 = this.dt.Rows;
                mCompanyName = new object[] { hRMDEPARTMENT.DepartmentCode, string.Concat(hRMDEPARTMENT.DepartmentName, this.StringQuantity(hRMDEPARTMENT.FactQuantity, hRMDEPARTMENT.Quantity)), "", "Department", hRMDEPARTMENT.FactQuantity, hRMDEPARTMENT.Quantity, 3 };
                dataRowCollection1.Add(mCompanyName);
                this.AddGroupToDataTable(hRMDEPARTMENT.DepartmentCode, this.dt);
            }
            else if (Level == 4)
            {
                HRM_GROUP hRMGROUP = new HRM_GROUP();
                hRMGROUP.Get(Code);
                DataRowCollection rows2 = this.dt.Rows;
                mCompanyName = new object[] { hRMGROUP.GroupCode, string.Concat(hRMGROUP.GroupName, this.StringQuantity(hRMGROUP.FactQuantity, hRMGROUP.Quantity)), "", "Group", hRMGROUP.FactQuantity, hRMGROUP.Quantity, 4 };
                rows2.Add(mCompanyName);
            }
            this.treeList1.DataSource = this.dt;
            this.treeList1.ExpandAll();
        }