Example #1
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);
            }
        }
Example #2
0
        private void Init()
        {
            base.SetWaitDialogCaption("Đang khởi tạo dữ liệu...");
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            this.gridControl1.DataSource = hRMEMPLOYEE.GetListCurrentNow(0, "", -1);
        }
Example #3
0
        private void AddRow(HRM_PROCESS_ASSIGNMENT item)
        {
            GridView gridView         = this.gbList;
            int      focusedRowHandle = gridView.FocusedRowHandle;

            gridView.AddNewRow();
            focusedRowHandle = gridView.FocusedRowHandle;
            gridView.SetRowCellValue(focusedRowHandle, "AssignmentID", item.AssignmentID);
            gridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(item.EmployeeCode);
            gridView.SetRowCellValue(focusedRowHandle, "DepartmentName", hRMEMPLOYEE.DepartmentName);
            gridView.SetRowCellValue(focusedRowHandle, "GroupName", hRMEMPLOYEE.GroupName);
            gridView.SetRowCellValue(focusedRowHandle, "FirstName", hRMEMPLOYEE.FirstName);
            gridView.SetRowCellValue(focusedRowHandle, "LastName", hRMEMPLOYEE.LastName);
            gridView.SetRowCellValue(focusedRowHandle, "AssignmentName", item.AssignmentName);
            gridView.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gridView.SetRowCellValue(focusedRowHandle, "Where", item.Where);
            gridView.SetRowCellValue(focusedRowHandle, "FromDate", item.FromDate);
            gridView.SetRowCellValue(focusedRowHandle, "ToDate", item.ToDate);
            gridView.SetRowCellValue(focusedRowHandle, "Money", item.Money);
            gridView.SetRowCellValue(focusedRowHandle, "Date", item.Date);
            gridView.SetRowCellValue(focusedRowHandle, "Person", item.Person);
            gridView.UpdateCurrentRow();
        }
Example #4
0
 public void RaiseUpdatedEventHander(HRM_EMPLOYEE Item)
 {
     if (this.Updated != null)
     {
         this.Updated(this, Item);
     }
 }
