Пример #1
0
        /// <summary>
        /// Insert or Update decision one employee
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void InsertOrUpdate(object sender, DirectEventArgs e)
        {
            try
            {
                // init model
                var model = new SalaryDecisionModel()
                {
                    EditedBy = CurrentUser.User.UserName
                };
                // check id
                if (!string.IsNullOrEmpty(hdfId.Text) && Convert.ToInt32(hdfId.Text) > 0)
                {
                    var result = SalaryDecisionController.GetById(Convert.ToInt32(hdfId.Text));;
                    if (result != null)
                    {
                        model = result;
                    }
                }
                // set new props for model
                model.Status = !string.IsNullOrEmpty(hdfStatus.Text) ? (SalaryDecisionStatus)Convert.ToInt32(hdfStatus.Text) : SalaryDecisionStatus.Approved;

                //edit data
                EditData(model);

                // check model id
                if (model.Id > 0)
                {
                    // update
                    SalaryDecisionController.Update(model);
                }
                else
                {
                    // set created user
                    model.CreatedBy = CurrentUser.User.UserName;
                    // insert
                    SalaryDecisionController.Create(model);
                }
                // hide window
                wdSetting.Hide();
                //reset form
                ResetForm();
                // reload data
                gpSalaryDecision.Reload();
            }
            catch (Exception exception)
            {
                Dialog.ShowError(exception);
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDownloadAttachFile_Click(object sender, DirectEventArgs e)
        {
            try
            {
                if (hdfRecordId.Text == "")
                {
                    X.Msg.Alert("Thông báo từ hệ thống", "Không tìm thấy quyết định lương").Show();
                }

                var hsl = SalaryDecisionController.GetById(Convert.ToInt32(hdfRecordId.Text));
                DownloadAttachFile("sal_SalaryDecision", hsl.AttachFileName);
            }
            catch (Exception ex)
            {
                X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show();
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        private void InitFormUpdate(int id)
        {
            // get current decision
            var model = SalaryDecisionController.GetById(id);

            if (model != null)
            {
                // get previous decision
                var previousDecision = SalaryDecisionController.GetPrevious(model.RecordId);

                // bind previous data
                if (previousDecision != null)
                {
                    txtCurrName.Text             = previousDecision.Name;
                    txtCurrDecisionNumber.Text   = previousDecision.DecisionNumber;
                    txtCurrDecisionDate.Text     = previousDecision.DecisionDate.ToString("dd/MM/yyyy");
                    txtCurrSignerName.Text       = previousDecision.SignerName;
                    txtCurrSignerPosition.Text   = previousDecision.SignerPosition;
                    txtCurrContractTypeName.Text = previousDecision.ContractTypeName;
                    txtCurrQuantumCode.Text      = previousDecision.QuantumCode;
                    txtCurrGrade.Text            = previousDecision.Grade.ToString();
                    txtCurrQuantumCode.Text      = previousDecision.QuantumCode;
                    txtCurrFactor.Text           = previousDecision.Factor.ToString("#,##0.00");
                    txtCurrSalaryLevel.Text      = previousDecision.Salary.ToString("#,###");
                    txtCurrContractSalary.Text   = previousDecision.ContractSalary.ToString("#,###");
                    txtCurrInsuranceSalary.Text  = previousDecision.InsuranceSalary.ToString("#,###");
                    txtCurrPercentageLeader.Text = previousDecision.PercentageLeader.ToString("0.00 %");
                }

                // bind current salary decision
                cboEmployee.Text             = model.EmployeeName;
                hdfEmployee.Text             = model.RecordId.ToString();
                txtName.Text                 = model.Name;
                txtDepartmentName.Text       = model.DepartmentName;
                txtPositionName.Text         = model.PositionName;
                txtJobTitleName.Text         = model.JobTitleName;
                cboContractType.Text         = model.ContractTypeName;
                txtDecisionNumber.Text       = model.DecisionNumber;
                dfDecisionDate.SelectedDate  = model.DecisionDate;
                dfEffectiveDate.SelectedDate = model.EditedDate;
                txtSignerName.Text           = model.SignerName;
                hdfPosition.Text             = model.SignerPositionId.ToString();
                cboPosition.Text             = model.SignerPosition;
                txtNote.Text                 = model.Note;
                hdfQuantumId.Text            = model.QuantumId.ToString();
                cboQuantum.Text              = model.QuantumName;
                hdfSalaryGrade.Text          = model.Grade.ToString();
                cboSalaryGrade.Text          = @"Bậc " + model.Grade;
                txtFactor.Text               = model.Factor.ToString("#,##0.00");
                txtSalaryLevel.Text          = model.Salary.ToString("##,###");
                txtPercentageSalary.Text     = model.PercentageSalary.ToString("0.00");
                txtPercentageLeader.Text     = model.PercentageLeader.ToString("0.00");
                // get file upload
                if (cfAttachFile.Visible)
                {
                    hdfAttachFile.Text = model.AttachFileName;
                    if (!string.IsNullOrEmpty(model.AttachFileName))
                    {
                        hdfAttachFile.Text = model.AttachFileName;
                        fufAttachFile.Text = GetFileName(model.AttachFileName);
                    }
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Sửa thông tin quyết định lương
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, DirectEventArgs e)
        {
            try
            {
                var hsLuong = SalaryDecisionController.GetById(Convert.ToInt32(hdfRecordId.Text));
                if (hsLuong == null)
                {
                    X.Msg.Alert("Thông báo từ hệ thống", "Không tìm thấy quyết định lương").Show();
                    return;
                }

                // load general information for employee
                var hs = RecordController.GetById(hsLuong.RecordId);
                if (hs != null)
                {
                    hdfChooseEmployee.Text = hs.Id.ToString();
                    cbxChooseEmployee.Text = hs.FullName;
                    txtDepartment.Text     = hs.DepartmentName;
                    txtPosition.Text       = hs.PositionName;
                    txtJob.Text            = hs.JobTitleName;
                }

                // load newest salary decision information
                var hsl = SalaryDecisionController.GetCurrent(hsLuong.RecordId);
                if (hsl != null)
                {
                    //if (txtDecisionNumberOld.Visible == true && !string.IsNullOrEmpty(hsl.DecisionNumber))
                    //    txtDecisionNumberOld.Text = hsl.DecisionNumber;
                    //if (txtDecisionNameOld.Visible == true && !string.IsNullOrEmpty(hsl.DecisionName))
                    //    txtDecisionNameOld.Text = hsl.DecisionName;
                    //if (DecisionDateOld.Visible == true)
                    //    DecisionDateOld.SetValue(hsl.DecisionDate);
                    //if (txtDecisionMakerOld.Visible == true && hsl.DecisionMaker != null)
                    //    txtDecisionMakerOld.Text = hsl.DecisionMaker;
                    //if (EffectiveDateOld.Visible == true)
                    //    EffectiveDateOld.SetValue(hsl.EffectiveDate);
                    //if (txtSalaryBasicOld.Visible == true && hsl.SalaryBasic != null)
                    //    txtSalaryBasicOld.SetValue(hsl.SalaryBasic);
                    //txtSalaryGrossOld.SetValue(hsl.SalaryGross);
                    //txtSalaryNetOld.SetValue(hsl.SalaryNet);
                    //if (txtSalaryInsuranceOld.Visible == true && hsl.SalaryInsurance != null)
                    //    txtSalaryInsuranceOld.SetValue(hsl.SalaryInsurance);
                    //if (txtOtherAllowanceOld.Visible == true && hsl.OtherAllowance != null)
                    //    txtOtherAllowanceOld.SetValue(hsl.OtherAllowance);
                    //if (txtResponsibilityAllowanceOld.Visible == true && hsl.ResponsibilityAllowance != null)
                    //    txtResponsibilityAllowanceOld.SetValue(hsl.ResponsibilityAllowance);
                    //if (txtAreaAllowanceOld.Visible == true && hsl.AreaAllowance != null)
                    //    txtAreaAllowanceOld.SetValue(hsl.AreaAllowance);

                    var strContractTypeOldId =
                        hr_ContractServices.GetFieldValueById(hsLuong.ContractId, "ContractTypeId");
                    if (!string.IsNullOrEmpty(strContractTypeOldId))
                    {
                        var contractTypeOldName =
                            cat_ContractTypeServices.GetFieldValueById(Convert.ToInt32(strContractTypeOldId), "Name");
                        txtContractTypeOld.Text = "" + contractTypeOldName;
                    }
                }

                // load current decision information
                //if (txtDecisionNumberNew.Visible)
                //    txtDecisionNumberNew.Text = hsLuong.DecisionNumber;
                //if (DecisionDateNew.Visible)
                //    DecisionDateNew.SetValue(hsLuong.DecisionDate);
                //if (txtDecisionNameNew.Visible)
                //    txtDecisionNameNew.Text = hsLuong.DecisionName;
                //if (EffectiveDateNew.Visible)
                //    EffectiveDateNew.SetValue(hsLuong.EffectiveDate);
                //if (txtDecisionMakerNew.Visible)
                //    txtDecisionMakerNew.Text = hsLuong.DecisionMaker;
                //cbxMakerPosition.Text = hsLuong.MakerPosition;
                var strContractTypeId = hr_ContractServices.GetFieldValueById(hsLuong.ContractId, "ContractTypeId");
                if (!string.IsNullOrEmpty(strContractTypeId))
                {
                    var contractTypeName =
                        cat_ContractTypeServices.GetFieldValueById(Convert.ToInt32(strContractTypeId), "Name");
                    cbxContractTypeNew.Text = "" + contractTypeName;
                    hdfContractTypeNew.SetValue(strContractTypeId);
                }

                // them ten nguoi qd
                if (composifieldAttach.Visible)
                {
                    hdfAttachFile.Text = hsLuong.AttachFileName;
                    if (!string.IsNullOrEmpty(hsLuong.AttachFileName))
                    {
                        hdfAttachFile.Text    = hsLuong.AttachFileName;
                        uploadAttachFile.Text = GetFileName(hsLuong.AttachFileName);
                    }
                }

                if (txtNoteNew.Visible)
                {
                    txtNoteNew.Text = hsLuong.Note;
                }
                //txtSalaryBasicNew.SetValue(hsLuong.SalaryBasic);
                //txtSalaryContractNew.SetValue(hsLuong.SalaryContract);
                //txtSalaryGrossNew.SetValue(hsLuong.SalaryGross);
                //txtSalaryNetNew.SetValue(hsLuong.SalaryNet);
                //txtSalaryInsuranceNew.SetValue(hsLuong.SalaryInsurance);
                //txtSalaryFactorNew.SetValue(hsLuong.SalaryFactor.ToString().Replace(".", ","));
                //txtPercentageSalaryNew.SetValue(hsLuong.PercentageSalary);
                //txtOtherAllowanceNew.SetValue(hsLuong.OtherAllowance);
                //txtAreaAllowanceNew.SetValue(hsLuong.AreaAllowance);
                //txtPositionAllowanceNew.SetValue(hsLuong.PositionAllowance);
                //txtResponsibilityAllowanceNew.SetValue(hsLuong.ResponsibilityAllowance);
                //txtBranchAllowanceNew.SetValue(hsLuong.BranchAllowance);
                // update form information
                wdCreateDecisionSalary.Title = @"Cập nhật thông tin quyết định lương";
                wdCreateDecisionSalary.Icon  = Icon.Pencil;
                btnUpdate.Hide();
                btnUpdateEdit.Show();
                btnUpdateClose.Hide();
                wdCreateDecisionSalary.Show();
            }
            catch (Exception ex)
            {
                X.MessageBox.Alert("Có lỗi xảy ra: ", ex.Message).Show();
            }
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        private void InitFormUpdate(int id)
        {
            // get current decision
            var model = SalaryDecisionController.GetById(id);

            if (model != null)
            {
                // get previous decision
                var previousDecision = SalaryDecisionController.GetPrevious(model.RecordId);

                // bind previous data
                if (previousDecision != null)
                {
                    txtCurrName.Text             = previousDecision.Name;
                    txtCurrDecisionNumber.Text   = previousDecision.DecisionNumber;
                    txtCurrDecisionDate.Text     = previousDecision.DecisionDate.ToString("dd/MM/yyyy");
                    txtCurrSignerName.Text       = previousDecision.SignerName;
                    txtCurrSignerPosition.Text   = previousDecision.SignerPosition;
                    txtCurrContractTypeName.Text = previousDecision.ContractTypeName;
                    txtCurrBasicSalary.Text      = previousDecision.BasicSalary.ToString("#,###");
                    txtCurrFactor.Text           = previousDecision.Factor.ToString("#,##0.00");
                    txtCurrGrossSalary.Text      = previousDecision.GrossSalary.ToString("#,###");
                    txtCurrNetSalary.Text        = previousDecision.NetSalary.ToString("#,###");
                    txtCurrContractSalary.Text   = previousDecision.ContractSalary.ToString("#,###");
                    txtCurrInsuranceSalary.Text  = previousDecision.InsuranceSalary.ToString("#,###");
                    txtCurrPercentageLeader.Text = previousDecision.PercentageLeader.ToString("0.00 %");
                }

                // bind current salary decision
                cboEmployee.Text             = model.EmployeeName;
                hdfEmployee.Text             = model.RecordId.ToString();
                txtName.Text                 = model.Name;
                txtDepartmentName.Text       = model.DepartmentName;
                txtPositionName.Text         = model.PositionName;
                txtJobTitleName.Text         = model.JobTitleName;
                cboContractType.Text         = model.ContractTypeName;
                txtDecisionNumber.Text       = model.DecisionNumber;
                dfDecisionDate.SelectedDate  = model.DecisionDate;
                dfEffectiveDate.SelectedDate = model.EditedDate;
                txtSignerName.Text           = model.SignerName;
                hdfPosition.Text             = model.SignerPositionId.ToString();
                cboPosition.Text             = model.SignerPosition;
                txtNote.Text                 = model.Note;
                txtBasicSalary.Text          = model.BasicSalary.ToString("#,###");
                txtFactor.Text               = model.Factor.ToString("#,##0.00");
                txtGrossSalary.Text          = model.GrossSalary.ToString("#,###");
                txtNetSalary.Text            = model.NetSalary.ToString("#,###");
                txtContractSalary.Text       = model.ContractSalary.ToString("#,###");
                txtInsuranceSalary.Text      = model.InsuranceSalary.ToString("#,###");
                txtPercentageSalary.Text     = model.PercentageSalary.ToString("0.00");
                txtPercentageLeader.Text     = model.PercentageLeader.ToString("0.00");
                txtPercentageOverGrade.Text  = model.PercentageOverGrade.ToString("0.00");
                // get file upload
                if (cfAttachFile.Visible)
                {
                    hdfAttachFile.Text = model.AttachFileName;
                    if (!string.IsNullOrEmpty(model.AttachFileName))
                    {
                        hdfAttachFile.Text = model.AttachFileName;
                        fufAttachFile.Text = GetFileName(model.AttachFileName);
                    }
                }
                //insurance
                var insurance = FluctuationInsuranceController.GetByRecordId(model.RecordId, model.EffectiveDate.Month, model.EffectiveDate.Year);

                if (insurance != null)
                {
                    hdfReason.Text        = insurance.ReasonId.ToString();
                    cboReason.Text        = insurance.ReasonName;
                    hdfInsuranceType.Text = ((int)insurance.Type).ToString();
                    if (insurance.Type != 0)
                    {
                        cboInsuranceType.Text = insurance.TypeName;
                    }
                    if (!string.IsNullOrEmpty(hdfInsuranceType.Text))
                    {
                        cboReason.Show();
                    }
                }
                else
                {
                    //reset insurance
                    ResetInsurance();
                }
            }
        }
Пример #6
0
        /// <summary>
        /// Sửa thông tin quyết định lương
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, DirectEventArgs e)
        {
            try
            {
                var hsLuong = SalaryDecisionController.GetById(Convert.ToInt32(hdfRecordId.Text));
                if (hsLuong == null)
                {
                    X.Msg.Alert("Thông báo từ hệ thống", "Không tìm thấy quyết định lương").Show();
                    return;
                }

                // load general information for employee
                var hs = RecordController.GetById(hsLuong.RecordId);
                if (hs != null)
                {
                    hdfChonCanBo.Text  = hs.Id.ToString();
                    cbxChonCanBo.Text  = hs.FullName;
                    txtDepartment.Text = hs.DepartmentName;
                    txtChucVu.Text     = hs.PositionName;
                    txtCongViec.Text   = hs.JobTitleName;
                }

                // load newest salary decision information
                var hsl = SalaryDecisionController.GetByIdConditionRecord(hsLuong.RecordId);
                if (hsl != null)
                {
                    if (txtSoQDCu.Visible == true && !string.IsNullOrEmpty(hsl.DecisionNumber))
                    {
                        txtSoQDCu.Text = hsl.DecisionNumber;
                    }
                    if (txtTenQDCu.Visible == true && !string.IsNullOrEmpty(hsl.DecisionName))
                    {
                        txtTenQDCu.Text = hsl.DecisionName;
                    }
                    if (dfNgayQDCu.Visible == true)
                    {
                        dfNgayQDCu.SetValue(hsl.DecisionDate);
                    }
                    if (txtNguoiQDCu.Visible == true && hsl.DecisionMaker != null)
                    {
                        txtNguoiQDCu.Text = hsl.DecisionMaker;
                    }
                    if (dfNgayCoHieuLucCu.Visible == true)
                    {
                        dfNgayCoHieuLucCu.SetValue(hsl.EffectiveDate);
                    }
                    if (cbxNgachCu.Visible == true)
                    {
                        if (string.IsNullOrEmpty(hsl.QuantumCode))
                        {
                            cbxNgachCu.SetValue("");
                        }
                        else
                        {
                            cbxNgachCu.SetValue(hsl.QuantumName);
                        }
                    }

                    if (txtBacLuongCu.Visible == true && !string.IsNullOrEmpty(hsl.SalaryGrade))
                    {
                        txtBacLuongCu.Text = hsl.SalaryGrade;
                    }
                    if (txtHeSoLuongCu.Visible == true && hsl.SalaryFactor != null)
                    {
                        txtHeSoLuongCu.SetValue(hsl.SalaryFactor);
                    }
                    if (txtMucLuongCu.Visible == true && hsl.SalaryBasic != null)
                    {
                        txtMucLuongCu.SetValue(hsl.SalaryBasic);
                    }
                    if (txtLuongDongBHCu.Visible == true && hsl.SalaryInsurance != null)
                    {
                        txtLuongDongBHCu.SetValue(hsl.SalaryInsurance);
                    }
                    if (txtPhuCapKhacCu.Visible == true && hsl.OtherAllowance != null)
                    {
                        txtPhuCapKhacCu.SetValue(hsl.OtherAllowance);
                    }
                    if (txtPCTrachNhiemCu.Visible == true && hsl.ResponsibilityAllowance != null)
                    {
                        txtPCTrachNhiemCu.SetValue(hsl.ResponsibilityAllowance);
                    }
                    if (txtPCKhuVucCu.Visible == true && hsl.AreaAllowance != null)
                    {
                        txtPCKhuVucCu.SetValue(hsl.AreaAllowance);
                    }
                    if (txtVuotKhungCu.Visible == true && hsl.OutFrame != null)
                    {
                        txtVuotKhungCu.SetValue(hsl.OutFrame);
                    }
                    var strContractTypeOldId =
                        hr_ContractServices.GetFieldValueById(hsLuong.ContractId, "ContractTypeId");
                    if (!string.IsNullOrEmpty(strContractTypeOldId))
                    {
                        var contractTypeOldName =
                            cat_ContractTypeServices.GetFieldValueById(Convert.ToInt32(strContractTypeOldId), "Name");
                        cbHopDongLoaiHopDongCu.Text = "" + contractTypeOldName;
                    }
                }

                // load current decision information
                if (txtSoQDMoi.Visible == true)
                {
                    txtSoQDMoi.Text = hsLuong.DecisionNumber;
                }
                if (dfNgayQDMoi.Visible == true)
                {
                    dfNgayQDMoi.SetValue(hsLuong.DecisionDate);
                }
                if (txtTenQDMoi.Visible == true)
                {
                    txtTenQDMoi.Text = hsLuong.DecisionName;
                }
                if (dfNgayHieuLucMoi.Visible == true)
                {
                    dfNgayHieuLucMoi.SetValue(hsLuong.EffectiveDate);
                }
                if (txtNguoiQD.Visible == true)
                {
                    txtNguoiQD.Text = hsLuong.DecisionMaker;
                }
                if (dfSalaryRaiseNextDate.Visible == true)
                {
                    dfSalaryRaiseNextDate.SetValue(hsl.SalaryRaiseNextDate);
                }
                cbxMakerPosition.Text = hsLuong.MakerPosition;
                var strContractTypeId = hr_ContractServices.GetFieldValueById(hsLuong.ContractId, "ContractTypeId");
                if (!string.IsNullOrEmpty(strContractTypeId))
                {
                    var contractTypeName =
                        cat_ContractTypeServices.GetFieldValueById(Convert.ToInt32(strContractTypeId), "Name");
                    cbHopDongLoaiHopDongMoi.Text = "" + contractTypeName;
                    hdfLoaiHopDong.SetValue(strContractTypeId);
                }

                // them ten nguoi qd
                if (composifieldAttach.Visible == true)
                {
                    hdfTepTinDinhKem.Text = hsLuong.AttachFileName;
                    if (!string.IsNullOrEmpty(hsLuong.AttachFileName))
                    {
                        hdfTepTinDinhKem.Text = hsLuong.AttachFileName;
                        fufTepTinDinhKem.Text = GetFileName(hsLuong.AttachFileName);
                    }
                }

                if (txtGhiChuMoi.Visible == true)
                {
                    txtGhiChuMoi.Text = hsLuong.Note;
                }
                // load current salary information
                if (cbx_ngachMoi.Visible == true)
                {
                    if (string.IsNullOrEmpty(hsl.QuantumCode))
                    {
                        hdfQuantumId.SetValue("");
                        cbx_ngachMoi.SetValue("");
                    }
                    else
                    {
                        hdfQuantumId.SetValue(hsl.QuantumId);
                        cbx_ngachMoi.SetValue(hsl.QuantumName);
                    }
                }

                if (cbxBacMoi.Visible == true)
                {
                    hdfSalaryGrade.SetValue(hsLuong.SalaryGrade);
                    cbxBacMoi.SetValue("Bậc " + hsLuong.SalaryGrade);
                }

                if (txtHeSoLuongMoi.Visible == true)
                {
                    txtHeSoLuongMoi.SetValue(hsLuong.SalaryFactor);
                }
                if (txtMucLuongMoi.Visible == true)
                {
                    txtMucLuongMoi.SetValue(hsLuong.SalaryBasic);
                }
                if (txtLuongDongBHMoi.Visible == true)
                {
                    txtLuongDongBHMoi.SetValue(hsLuong.SalaryInsurance);
                }
                if (txtBacLuongNBMoi.Visible == true)
                {
                    txtBacLuongNBMoi.Text = hsLuong.SalaryGradeLift;
                }
                if (dfNgayHLNBMoi.Visible == true && !Util.GetInstance().IsDateNull(hsLuong.SalaryGradeDate))
                {
                    dfNgayHLNBMoi.SetValue(hsLuong.SalaryGradeDate);
                }
                if (txtPhuCapKhacMoi.Visible == true)
                {
                    txtPhuCapKhacMoi.SetValue(hsLuong.OtherAllowance);
                }
                if (txtPhuCapChucVuMoi.Visible == true)
                {
                    txtPhuCapChucVuMoi.SetValue(hsLuong.PositionAllowance);
                }
                if (txtVuotKhungMoi.Visible == true)
                {
                    txtVuotKhungMoi.SetValue(hsLuong.OutFrame);
                }
                txtThamnien.SetValue(hsLuong.Seniority);
                if (txtPhuCapTrachNhiemMoi.Visible == true)
                {
                    txtPhuCapTrachNhiemMoi.SetValue(hsLuong.ResponsibilityAllowance);
                }
                if (txtPhuCapKhuVucMoi.Visible == true)
                {
                    txtPhuCapKhuVucMoi.SetValue(hsLuong.AreaAllowance);
                }
                txtPCNganh.SetValue(hsLuong.BranchAllowance);

                // update form information
                wdTaoQuyetDinhLuong.Title = "Cập nhật thông tin quyết định lương";
                wdTaoQuyetDinhLuong.Icon  = Icon.Pencil;
                btnCapNhat.Hide();
                btnCapNhatSua.Show();
                btnCapNhatDongLai.Hide();
                wdTaoQuyetDinhLuong.Show();
            }
            catch (Exception ex)
            {
                X.MessageBox.Alert("Có lỗi xảy ra: ", ex.Message).Show();
            }
        }