예제 #1
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);
     }
 }
예제 #2
0
        private void glkEmployeeCode_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(this.glkEmployeeCode.EditValue.ToString());
            this.txtEmployeeName.Text  = string.Concat(hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName);
            this.xdeBirthday.Day       = hRMEMPLOYEE.BirthdayDay;
            this.xdeBirthday.Month     = hRMEMPLOYEE.BirthdayMonth;
            this.xdeBirthday.Year      = hRMEMPLOYEE.BirthdayYear;
            this.txtPosition.Text      = hRMEMPLOYEE.Position;
            this.txtNationality1.Text  = hRMEMPLOYEE.Nationality;
            this.txtIDCard.Text        = hRMEMPLOYEE.IDCard;
            this.dtIDCardDate.DateTime = hRMEMPLOYEE.IDCardDate;
            this.txtIDCardPlace.Text   = hRMEMPLOYEE.IDCardPlace;
            HRM_BRANCH hRMBRANCH = new HRM_BRANCH();

            hRMBRANCH.Get(hRMEMPLOYEE.BranchCode);
            HRM_DEPARTMENT hRMDEPARTMENT = new HRM_DEPARTMENT();

            hRMDEPARTMENT.Get(hRMEMPLOYEE.DepartmentCode);
            this.txtDepartment.Text       = string.Concat(hRMBRANCH.BranchName, " - ", hRMDEPARTMENT.DepartmentName);
            this.calBasicSalary.EditValue = hRMEMPLOYEE.BasicSalary;
            foreach (DataRow row in (new HRM_EMPLOYEE_ALLOWANCE()).GetList(hRMEMPLOYEE.EmployeeCode).Rows)
            {
                this.txtAllowance.Text = string.Concat(this.txtAllowance.Text, row["AllowanceName"].ToString(), "; ");
            }
            if (this.glkEmployeeCode.ErrorText != string.Empty)
            {
                this.Err.SetError(this.glkEmployeeCode, string.Empty);
            }
        }
예제 #3
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);
                    }
                }
            }
        }
예제 #4
0
 public override void SetSearch(CHBK2014_N9.Common.Class.RowClickEventArgs e)
 {
     if (this._search)
     {
         HRM_DEPARTMENT hRMDEPARTMENT = new HRM_DEPARTMENT();
         object         rowCellValue  = this.gbList.GetRowCellValue(this.MRowClickEventArgs.RowIndex, "DepartmentCode");
         if (rowCellValue != null)
         {
             base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
             if (!(hRMDEPARTMENT.Get(rowCellValue.ToString()) != "OK"))
             {
                 this.DoHide();
                 this.RaiseItemSelectedEventHander(hRMDEPARTMENT);
             }
             else
             {
                 this.DoHide();
                 XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
예제 #5
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();
        }