Example #5
0
 private void Change()
 {
     if (MyRule.IsAccess("bbiEmployee"))
     {
         HRM_EMPLOYEE hRMEMPLOYEE         = new HRM_EMPLOYEE();
         object       focusedRowCellValue = this.gbList.GetFocusedRowCellValue("EmployeeCode");
         if (focusedRowCellValue != null)
         {
             base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
             if (!(hRMEMPLOYEE.Get(focusedRowCellValue.ToString()) != "OK"))
             {
                 this.DoHide();
                 xfmEmployeeAdd _xfmEmployeeAdd = new xfmEmployeeAdd(Actions.Update, hRMEMPLOYEE);
                 _xfmEmployeeAdd.Updated += new xfmEmployeeAdd.UpdatedEventHander(this.frm_Updated);
                 _xfmEmployeeAdd.Added   += new xfmEmployeeAdd.AddedEventHander(this.frm_Added);
                 _xfmEmployeeAdd.ShowDialog();
             }
             else
             {
                 this.DoHide();
                 XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
        public string Create(int Level, string Code, Guid TimeKeeperTableListID)
        {
            HRM_TIMEKEEPER_TABLELIST hRMTIMEKEEPERTABLELIST = new HRM_TIMEKEEPER_TABLELIST();

            hRMTIMEKEEPERTABLELIST.GetByID(TimeKeeperTableListID);
            int          year        = hRMTIMEKEEPERTABLELIST.Year;
            int          month       = hRMTIMEKEEPERTABLELIST.Month;
            DateTime     dateTime    = new DateTime(year, month, 1);
            DateTime     dateTime1   = new DateTime(year, month, DateTime.DaysInMonth(year, month));
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            foreach (DataRow row in hRMEMPLOYEE.GetCompactList(Level, Code, 1, dateTime, dateTime1).Rows)
            {
                if ((new HRM_TIMEKEEPER_SHIFT()).GetListByEmployee(TimeKeeperTableListID, row["EmployeeCode"].ToString()).Rows.Count <= 0)
                {
                    string[] str = new string[] { "Đang khởi tạo...", row["FirstName"].ToString(), " ", row["LastName"].ToString(), " (", row["EmployeeCode"].ToString(), ")" };
                    Options.SetWaitDialogCaption(string.Concat(str));
                    Thread thread = new Thread(() => this.Create(TimeKeeperTableListID, row["EmployeeCode"].ToString()));
                    thread.Start();
                    thread.Join();
                }
            }
            Options.HideDialog();
            return("OK");
        }
        public void LoadData(int Status, int Level, string Code)
        {
            this.m_Status = Status;
            this.m_Level  = Level;
            this.m_Code   = Code;
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            this.dt_Employee = hRMEMPLOYEE.GetListCurrentNow(this.m_Level, this.m_Code, this.m_Status);
            this.imgListEmployee.Items.Clear();
            if (this.dt_Employee.Rows.Count > 0)
            {
                foreach (DataRow row in this.dt_Employee.Rows)
                {
                    ImageListBoxItem imageListBoxItem = new ImageListBoxItem();
                    if (!bool.Parse(row["Sex"].ToString()))
                    {
                        imageListBoxItem.ImageIndex = 1;
                    }
                    else
                    {
                        imageListBoxItem.ImageIndex = 0;
                    }
                    string[] str = new string[] { "(", row["EmployeeCode"].ToString(), ") - ", row["FirstName"].ToString(), " ", row["LastName"].ToString() };
                    imageListBoxItem.Value = string.Concat(str);
                    this.imgListEmployee.Items.Add(imageListBoxItem);
                }
            }
        }
Example #8
0
        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            string str;
            object rowCellValue;

            if (MyRule.IsDelete("bbiEmployee"))
            {
                bool  flag         = false;
                int[] selectedRows = this.gbList.GetSelectedRows();
                if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
                {
                    base.CreateWaitDialog();
                    HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag         = true;
                        rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "EmployeeCode");
                        if (rowCellValue != null)
                        {
                            //  SYS_LOG.Insert("Danh Sách Nhân Viên", "Xoá", rowCellValue.ToString());
                            base.SetWaitDialogCaption(string.Concat("Đang xóa...", rowCellValue.ToString()));
                            str = hRMEMPLOYEE.Delete(rowCellValue.ToString());
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show(string.Concat("Thông tin không được xóa", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        if (hRMEMPLOYEE.GetListCurrentNow(this.m_Level, this.m_Code, -1).Rows.Count != 0)
                        {
                            rowCellValue = this.gbList.GetFocusedRowCellValue("EmployeeCode");
                            if (rowCellValue != null)
                            {
                                // SYS_LOG.Insert("Danh Sách Nhân Viên", "Xoá", rowCellValue.ToString());
                                base.SetWaitDialogCaption("Đang xóa...");
                                str = hRMEMPLOYEE.Delete(rowCellValue.ToString());
                                if (str == "OK")
                                {
                                    this.gbList.DeleteRow(this.gbList.FocusedRowHandle);
                                }
                                else if (str != "OK")
                                {
                                    MessageBox.Show(string.Concat("Thông tin không được xóa", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                }
                                this.DoHide();
                            }
                        }
                    }
                }
            }
        }
Example #9
0
        private void UpdateRow(HRM_EMPLOYEE item)
        {
            BandedGridView bandedGridView   = this.gbList;
            int            focusedRowHandle = this.gbList.FocusedRowHandle;

            bandedGridView.SetRowCellValue(focusedRowHandle, "SubsidiaryCode", item.SubsidiaryCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BranchCode", item.BranchCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "DepartmentCode", item.DepartmentCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "GroupCode", item.GroupCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "FirstName", item.FirstName);
            bandedGridView.SetRowCellValue(focusedRowHandle, "LastName", item.LastName);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BirthdayDay", item.BirthdayDay);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BirthdayMonth", item.BirthdayMonth);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BirthdayYear", item.BirthdayYear);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BirthPlace", item.BirthPlace);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Sex", item.Sex);
            bandedGridView.SetRowCellValue(focusedRowHandle, "CellPhone", item.CellPhone);
            bandedGridView.SetRowCellValue(focusedRowHandle, "HomePhone", item.HomePhone);
            bandedGridView.SetRowCellValue(focusedRowHandle, "MainAddress", item.MainAddress);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContactAddress", item.ContactAddress);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Position", item.Position);
            bandedGridView.SetRowCellValue(focusedRowHandle, "IDCard", item.IDCard);
            bandedGridView.SetRowCellValue(focusedRowHandle, "IDCardPlace", item.IDCardPlace);
            bandedGridView.SetRowCellValue(focusedRowHandle, "IDCardDate", item.IDCardDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Status", item.Status);
            bandedGridView.SetRowCellValue(focusedRowHandle, "TestFromDate", item.TestFromDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "TestToDate", item.TestToDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BeginDate", item.BeginDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "EndDate", item.EndDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Photo", item.Photo);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Email", item.Email);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Nationality", item.Nationality);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Ethnic", item.Ethnic);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Religion", item.Religion);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Education", item.Education);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Language", item.Language);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Informatic", item.Informatic);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Professional", item.Professional);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Marriage", item.Marriage);
            bandedGridView.SetRowCellValue(focusedRowHandle, "InsuranceCode", item.InsuranceCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "InsuranceDate", item.InsuranceDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "BasicSalary", item.BasicSalary);
            bandedGridView.SetRowCellValue(focusedRowHandle, "InsuranceSalary", item.InsuranceSalary);
            bandedGridView.SetRowCellValue(focusedRowHandle, "DateSalary", item.DateSalary);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Health", item.Health);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Weight", item.Weight);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Height", item.Height);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContractCode", item.ContractCode);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContractType", item.ContractType);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContractSignDate", item.ContractSignDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContractFromDate", item.ContractFromDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "ContractToDate", item.ContractToDate);
            bandedGridView.SetRowCellValue(focusedRowHandle, "EnrollNumber", item.EnrollNumber);
            bandedGridView.SetRowCellValue(focusedRowHandle, "Description", item.Description);
            bandedGridView.UpdateCurrentRow();
        }
