コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        protected void btnEdit_Click()
        {
            hdfPrKeyHoSo.Text = Request.QueryString["PrKeyHoSo"];
            var hs = RecordController.GetById(Convert.ToInt32(hdfPrKeyHoSo.Text));

            if (hs == null)
            {
                return;
            }
            // Ho so nhan su
            if (!string.IsNullOrEmpty(hs.ImageUrl))
            {
                img_anhdaidien.ImageUrl = Constant.PathLocationImageEmployee + @"/" + hs.ImageUrl;
            }
            txtEmployeeCode.Text = hs.EmployeeCode;
            txtFullName.Text     = hs.FullName;
            txtAlias.Text        = hs.Alias;
            cboDepartment.Text   = hs.DepartmentName;
            hdfDepartmentId.Text = hs.DepartmentId.ToString();
            dfBirthDate.SetValue(hs.BirthDateVn);
            cbxSex.Text = hs.SexName == "Nam" ? @"M" : @"F";

            cboMaritalStatus.Text   = hs.MaritalStatusName;
            hdfMaritalStatusId.Text = hs.MaritalStatusId.ToString();
            cbxPersonalClass.Text   = hs.PersonalClassName;
            hdfPersonalClassId.Text = hs.PersonalClassId.ToString();
            cbxFamilyClass.Text     = hs.FamilyClassName;
            hdfFamilyClassId.Text   = hs.FamilyClassId.ToString();
            txtCellPhoneNumber.Text = hs.CellPhoneNumber;
            txtHomePhoneNumber.Text = hs.HomePhoneNumber;
            txtWorkPhoneNumber.Text = hs.WorkPhoneNumber;
            cbxFolk.Text            = hs.FolkName;
            hdfFolkId.Text          = hs.FolkId.ToString();
            cbxReligion.Text        = hs.ReligionName;
            hdfReligionId.Text      = hs.ReligionId.ToString();
            txt_ResidentPlace.Text  = hs.ResidentPlace;
            txtCPVCardNumber.Text   = hs.CPVCardNumber;
            txtPersonalTaxCode.Text = hs.PersonalTaxCode;
            txtWorkEmail.Text       = hs.WorkEmail;
            txtPersonalEmail.Text   = hs.PersonalEmail;
            txt_Address.Text        = hs.Address;
            //Ngay thu viec
            RecruimentDate.SetValue(hs.RecruimentDate);
            //Ngay chinh thuc
            ParticipationDate.SetValue(hs.ParticipationDate);
            txtRecruitmentDepartment.Text = hs.RecruimentDepartment;
            cbxPosition.Text             = hs.PositionName;
            hdfPositionId.Text           = hs.PositionId.ToString();
            cbxBasicEducation.Text       = hs.BasicEducationName;
            hdfBasicEducationId.Text     = hs.BasicEducationId.ToString();
            cbxEducation.Text            = hs.EducationName;
            hdfEducationId.Text          = hs.EducationId.ToString();
            cbxPoliticLevel.Text         = hs.PoliticLevelName;
            hdfPoliticLevelId.Text       = hs.PoliticLevelId.ToString();
            cbxJobTitle.Text             = hs.JobTitleName;
            hdfJobTitleId.Text           = hs.JobTitleId.ToString();
            cbxWorkStatus.Text           = hs.WorkStatusName;
            txtWorkStatus.Text           = hs.WorkStatusName;
            hdfWorkStatusId.Text         = hs.WorkStatusId.ToString();
            cbxBirthPlaceProvince.Text   = hs.BirthPlaceProvinceName;
            cbxBirthPlaceDistrict.Text   = hs.BirthPlaceDistrictName;
            cbxBirthPlaceWard.Text       = hs.BirthPlaceWardName;
            cbxHometownProvince.Text     = hs.HometownProvinceName;
            cbxHometownDistrict.Text     = hs.HometownDistrictName;
            cbxHometownWard.Text         = hs.HometownWardName;
            hdfBirthPlaceProvinceId.Text = hs.BirthPlaceProvinceId.ToString();
            hdfBirthPlaceDistrictId.Text = hs.BirthPlaceDistrictId.ToString();
            hdfBirthPlaceWardId.Text     = hs.BirthPlaceWardId.ToString();
            hdfHometownProvinceId.Text   = hs.HometownProvinceId.ToString();
            hdfHometownDistrictId.Text   = hs.HometownDistrictId.ToString();
            hdfHometownWardId.Text       = hs.HometownWardId.ToString();
            if (!string.IsNullOrEmpty(hdfBirthPlaceDistrictId.Text))
            {
                cbxBirthPlaceDistrict.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfBirthPlaceWardId.Text))
            {
                cbxBirthPlaceWard.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfHometownDistrictId.Text))
            {
                cbxHometownDistrict.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfHometownWardId.Text))
            {
                cbxHometownWard.Disabled = false;
            }
            cbxITLevel.Text         = hs.ITLevelName;
            hdfITLevelId.Text       = hs.ITLevelId.ToString();
            cbxLanguageLevel.Text   = hs.LanguageLevelName;
            hdfLanguageLevelId.Text = hs.LanguageLevelId.ToString();
            cbxCPVPosition.Text     = hs.CPVPositionName;
            hdfCPVPositionId.Text   = hs.CPVPositionId.ToString();
            cbxVYUPosition.Text     = hs.VYUPositionName;
            hdfVYUPositionId.Text   = hs.VYUPositionId.ToString();
            cbxArmyLevel.Text       = hs.ArmyLevelName;
            hdfArmyLevelId.Text     = hs.ArmyLevelId.ToString();
            ArmyJoinedDate.SetValue(hs.ArmyJoinedDate);
            ArmyLeftDate.SetValue(hs.ArmyLeftDate);
            cbxHealthStatus.Text   = hs.HealthStatusName;
            hdfHealthStatusId.Text = hs.HealthStatusId.ToString();
            cbxFamilyPolicy.Text   = hs.FamilyPolicyName;
            hdfFamilyPolicyId.Text = hs.FamilyPolicyId.ToString();
            cbxIDIssuePlace.Text   = hs.IDIssuePlaceName;
            hdfIDIssuePlaceId.Text = hs.IDIssuePlaceId.ToString();
            CPVJoinedDate.SetValue(hs.CPVJoinedDate);
            CPVOfficialJoinedDate.SetValue(hs.CPVOfficialJoinedDate);
            txtCPVJoinedPlace.Text = hs.CPVJoinedPlace;
            VYUJoinedDate.SetValue(hs.VYUJoinedDate);
            txtVYUJoinedPlace.Text = hs.VYUJoinedPlace;
            cbxBloodGroup.SetValue(hs.BloodGroup);
            txtHeight.SetValue(hs.Height);
            txtWeight.SetValue(hs.Weight);
            txtRankWounded.Text = hs.RankWounded;
            txtIDNumber.SetValue(hs.IDNumber);
            IDIssueDate.SetValue(hs.IDIssueDate);
            txtInsuranceNumber.Text = hs.InsuranceNumber;
            InsuranceIssueDate.SetValue(hs.InsuranceIssueDate);
            txtContactAddress.Text     = hs.ContactAddress;
            txtContactPersonName.Text  = hs.ContactPersonName;
            txtContactPhoneNumber.Text = hs.ContactPhoneNumber;
            txtContactRelation.Text    = hs.ContactRelation;
            cbxInputIndustry.Text      = hs.IndustryName;
            hdfInputIndustryId.Text    = hs.IndustryId.ToString();
            hdfAnhDaiDien.Text         = hs.ImageUrl;

            //Thong tin to doi
            var team = hr_TeamServices.GetByRecordId(hs.Id);

            if (team != null)
            {
                hdfConstructionId.Text  = team.ConstructionId.ToString();
                cbxConstruction.Text    = cat_ConstructionServices.GetFieldValueById(team.ConstructionId, "Name");
                hdfTeamId.Text          = team.TeamId.ToString();
                cbxTeam.Text            = cat_TeamServices.GetFieldValueById(team.TeamId, "Name");
                txtStudyWorkingDay.Text = team.StudyWorkingDay.ToString();
                txtGraduationYear.Text  = team.GraduationYear.ToString();

                //BHYT
                txtHealthInsuranceNumber.Text = team.HealthInsuranceNumber;
                dfHealthJoinedDate.SetValue(team.HealthJoinedDate);
                dfHealthExpiredDate.SetValue(team.HealthExpiredDate);

                //Xếp loại
                hdfGraduationTypeId.Text = team.GraduationTypeId.ToString();
                cbxGraduationType.Text   = cat_GraduationTypeServices.GetFieldValueById(team.GraduationTypeId, "Name");
                hdfUniversityId.Text     = team.UniversityId.ToString();
                cbxUniversity.Text       = cat_UniversityServices.GetFieldValueById(team.UniversityId, "Name");
                dfUnionJoinedDate.SetValue(team.UnionJoinedDate);
                txtUnionJoinedPosition.Text = team.UnionJoinedPosition;
                //Thoi gian thu viec
                txtProbationWorkingTime.Text = team.ProbationWorkingTime.ToString();
                hdfWorkingFormId.Text        = team.WorkingFormId.ToString();
                cbxWorkingForm.Text          = ((WorkingFormType)Enum.Parse(typeof(WorkingFormType), hdfWorkingFormId.Text)).Description();
                hdfWorkLocationId.Text       = team.WorkLocationId.ToString();
                cbxWorkLocation.Text         = cat_WorkLocationServices.GetFieldValueById(team.WorkLocationId, "Name");
            }

            //Quan he gia dinh
            GridPanelFamilyRelationship.Reload();
        }