Example #10
0
        private void glkSignerCode_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(this.glkSignerCode.EditValue.ToString());
            this.txtSigner.Text            = string.Concat(hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName);
            this.txtSignerPosition.Text    = hRMEMPLOYEE.Position;
            this.txtSignerNationality.Text = hRMEMPLOYEE.Nationality;
        }
Example #11
0
        public static string EmployeeUpdate(string TimekeeperTableListID, string SalaryTableListID, int Month, int Year, string EmployeeCode)
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(EmployeeCode);
            string[] strArrays             = new string[] { "@TimekeeperTableListID", "@SalaryTableListID", "@Month", "@Year", "@EmployeeCode", "@MinimumSalary", "@CoefficientSalary", "@BasicSalary" };
            string[] strArrays1            = strArrays;
            object[] timekeeperTableListID = new object[] { TimekeeperTableListID, SalaryTableListID, Month, Year, EmployeeCode, hRMEMPLOYEE.MinimumSalary, hRMEMPLOYEE.CoefficientSalary, hRMEMPLOYEE.BasicSalary };
            return((new SqlHelper()).ExecuteNonQuery("HRM_SALARY_EmployeeUpdate", strArrays1, timekeeperTableListID));
        }
Example #12
0
        private void RaiseOnTransactionEventHandler(string EnrollNumber, DateTime Date, DateTime Hour, int StateInOut, int MachineID)
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.GetByEnroll(EnrollNumber.ToString());
            if (this.OnTransactionEvent != null)
            {
                this.OnTransactionEvent(this, EnrollNumber, hRMEMPLOYEE.EmployeeCode, string.Concat(hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName), Date, Hour, StateInOut, MachineID);
            }
        }
Example #13
0
        private void LoadEmployeeInformation()
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(this.m_EmployeeCode);
            GroupControl groupControl = this.grInformation;

            string[] employeeCode = new string[] { "Thông Tin Tạm Ứng - ", hRMEMPLOYEE.EmployeeCode, " (", hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName, ")" };
            groupControl.Text         = string.Concat(employeeCode);
            this.txtEmployeeName.Text = string.Concat(hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName);
        }
Example #14
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity = new HRM_EMPLOYEE();
            new_entity.EmployeeCode   = txt_EMPLOYEE_CODE.Text;
            new_entity.FirstName      = txt_FIRST_NAME.Text;
            new_entity.LastName       = txt_LAST_NAME.Text;
            new_entity.Sex            = chk_SEX.Checked;
            new_entity.Birthday       = date_BIRTHDAY.DateTime;
            new_entity.BirthPlace     = txt_BIRTH_PLACE.Text;
            new_entity.Alias          = txt_ALIAS.Text;
            new_entity.Marriage       = (cbo_MARRIAGE.EditValue == null ? "" : cbo_MARRIAGE.EditValue.ToString());
            new_entity.IDCard         = txt_IDCARD.Text;
            new_entity.DepartmentCode = cbo_DEPARTMENT.EditValue.ToString();
            new_entity.WorkStateCode  = (cbo_WORK_STATE.EditValue == null ? null : cbo_WORK_STATE.EditValue.ToString());
            new_entity.IDCardDate     = date_IDCARD.DateTime;
            new_entity.IDCardPlace    = txt_IDCARD_PLACE.Text;
            new_entity.MainAddress    = txt_MAIN_ADDRESS.Text;
            new_entity.ContactAddress = txt_CONTACT_ADDRESS.Text;
            new_entity.CellPhone      = txt_CELL_PHONE.Text;
            new_entity.Email          = txt_EMAIL.Text;
            new_entity.Nationality    = cbo_NATIONALITY.EditValue.ToString();
            new_entity.Religion       = (cbo_RELIGION.EditValue == null ?  null : cbo_RELIGION.EditValue.ToString());
            new_entity.Ethnic         = (cbo_ETHNIC.EditValue == null ? null : cbo_ETHNIC.EditValue.ToString());
            new_entity.Education      = (cbo_EDUCATION.EditValue == null ? null : cbo_EDUCATION.EditValue.ToString());
            new_entity.Language       = (cbo_LANGUAGE.EditValue == null ? null : cbo_LANGUAGE.EditValue.ToString());
            new_entity.Informatic     = (cbo_INFORMATIC.EditValue == null ? null : cbo_INFORMATIC.EditValue.ToString());
            new_entity.Professional   = (cbo_PROFESSIONAL.EditValue == null ? null : cbo_PROFESSIONAL.EditValue.ToString());
            new_entity.School         = (cbo_SCHOOL.EditValue == null ? null : cbo_SCHOOL.EditValue.ToString());

            // HOP DONG LAO DONG
            new_entity.ContractFromDate = old_entity.ContractFromDate;
            new_entity.ContractSignDate = old_entity.ContractSignDate;
            new_entity.ContractToDate   = old_entity.ContractToDate;


            if (pic_PHOTO.Image != null)
            {
                new_entity.Photo = LOGIC_COMMON.Bitmap_To_Byte(pic_PHOTO.Image);
            }

            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_HRM_EMPLOYEE.Update(old_entity, new_entity);
                DAO_DIC_DEPARTMENT.Update_Quanlity(old_entity.DepartmentCode);
                DAO_DIC_DEPARTMENT.Update_Quanlity(new_entity.DepartmentCode);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
            }
        }
Example #15
0
        private void InitData()
        {
            string[] text;
            this.dtSignDate.DateTime = DateTime.Now;
            this.dtFromDate.DateTime = DateTime.Now;
            this.dtToDate.DateTime   = DateTime.Now;
            this.dtSignDate.DateTime = DateTime.Now;
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.AddGridLookupEdit(this.glkEmployeeCode);
            hRMEMPLOYEE.AddGridLookupEdit(this.glkSignerCode);
            clsContractOption _clsContractOption = new clsContractOption();

            this.txtSigner.Text            = _clsContractOption.Signer;
            this.txtSignerNationality.Text = _clsContractOption.SignerNationality;
            this.txtSignerPosition.Text    = _clsContractOption.SignerPosition;


            this.txtCompany.Text      = "SAIGONACT";
            this.txtAddress.Text      = "Phan Văn Hớn";
            this.txtTel.Text          = "09099999999";
            this.txtContractName.Text = "Hợp đồng lao động";
            this.txtCreatePlace.Text  = "";

            foreach (DataRow row in (new DIC_SHIFT()).GetList().Rows)
            {
                TextEdit textEdit = this.txtWorkTime;
                text = new string[] { this.txtWorkTime.Text, row["ShiftName"].ToString(), " - ", row["ShiftCode"].ToString(), " (", null, null, null, null };
                DateTime dateTime = DateTime.Parse(row["BeginTime"].ToString());
                text[5]       = dateTime.ToShortTimeString();
                text[6]       = "->";
                dateTime      = DateTime.Parse(row["EndTime"].ToString());
                text[7]       = dateTime.ToShortTimeString();
                text[8]       = "); ";
                textEdit.Text = string.Concat(text);
            }
            DIC_SALARY_FORMULA dICSALARYFORMULA = new DIC_SALARY_FORMULA();

            dICSALARYFORMULA.Get();
            TextEdit textEdit1 = this.txtInsurance;

            text = new string[6];
            double socialInsurance1 = dICSALARYFORMULA.SocialInsurance1;

            text[0]          = socialInsurance1.ToString();
            text[1]          = " % BHXH, ";
            socialInsurance1 = dICSALARYFORMULA.HealthInsurance1;
            text[2]          = socialInsurance1.ToString();
            text[3]          = " % BHYT, ";
            socialInsurance1 = dICSALARYFORMULA.UnemploymentInsurance1;
            text[4]          = socialInsurance1.ToString();
            text[5]          = " % BHTN";
            textEdit1.Text   = string.Concat(text);
        }