コード例 #2
0
        public void btnEdit_Click(RecordType type)
        {
            switch (type)
            {
            case RecordType.Default:
                wdInput.SetTitle("Cập nhật thông tin hồ sơ");
                hdfType.Text = @"0";
                break;

            case RecordType.Candidate:
                txtEmployeeCode.Hidden          = true;
                txtCandidateCode.Hidden         = false;
                panelJob.Disabled               = true;
                panelPolitic.Disabled           = true;
                panelEmployeeInsurance.Disabled = true;
                ctnCandidate.Hidden             = false;
                wdInput.SetTitle("Cập nhật thông tin ứng viên");
                hdfType.Text = @"1";
                break;

            default:
                break;
            }

            if (string.IsNullOrEmpty(hdfRecordId.Text))
            {
                return;
            }
            var hs = RecordController.GetById(Convert.ToInt32(hdfRecordId.Text));

            if (hs == null)
            {
                return;
            }
            // Ho so nhan su
            if (!string.IsNullOrEmpty(hs.ImageUrl))
            {
                img_anhdaidien.ImageUrl = @"~/" + Constant.PathLocationImageEmployee + @"/" + hs.ImageUrl;
            }
            txtEmployeeCode.Text = hs.EmployeeCode;
            txtFullName.Text     = hs.FullName;
            txtAlias.Text        = hs.Alias;
            cboDepartment.Text   = hs.DepartmentName;
            hdfDepartmentId.Text = hs.DepartmentId.ToString();
            dfBirthDate.SetValue(hs.BirthDateVn);
            cbxSex.Text             = hs.SexName == "Nam" ? @"M" : @"F";
            cboMaritalStatus.Text   = hs.MaritalStatusName;
            hdfMaritalStatusId.Text = hs.MaritalStatusId.ToString();
            txtCellPhoneNumber.Text = hs.CellPhoneNumber;
            txtHomePhoneNumber.Text = hs.HomePhoneNumber;
            txtWorkPhoneNumber.Text = hs.WorkPhoneNumber;
            cbxFolk.Text            = hs.FolkName;
            hdfFolkId.Text          = hs.FolkId.ToString();
            cbxReligion.Text        = hs.ReligionName;
            hdfReligionId.Text      = hs.ReligionId.ToString();
            txt_ResidentPlace.Text  = hs.ResidentPlace;
            txtCPVCardNumber.Text   = hs.CPVCardNumber;
            txtPersonalTaxCode.Text = hs.PersonalTaxCode;
            txtWorkEmail.Text       = hs.WorkEmail;
            txtPersonalEmail.Text   = hs.PersonalEmail;
            txt_Address.Text        = hs.Address;
            //Ngay thu viec
            RecruimentDate.SetValue(hs.RecruimentDate);
            //Ngay chinh thuc
            ParticipationDate.SetValue(hs.ParticipationDate);
            txtRecruitmentDepartment.Text = hs.RecruimentDepartment;
            cbxPosition.Text             = hs.PositionName;
            hdfPositionId.Text           = hs.PositionId.ToString();
            cbxBasicEducation.Text       = hs.BasicEducationName;
            hdfBasicEducationId.Text     = hs.BasicEducationId.ToString();
            cbxEducation.Text            = hs.EducationName;
            hdfEducationId.Text          = hs.EducationId.ToString();
            cbxPoliticLevel.Text         = hs.PoliticLevelName;
            hdfPoliticLevelId.Text       = hs.PoliticLevelId.ToString();
            cbxJobTitle.Text             = hs.JobTitleName;
            hdfJobTitleId.Text           = hs.JobTitleId.ToString();
            txtWorkStatus.Text           = hs.WorkStatusName;
            hdfWorkStatusId.Text         = hs.WorkStatusId.ToString();
            cbxBirthPlaceProvince.Text   = hs.BirthPlaceProvinceName;
            cbxBirthPlaceDistrict.Text   = hs.BirthPlaceDistrictName;
            cbxBirthPlaceWard.Text       = hs.BirthPlaceWardName;
            cbxHometownProvince.Text     = hs.HometownProvinceName;
            cbxHometownDistrict.Text     = hs.HometownDistrictName;
            cbxHometownWard.Text         = hs.HometownWardName;
            hdfBirthPlaceProvinceId.Text = hs.BirthPlaceProvinceId.ToString();
            hdfBirthPlaceDistrictId.Text = hs.BirthPlaceDistrictId.ToString();
            hdfBirthPlaceWardId.Text     = hs.BirthPlaceWardId.ToString();
            hdfHometownProvinceId.Text   = hs.HometownProvinceId.ToString();
            hdfHometownDistrictId.Text   = hs.HometownDistrictId.ToString();
            hdfHometownWardId.Text       = hs.HometownWardId.ToString();
            if (!string.IsNullOrEmpty(hdfBirthPlaceDistrictId.Text))
            {
                cbxBirthPlaceDistrict.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfBirthPlaceWardId.Text))
            {
                cbxBirthPlaceWard.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfHometownDistrictId.Text))
            {
                cbxHometownDistrict.Disabled = false;
            }
            if (!string.IsNullOrEmpty(hdfHometownWardId.Text))
            {
                cbxHometownWard.Disabled = false;
            }
            cbxITLevel.Text         = hs.ITLevelName;
            hdfITLevelId.Text       = hs.ITLevelId.ToString();
            cbxLanguageLevel.Text   = hs.LanguageLevelName;
            hdfLanguageLevelId.Text = hs.LanguageLevelId.ToString();
            cbxCPVPosition.Text     = hs.CPVPositionName;
            hdfCPVPositionId.Text   = hs.CPVPositionId.ToString();
            cbxVYUPosition.Text     = hs.VYUPositionName;
            hdfVYUPositionId.Text   = hs.VYUPositionId.ToString();
            cbxArmyLevel.Text       = hs.ArmyLevelName;
            hdfArmyLevelId.Text     = hs.ArmyLevelId.ToString();
            ArmyJoinedDate.SetValue(hs.ArmyJoinedDate);
            ArmyLeftDate.SetValue(hs.ArmyLeftDate);
            cbxHealthStatus.Text   = hs.HealthStatusName;
            hdfHealthStatusId.Text = hs.HealthStatusId.ToString();
            cbxFamilyPolicy.Text   = hs.FamilyPolicyName;
            hdfFamilyPolicyId.Text = hs.FamilyPolicyId.ToString();
            cbxIDIssuePlace.Text   = hs.IDIssuePlaceName;
            hdfIDIssuePlaceId.Text = hs.IDIssuePlaceId.ToString();
            CPVJoinedDate.SetValue(hs.CPVJoinedDate);
            CPVOfficialJoinedDate.SetValue(hs.CPVOfficialJoinedDate);
            txtCPVJoinedPlace.Text = hs.CPVJoinedPlace;
            VYUJoinedDate.SetValue(hs.VYUJoinedDate);
            txtVYUJoinedPlace.Text = hs.VYUJoinedPlace;
            cbxBloodGroup.SetValue(hs.BloodGroup);
            txtHeight.SetValue(hs.Height);
            txtWeight.SetValue(hs.Weight);
            txtRankWounded.Text = hs.RankWounded;
            txtIDNumber.SetValue(hs.IDNumber);
            IDIssueDate.SetValue(hs.IDIssueDate);
            txtInsuranceNumber.Text = hs.InsuranceNumber;
            InsuranceIssueDate.SetValue(hs.InsuranceIssueDate);
            txtContactAddress.Text     = hs.ContactAddress;
            txtContactPersonName.Text  = hs.ContactPersonName;
            txtContactPhoneNumber.Text = hs.ContactPhoneNumber;
            txtContactRelation.Text    = hs.ContactRelation;
            cbxInputIndustry.Text      = hs.IndustryName;
            hdfInputIndustryId.Text    = hs.IndustryId.ToString();
            hdfImagePerson.Text        = hs.ImageUrl;

            //Thong tin to doi
            hdfConstructionId.Text  = hs.ConstructionId.ToString();
            cbxConstruction.Text    = cat_ConstructionServices.GetFieldValueById(hs.ConstructionId, "Name");
            hdfTeamId.Text          = hs.TeamId.ToString();
            cbxTeam.Text            = cat_TeamServices.GetFieldValueById(hs.TeamId, "Name");
            txtStudyWorkingDay.Text = hs.StudyWorkingDay.ToString();
            txtGraduationYear.Text  = hs.GraduationYear.ToString();

            //BHYT
            txtHealthInsuranceNumber.Text = hs.HealthInsuranceNumber;
            dfHealthJoinedDate.SetValue(hs.HealthJoinedDate);
            dfHealthExpiredDate.SetValue(hs.HealthExpiredDate);

            //Xếp loại
            hdfGraduationTypeId.Text = hs.GraduationTypeId.ToString();
            cbxGraduationType.Text   = cat_GraduationTypeServices.GetFieldValueById(hs.GraduationTypeId, "Name");
            hdfUniversityId.Text     = hs.UniversityId.ToString();
            cbxUniversity.Text       = cat_UniversityServices.GetFieldValueById(hs.UniversityId, "Name");
            dfUnionJoinedDate.SetValue(hs.UnionJoinedDate);
            hdfUnionPosition.Text = hs.UnionJoinedPositionId.ToString();
            cboUnionPosition.Text = cat_PositionServices.GetFieldValueById(hs.UnionJoinedPositionId);

            //Thoi gian thu viec
            txtProbationWorkingTime.Text = hs.ProbationWorkingTime.ToString();
            hdfWorkingFormId.Text        = hs.WorkingFormId.ToString();
            cbxWorkingForm.Text          = ((WorkingFormType)Enum.Parse(typeof(WorkingFormType), hdfWorkingFormId.Text)).Description();
            hdfWorkLocationId.Text       = hs.WorkLocationId.ToString();
            cbxWorkLocation.Text         = cat_WorkLocationServices.GetFieldValueById(hs.WorkLocationId, "Name");

            // Tuyển dụng
            if (int.TryParse(hdfCandidateId.Text, out var result) && result > 0)
            {
                var candidate = CandidateController.GetById(result);
                if (candidate != null)
                {
                    txtCandidateCode.Text         = candidate.Code;
                    hdfRequiredRecruitmentId.Text = candidate.RequiredRecruitmentId.ToString();
                    cboRequiredRecruitment.Text   = candidate.RequiredRecruitmentName;
                    hdfCandidateStatus.Text       = candidate.Status.ToString();
                    cboCandidateStatus.Text       = candidate.StatusName;
                    txtDesiredSalary.SetValue(candidate.DesiredSalary);
                    dfApplyDate.SetValue(candidate.ApplyDate);
                }
            }
            //show window
            hdfEven.Text = "";

            wdInput.Show();
            //Quan he gia dinh
            GridPanelFamilyRelationship.Reload();
        }