Example #16
0
        private bool Insert()
        {
            new_entity = new HRM_EMPLOYEE();
            new_entity.EmployeeCode   = txt_EMPLOYEE_CODE.Text;
            new_entity.FirstName      = txt_FIRST_NAME.Text;
            new_entity.LastName       = txt_LAST_NAME.Text;
            new_entity.Sex            = chk_SEX.Checked;
            new_entity.IDCard         = txt_IDCARD.Text;
            new_entity.Birthday       = date_BIRTHDAY.DateTime;
            new_entity.BirthPlace     = txt_BIRTH_PLACE.Text;
            new_entity.Marriage       = (cbo_MARRIAGE.EditValue == null ? "" : cbo_MARRIAGE.EditValue.ToString());
            new_entity.IDCardDate     = date_IDCARD.DateTime;
            new_entity.IDCardPlace    = txt_IDCARD_PLACE.Text;
            new_entity.MainAddress    = txt_MAIN_ADDRESS.Text;
            new_entity.ContactAddress = txt_CONTACT_ADDRESS.Text;
            new_entity.CellPhone      = txt_CELL_PHONE.Text;
            new_entity.Email          = txt_EMAIL.Text;
            new_entity.Photo          = LOGIC_COMMON.Bitmap_To_Byte(pic_PHOTO.Image);
            new_entity.Language       = (cbo_LANGUAGE.EditValue == null ? "" : cbo_LANGUAGE.EditValue.ToString());
            new_entity.Education      = (cbo_EDUCATION.EditValue == null ? "" : cbo_EDUCATION.EditValue.ToString());
            new_entity.Professional   = (cbo_PROFESSIONAL.EditValue == null ? "" : cbo_PROFESSIONAL.EditValue.ToString());
            new_entity.Nationality    = (cbo_NATIONALITY.EditValue == null ? "":cbo_NATIONALITY.EditValue.ToString());
            new_entity.Ethnic         = (cbo_ETHNIC.EditValue == null ? "" : cbo_ETHNIC.EditValue.ToString());
            new_entity.Religion       = (cbo_RELIGION.EditValue == null ? "" : cbo_RELIGION.EditValue.ToString());
            new_entity.School         = (cbo_SCHOOL.EditValue == null ? "" : cbo_SCHOOL.EditValue.ToString());
            new_entity.WorkStateCode  = (cbo_WORK_STATE.EditValue == null ? null : cbo_WORK_STATE.EditValue.ToString());
            new_entity.DepartmentCode = (cbo_DEPARTMENT.EditValue == null ? null : cbo_DEPARTMENT.EditValue.ToString());

            // HOP DONG LAO DONG
            DateTime frmDate = DateTime.Now;
            DateTime endDate = frmDate.AddYears(2);

            new_entity.ContractFromDate = (DateTime?)frmDate;
            new_entity.ContractSignDate = (DateTime?)frmDate;
            new_entity.ContractToDate   = (DateTime?)endDate;



            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_HRM_EMPLOYEE.Add(new_entity);
                DAO_DIC_DEPARTMENT.Update_Quanlity(new_entity.DepartmentCode);
                parent.dg_DATA.DataSource = DAO_HRM_EMPLOYEE.Get_Data();
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
                return(false);
            }
            return(true);
        }
Example #17
0
        private void frmTest_Load(object sender, EventArgs e)
        {
            Image img = (Image)QuanLyNhanSu.Properties.Resources.NO_PHOTO;

            byte[]       imgbyte = LOGIC_COMMON.Bitmap_To_Byte(img);
            HRM_EMPLOYEE entity  = new HRM_EMPLOYEE();

            entity.EmployeeCode = "NV000003";
            entity = DAO_HRM_EMPLOYEE.Select_Record(entity);
            byte[] photo = entity.Photo;
            textEdit1.Text = Get_Day() + "/" + Get_Month() + "/" + Get_Year();
            //    MessageBox.Show("Test");
        }
Example #18
0
        private void AddEmployeeToDataTable(DataTable dt, string Place, string Code)
        {
            DataTable listCurrentNow;

            object[]     str;
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            if (Place == "Subsidiary")
            {
                listCurrentNow = hRMEMPLOYEE.GetListCurrentNow(1, Code, -1);
            }
            else if (!(Place == "Branch"))
            {
                listCurrentNow = (!(Place == "Department") ? hRMEMPLOYEE.GetListCurrentNow(4, Code, -1) : hRMEMPLOYEE.GetListCurrentNow(3, Code, -1));
            }
            else
            {
                listCurrentNow = hRMEMPLOYEE.GetListCurrentNow(2, Code, -1);
            }
            foreach (DataRow row in listCurrentNow.Rows)
            {
                if ((bool)row["Sex"])
                {
                    if ((int)row["Status"] == 3)
                    {
                        DataRowCollection rows = dt.Rows;
                        str = new object[] { row["EmployeeCode"].ToString(), string.Concat(row["FirstName"].ToString(), " ", row["LastName"].ToString()), row["GroupCode"].ToString(), "Employee", 7 };
                        rows.Add(str);
                    }
                    else
                    {
                        DataRowCollection dataRowCollection = dt.Rows;
                        str = new object[] { row["EmployeeCode"].ToString(), string.Concat(row["FirstName"].ToString(), " ", row["LastName"].ToString()), row["GroupCode"].ToString(), "Employee", 5 };
                        dataRowCollection.Add(str);
                    }
                }
                else if ((int)row["Status"] == 3)
                {
                    DataRowCollection rows1 = dt.Rows;
                    str = new object[] { row["EmployeeCode"].ToString(), string.Concat(row["FirstName"].ToString(), " ", row["LastName"].ToString()), row["GroupCode"].ToString(), "Employee", 8 };
                    rows1.Add(str);
                }
                else
                {
                    DataRowCollection dataRowCollection1 = dt.Rows;
                    str = new object[] { row["EmployeeCode"].ToString(), string.Concat(row["FirstName"].ToString(), " ", row["LastName"].ToString()), row["GroupCode"].ToString(), "Employee", 6 };
                    dataRowCollection1.Add(str);
                }
            }
        }
Example #19
0
        public xfmEmployeeAdd(Actions Action)
        {
            this.InitializeComponent();
            this.Init();
            this.ucAdd.Status = Action;
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            this.ucAdd.SetData(hRMEMPLOYEE.NewID());
            if (Action == Actions.Add)
            {
                this.ucAdd.Clear();
                this.ucAdd.InputEmployeeName += new xucEmployeeAdd.InputEmployeeNameHandler((object s, string str) => this.Text = string.Concat(("Thêm Nhân Viên"), " - ", str));
            }
            this.Text = "Thêm Nhân Viên";
        }
Example #20
0
 private void ucAdd_Success(object sender, HRM_EMPLOYEE Item)
 {
     if (this.ucAdd.Status == Actions.Add)
     {
         this.RaiseAddedEventHander(Item);
     }
     else if (this.ucAdd.Status == Actions.Update)
     {
         this.RaiseUpdatedEventHander(Item);
     }
     if (this.ucAdd.IsClose == CloseOrNew.Close)
     {
         base.Close();
     }
     this.ucAdd.Clear();
 }
Example #21
0
        public static string Create(int Level, string Code, string SalaryTableListID, string SalaryTableListName, int Month, int Year)
        {
            DateTime     dateTime    = new DateTime(Year, Month, 1);
            DateTime     dateTime1   = new DateTime(Year, Month, DateTime.DaysInMonth(Year, Month));
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            foreach (DataRow row in hRMEMPLOYEE.GetCompactList(Level, Code, 1, dateTime, dateTime1).Rows)
            {
                string[] str = new string[] { "Đang cập nhật...", row["FirstName"].ToString(), " ", row["LastName"].ToString(), " (", row["EmployeeCode"].ToString(), ")" };
                Options.SetWaitDialogCaption(string.Concat(str));
                Thread thread = new Thread(() => HRM_SALARY.Create(SalaryTableListID, SalaryTableListName, row["EmployeeCode"].ToString(), Month, Year));
                thread.Start();
                thread.Join();
            }
            Options.HideDialog();
            return("OK");
        }
Example #22
0
        public void SetData(DataRow dr)
        {
            this.m_TimeKeeperTableListID = new Guid(dr["TimeKeeperTableListID"].ToString());
            this.m_EmployeeCode          = dr["EmployeeCode"].ToString();
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(this.m_EmployeeCode);
            GroupControl groupControl = this.groupControl1;

            string[] firstName = new string[] { "Thông Tin Ra/Vào - ", hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName, " (", hRMEMPLOYEE.EmployeeCode, ") - ", dr["Symbol"].ToString() };
            groupControl.Text = string.Concat(firstName);
            this.m_ShiftCode  = dr["ShiftCode"].ToString();
            this.m_Date       = Convert.ToDateTime(dr["Date"].ToString());
            this.m_Symbol     = dr["Symbol"].ToString();
            HRM_TIMEKEEPER hRMTIMEKEEPER = new HRM_TIMEKEEPER();

            hRMTIMEKEEPER.Get(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date, this.m_Symbol);
            this.SetData(hRMTIMEKEEPER);
        }
Example #23
0
 public xfmEmployeeAdd(Actions Action, HRM_EMPLOYEE Item)
 {
     this.InitializeComponent();
     this.Init();
     this.ucAdd.Status = Action;
     if (Action == Actions.Update)
     {
         this.ucAdd.SetData(Item);
         string[] text = new string[] { ("Cập Nhật "), this.Text, " - ", Item.FirstName, " ", Item.LastName, " (", Item.EmployeeCode, ")" };
         this.Text = string.Concat(text);
         this.ucAdd.InputEmployeeName += new xucEmployeeAdd.InputEmployeeNameHandler((object s, string str) =>
         {
         });
     }
     else if (Action == Actions.Delete)
     {
         this.ucAdd.SetData(Item.GroupCode);
     }
 }
Example #24
0
        private void UpdateRow(HRM_PROCESS_ADVANCE item)
        {
            GridView gridView         = this.gbList;
            int      focusedRowHandle = this.gbList.FocusedRowHandle;

            gridView.SetRowCellValue(focusedRowHandle, "AdvanceID", item.AdvanceID);
            gridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(item.EmployeeCode);
            gridView.SetRowCellValue(focusedRowHandle, "DepartmentName", hRMEMPLOYEE.DepartmentName);
            gridView.SetRowCellValue(focusedRowHandle, "GroupName", hRMEMPLOYEE.GroupName);
            gridView.SetRowCellValue(focusedRowHandle, "FirstName", hRMEMPLOYEE.FirstName);
            gridView.SetRowCellValue(focusedRowHandle, "LastName", hRMEMPLOYEE.LastName);
            gridView.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gridView.SetRowCellValue(focusedRowHandle, "Date", item.Date);
            gridView.SetRowCellValue(focusedRowHandle, "Money", item.Money);
            gridView.SetRowCellValue(focusedRowHandle, "Person", item.Person);
            gridView.UpdateCurrentRow();
        }
Example #25
0
        private void UpdateRow(HRM_SALARY_ALLOWANCE item)
        {
            GridView gridView         = this.gbList;
            int      focusedRowHandle = this.gbList.FocusedRowHandle;

            gridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(item.EmployeeCode);
            DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE();

            dICALLOWANCE.Get(item.AllowanceCode);
            gridView.SetRowCellValue(focusedRowHandle, "FirstName", hRMEMPLOYEE.FirstName);
            gridView.SetRowCellValue(focusedRowHandle, "LastName", hRMEMPLOYEE.LastName);
            gridView.SetRowCellValue(focusedRowHandle, "AllowanceCode", item.AllowanceCode);
            gridView.SetRowCellValue(focusedRowHandle, "AllowanceName", dICALLOWANCE.AllowanceName);
            gridView.SetRowCellValue(focusedRowHandle, "Money", item.Money);
            gridView.SetRowCellValue(focusedRowHandle, "IncomeTaxValue", item.IncomeTaxValue);
            gridView.UpdateCurrentRow();
        }
Example #26
0
        public static string Create(int Level, string Code, string SalaryTableListID, int Order, DateTime Date, int PayType, double Value, string Person, string Description, bool IsSkip)
        {
            HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST();

            hRMSALARYTABLELIST.GetByID(new Guid(SalaryTableListID));
            int          year        = hRMSALARYTABLELIST.Year;
            int          month       = hRMSALARYTABLELIST.Month;
            DateTime     dateTime    = new DateTime(year, month, 1);
            DateTime     dateTime1   = new DateTime(year, month, DateTime.DaysInMonth(year, month));
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            foreach (DataRow row in hRMEMPLOYEE.GetCompactList(Level, Code, 1, dateTime, dateTime1).Rows)
            {
                string[] str = new string[] { "Đang cập nhật...", row["FirstName"].ToString(), " ", row["LastName"].ToString(), " (", row["EmployeeCode"].ToString(), ")" };
                Options.SetWaitDialogCaption(string.Concat(str));
                Thread thread = new Thread(() => HRM_SALARY_PAY.Create(SalaryTableListID, row["EmployeeCode"].ToString(), Order, Date, PayType, Value, Person, Description, IsSkip));
                thread.Start();
                thread.Join();
            }
            Options.HideDialog();
            return("OK");
        }
Example #27
0
        private void frm_EDIT_Load(object sender, EventArgs e)
        {
            old_entity = new HRM_EMPLOYEE();

            old_entity.EmployeeCode = CODE;
            old_entity             = DAO_HRM_EMPLOYEE.Select_Record(old_entity);
            txt_EMPLOYEE_CODE.Text = old_entity.EmployeeCode;
            txt_FIRST_NAME.Text    = old_entity.FirstName;
            txt_LAST_NAME.Text     = old_entity.LastName;
            txt_ALIAS.Text         = old_entity.Alias;
            bool sex = (bool)old_entity.Sex;

            cbo_WORK_STATE.EditValue   = old_entity.WorkStateCode;
            chk_SEX.Checked            = sex;
            date_BIRTHDAY.DateTime     = (DateTime)old_entity.Birthday;
            txt_BIRTH_PLACE.Text       = old_entity.BirthPlace;
            txt_ALIAS.Text             = old_entity.Alias;
            cbo_MARRIAGE.Text          = old_entity.Marriage;
            txt_IDCARD.Text            = old_entity.IDCard;
            date_IDCARD.DateTime       = (DateTime)old_entity.IDCardDate;
            txt_IDCARD_PLACE.Text      = old_entity.IDCardPlace;
            txt_MAIN_ADDRESS.Text      = old_entity.MainAddress;
            txt_CONTACT_ADDRESS.Text   = old_entity.ContactAddress;
            txt_CELL_PHONE.Text        = old_entity.CellPhone;
            txt_EMAIL.Text             = old_entity.Email;
            cbo_NATIONALITY.EditValue  = old_entity.Nationality;
            cbo_ETHNIC.EditValue       = old_entity.Ethnic;
            cbo_RELIGION.EditValue     = old_entity.Religion;
            cbo_EDUCATION.EditValue    = old_entity.Education;
            cbo_LANGUAGE.EditValue     = old_entity.Language;
            cbo_INFORMATIC.EditValue   = old_entity.Informatic;
            cbo_PROFESSIONAL.EditValue = old_entity.Professional;
            cbo_DEPARTMENT.EditValue   = old_entity.DepartmentCode;
            cbo_SCHOOL.EditValue       = old_entity.School;
            if (old_entity.Photo != null)
            {
                pic_PHOTO.Image = LOGIC_COMMON.Byte_To_Bitmap(old_entity.Photo);
            }
        }
Example #28
0
        private void LoadGrid(int Level, string Code, int Status)
        {
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            this.gcList.DataSource = hRMEMPLOYEE.GetListCurrentNow(Level, Code, Status); // 3 da nghi viec
        }
Example #29
0
 private void frm_Updated(object sender, HRM_EMPLOYEE Item)
 {
     this.UpdateRow(Item);
 }
Example #30
0
 private void frm_Added(object sender, HRM_EMPLOYEE Item)
 {
     this.ReLoad();
 }