/// <summary> /// 查询 /// </summary> public void ExecutEvent(string letter) { if (!ValidateFrom() || !ValidateTo()) { } else { try { _View.ErrorMessage = string.Empty; EmployeeTypeEnum employeetype = EmployeeTypeUtility.GetEmployeeTypeByID(Convert.ToInt32(_View.EmployeeType)); //_EmployeeList = // _IEmployeeFacade.GetEmployeeByBasicConditionAndFirstLetter(_View.EmployeeName, employeetype, // _View.PositionId, _View.DepartmentId, // _View.RecursionDepartment, // letter); //20090807 修改查询条件 by liudan _EmployeeList = _IEmployeeFacade.GetEmployeeByBasicConditionWithFirstLetterAndCompanyAge(_View.EmployeeName, employeetype, _View.PositionId, _View.DepartmentId, _View.RecursionDepartment, letter, AgeFrom, AgeTo, Convert.ToInt32(_View.EmployeeStatusId)); _EmployeeList = HrmisUtility.RemoteUnAuthEmployee(_EmployeeList, AuthType.HRMIS, _Operator, HrmisPowers.A401); List <Employee> emplyees = new List <Employee>(); foreach (Employee emplyee in _EmployeeList) { //根据所属公司id,得到所属公司名称 Employee temp = emplyee; if (temp.EmployeeDetails == null || temp.EmployeeDetails.Work == null || temp.EmployeeDetails.Work.Company == null) { } else { //todo noted by wsl transfer waiting for modify temp.EmployeeDetails.Work.Company = _IDepartmentBll.GetDepartmentById( temp.EmployeeDetails.Work.Company.Id, new Account()); } temp.EmployeeDetails = temp.EmployeeDetails ?? new EmployeeDetails(); temp.EmployeeDetails.Work = temp.EmployeeDetails.Work ?? new Work(); temp.EmployeeDetails.Work.Company = temp.EmployeeDetails.Work.Company ?? new Department(); emplyees.Add(temp); } _CardView.Employees = emplyees; _View.ErrorMessage = "<span class='font14b'>共查到 </span>" + "<span class='fontred'>" + _EmployeeList.Count + "</span>" + "<span class='font14b'> 条信息</span>"; } catch (Exception ex) { _View.ErrorMessage = "<span class='fontred'>" + ex.Message + "</span>"; } } }
private void GetData() { List <Department> departmentList = _Department.GetAllDepartment(); _ItsView.DepartmentSource = Tools.RemoteUnAuthDeparetment(departmentList, AuthType.HRMIS, _LoginUser, HrmisPowers.A604); _ItsView.PositionSource = _Position.GetAllPosition(); _ItsView.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); }
private void BindTypesSource() { _ItsView.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _ItsView.EducationalBackgroundSource = EducationalBackground.AllEducationalBackgrounds; _ItsView.PoliticalAffiliationSource = PoliticalAffiliation.AllPoliticalAffiliations; _ItsView.GenderSource = Gender.AllGenders; _ItsView.MaritalStatusSource = MaritalStatus.GetAllMaritalStatus(); _ItsView.CountryNationalitySource = _ItsNationalityFacade.GetNationalityByCondition(-1, ""); }
private void GetData() { List <Department> deptList = _IDepartmentBll.GetAllDepartment(); _View.DepartmentSource = Tools.RemoteUnAuthDeparetment(deptList, AuthType.HRMIS, LoginUser, HrmisPowers.A703); _View.PositionSource = _IPositionBll.GetAllPosition(); _View.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _View.EmployeeType = EmployeeTypeEnum.NormalEmployee; }
public override void BindGridView() { EmployeeTypeEnum employeetype = EmployeeTypeUtility.GetEmployeeTypeByID(Convert.ToInt32(_View.EmployeeType)); var employees = EmployeeLogic.GetEmployeeBasicInfoByBasicConditionRetModel(_View.EmployeeName, employeetype, _View.PositionId, null, _View.DepartmentId, null, _View.RecursionDepartment, HrmisPowers.A703, LoginUser.Id, -1, null, null); _View.Employees = employees.Select(x => x.Account).ToList(); // InstanceFactory.AssessActivityFacade().GetAssessActivityForHRApply(_View.EmployeeName, employeetype, _View.PositionId, _View.DepartmentId, _View.RecursionDepartment, LoginUser); }
private void GetData() { List <Department> deptList = _IDepartmentBll.GetAllDepartment(); _View.DepartmentSource = Tools.RemoteUnAuthDeparetment(deptList, AuthType.HRMIS, _Operator, HrmisPowers.A401); _View.PositionSource = _IPositionBll.GetAllPosition(); _View.GradesSource = GradesType.GetAll(); _View.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _View.EmployeeType = EmployeeTypeEnum.All; }
private void GetData() { List <Department> deptList = _IDepartmentBll.GetAllDepartment(); _View.DepartmentSource = Tools.RemoteUnAuthDeparetment(deptList, AuthType.HRMIS, _Operator, HrmisPowers.A605); _View.PositionSource = _IPositionBll.GetAllPosition(); _View.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _View.EmployeeType = EmployeeTypeEnum.All; _View.CompanySource = _ICompanyFacade.GetAllCompanyHaveEmployee(_Operator, HrmisPowers.A605); }
private void InitEmployeeTypeSource() { Dictionary <string, string> employeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); listEmployeeType.Items.Clear(); ListItem itemAll = new ListItem(string.Empty, "-1", true); listEmployeeType.Items.Add(itemAll); foreach (KeyValuePair <string, string> pair in employeeTypeSource) { ListItem item = new ListItem(pair.Value, pair.Key, true); listEmployeeType.Items.Add(item); } }
public void InitView(bool ispostback) { _View.ResultMsg = string.Empty; if (!ispostback) { List <Department> deptList = _IDepartmentBll.GetAllDepartment(); _View.DepartmentSource = Tools.RemoteUnAuthDeparetment(deptList, AuthType.HRMIS, _Operator, HrmisPowers.A405); _View.PositionSource = _IPositionBll.GetAllPosition(); _View.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _View.EmployeeType = EmployeeTypeEnum.All; SearchEvent(); } AttachViewEvent(); }
public void InitView(bool ispostback) { _ItsView.Message = string.Empty; _ItsView.btnGoToSetEmployeeSalaryEvent += btnGoToSetEmployeeSalaryEvent; _ItsView.GoToSetEmployeeSalaryPage += GoToSetEmployeeSalaryPage; if (!ispostback) { _ItsView.SalaryTime = new HrmisUtility().CurrenMonthStartTime().ToShortDateString(); _ItsView.CompanySource = _ICompanyFacade.GetAllCompanyHaveEmployee(_AccountOperator, HrmisPowers.A606); CompanyIndexChange(); _ItsView.EmployeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); _ItsView.AccountSetSource = _IAccountSetFacade.GetAccountSetByCondition(string.Empty); } _ItsView.SalaryTimeDisplay = new HrmisUtility().StartMonthByYearMonth(Convert.ToDateTime(_ItsView.SalaryTime)).ToShortDateString() + "---" + new HrmisUtility().EndMonthByYearMonth(Convert.ToDateTime(_ItsView.SalaryTime)).ToShortDateString(); }
/// <summary> /// 返回初始化界面希望显示的条件内容 /// </summary> /// <returns></returns> public static List <SearchField> InitialConditionList() { List <SearchField> returnList = new List <SearchField>(); returnList.Add(InitContractSearchField_EmployeeType()); returnList[0].ConditionField.ConditionExpression = EmployeeTypeUtility.EmployeeTypeDisplay(EmployeeTypeEnum.NormalEmployee) + ";" + EmployeeTypeUtility.EmployeeTypeDisplay(EmployeeTypeEnum.ProbationEmployee) + ";" + EmployeeTypeUtility.EmployeeTypeDisplay(EmployeeTypeEnum.PracticeEmployee) + ";" + EmployeeTypeUtility.EmployeeTypeDisplay(EmployeeTypeEnum.RetirementHire) + ";" + EmployeeTypeUtility.EmployeeTypeDisplay(EmployeeTypeEnum.WorkEmployee); returnList.Add(InitContractSearchField_Department()); returnList.Add(InitContractSearchField_Position()); returnList.Add(InitContractSearchField_Name()); returnList.Add(InitContractSearchField_ComeDate()); return(returnList); }
private bool VaildateEmployeeType() { Dictionary <string, string> employeeType = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); foreach (KeyValuePair <string, string> pair in employeeType) { if (pair.Key == _ItsView.EmployeeType) { _ItsView.EmployeeTypeMessage = string.Empty; return(true); } } _ItsView.EmployeeType = EmployeeTypeEnum.NormalEmployee.ToString(); _ItsView.EmployeeTypeMessage = EmployeePresenterUtilitys._ErrorType; return(false); }
private void btnExport() { if (Request.QueryString["txtName"] == null || Request.QueryString["listPosition"] == null || Request.QueryString["listEmployeeType"] == null || Request.QueryString["cbRecursionDepartment"] == null || Request.QueryString["listDepartment"] == null || Request.QueryString["ddlEmployeeStatus"] == null) { return; } DataTable dt = InstanceFactory.CreateEmployeeAccountSetFacade().ExportEmployeeAccountSetFacade( Request.QueryString["txtName"].Trim(), Convert.ToInt32(Request.QueryString["listDepartment"]), Convert.ToInt32(Request.QueryString["listPosition"]), EmployeeTypeUtility.GetEmployeeTypeByID(Convert.ToInt32(Request.QueryString["listEmployeeType"])), Convert.ToBoolean(Request.QueryString["cbRecursionDepartment"]), LoginUser, Convert.ToInt32(Request.QueryString["ddlEmployeeStatus"])); MemoryStream ms = ExcelExportUtility.DataTableTurnToExcel(dt); ExcelExportUtility.OutputExcel(Server, Response, "员工帐套", ms); }
/// <summary> /// 查询 /// </summary> public void ExecutEvent() { try { _ItsView.ResultMessage = string.Empty; EmployeeTypeEnum employeetype = EmployeeTypeUtility.GetEmployeeTypeByID(Convert.ToInt32(_ItsView.EmployeeType)); _EmployeeSalaryList = _IEmployeeAccountSetFacade.GetEmployeeAccountSetByCondition(_ItsView.EmployeeName, _ItsView.DepartmentId, _ItsView.PositionId, employeetype, _ItsView.RecursionDepartment, _LoginUser, Convert.ToInt32(_ItsView.EmployeeStatusId)); _ItsView.EmployeeAccountSetList = _EmployeeSalaryList; _ItsView.ResultMessage = "<span class='font14b'>共查到 </span>" + "<span class='fontred'>" + _EmployeeSalaryList.Count + "</span>" + "<span class='font14b'> 条信息</span>"; } catch (Exception ex) { _ItsView.ResultMessage = "<span class='fontred'>" + ex.Message + "</span>"; } }
/// <summary> /// 执行导出功能 /// </summary> /// <returns></returns> public DataTable Excute() { List <EmployeeSalary> employeeSalarys = new GetEmployeeAccountSet().GetEmployeeAccountSetByCondition(_EmployeeName, _DepartmentID, _PositionID, _EmployeeTypeEnum, _IsRecursionDepartment, _AccountOperator, _EmployeeStatus); foreach (EmployeeSalary employeeSalary in employeeSalarys) { EmployeeSalary employeeSalaryInfo = new GetEmployeeAccountSet().GetEmployeeAccountSetByEmployeeID(employeeSalary.Employee.Account.Id); if (employeeSalaryInfo != null) { employeeSalary.AccountSet = employeeSalaryInfo.AccountSet; } } //表格组成 DataTable dt = new DataTable(); dt.Columns.Add("员工姓名"); dt.Columns.Add("所属部门"); dt.Columns.Add("职位"); dt.Columns.Add("员工类型"); dt.Columns.Add("帐套名称"); foreach (EmployeeSalary employeeSalary in employeeSalarys) { if (employeeSalary.AccountSet == null || employeeSalary.AccountSet.Items == null) { continue; } foreach (AccountSetItem accountSetItem in employeeSalary.AccountSet.Items) { if (accountSetItem.AccountSetPara.FieldAttribute.Id == FieldAttributeEnum.FixedField.Id && !dt.Columns.Contains(accountSetItem.AccountSetPara.AccountSetParaName)) { dt.Columns.Add(accountSetItem.AccountSetPara.AccountSetParaName); } } } //赋值table foreach (EmployeeSalary employeeSalary in employeeSalarys) { DataRow dr = dt.NewRow(); dr["员工姓名"] = employeeSalary.Employee.Account.Name; dr["所属部门"] = employeeSalary.Employee.Account.Dept.Name; dr["职位"] = employeeSalary.Employee.Account.Position.Name; dr["员工类型"] = EmployeeTypeUtility.EmployeeTypeDisplay(employeeSalary.Employee.EmployeeType); dr["帐套名称"] = employeeSalary.AccountSet.AccountSetName; if (employeeSalary.AccountSet != null && employeeSalary.AccountSet.Items != null) { foreach (AccountSetItem accountSetItem in employeeSalary.AccountSet.Items) { if (accountSetItem.AccountSetPara.FieldAttribute.Id == FieldAttributeEnum.FixedField.Id && dt.Columns.Contains(accountSetItem.AccountSetPara.AccountSetParaName)) { dr[accountSetItem.AccountSetPara.AccountSetParaName] = accountSetItem.CalculateResult; } } } dt.Rows.Add(dr); } return(dt); }
/// <summary> /// 绑定 /// </summary> /// <returns></returns> public string ToBind() { string result = String.Empty; if (EmployeeFieldPara.Skill.Id.ToString() == _FieldParaBaseId) { List <Skill> all = new GetSkill().GetSkillByCondition("", -1); foreach (Skill item in all) { result += string.IsNullOrEmpty(result) ? item.SkillName : "\n" + item.SkillName; } } if (EmployeeFieldPara.PositionGrade.Id.ToString() == _FieldParaBaseId) { List <PositionGrade> all = BllInstance.PositionBllInstance.GetAllPositionGrade(); foreach (PositionGrade item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.EmployeeType.Id.ToString() == _FieldParaBaseId) { Dictionary <string, string> AllEmployeeType = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); foreach (KeyValuePair <string, string> item in AllEmployeeType) { result += string.IsNullOrEmpty(result) ? item.Value : "\n" + item.Value; } } if (EmployeeFieldPara.Position.Id.ToString() == _FieldParaBaseId) { IPositionBll _IPositionBll = BllInstance.PositionBllInstance; List <Position> all = _IPositionBll.GetAllPosition(); foreach (Position item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.Grades.Id.ToString() == _FieldParaBaseId) { var all = GradesType.GetAll(); foreach (var item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.Department.Id.ToString() == _FieldParaBaseId) { IDepartmentBll _IDepartmentBll = BllInstance.DepartmentBllInstance; List <Department> all = _IDepartmentBll.GetAllDepartment(); all = Tools.RemoteUnAuthDeparetment(all, AuthType.HRMIS, _OperatorAccount, HrmisPowers.A401); foreach (Department item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.Company.Id.ToString() == _FieldParaBaseId) { GetCompanyInvolve _GetCompanyInvolve = new GetCompanyInvolve(); List <Department> all = _GetCompanyInvolve.GetAllCompanyHaveEmployee(); foreach (Department item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.Gender.Id.ToString() == _FieldParaBaseId) { List <Gender> all = Gender.AllGenders; foreach (Gender item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DimissionReasonType.Id.ToString() == _FieldParaBaseId) { List <DimissionReasonType> all = DimissionReasonType.GetAll(); foreach (DimissionReasonType item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessApplicationTypeOut.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.ApplicationTypeOut.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessApplicationTypeOverTime.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.ApplicationTypeOverTime.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessAssess.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.Assess.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessHRPrincipal.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.HRPrincipal.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessLeaveRequest.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.LeaveRequest.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.DiyProcessTraineeApplication.Id.ToString() == _FieldParaBaseId) { GetDiyProcess _GetDiyProcess = new GetDiyProcess(); List <DiyProcess> all = _GetDiyProcess.GetDiyProcessByProcessType(ProcessType.TraineeApplication.Id); foreach (DiyProcess item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.EducationalBackground.Id.ToString() == _FieldParaBaseId) { List <EducationalBackground> all = EducationalBackground.AllEducationalBackgrounds; foreach (EducationalBackground item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.MaritalStatus.Id.ToString() == _FieldParaBaseId) { List <MaritalStatus> all = MaritalStatus.GetAllMaritalStatus(); foreach (MaritalStatus item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.PoliticalAffiliation.Id.ToString() == _FieldParaBaseId) { List <PoliticalAffiliation> all = PoliticalAffiliation.AllPoliticalAffiliations; foreach (PoliticalAffiliation item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.WorkType.Id.ToString() == _FieldParaBaseId) { List <WorkType> all = WorkType.GetAll(); foreach (WorkType item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (EmployeeFieldPara.CountryNationality.Id.ToString() == _FieldParaBaseId) { GetNationality _GetNationality = new GetNationality(); List <Nationality> all = _GetNationality.GetNationalityByCondition(-1, ""); foreach (Nationality item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } return(result); }
private void Search(NameValueCollection parameters) { List <ControlError> errors = new List <ControlError>(); List <EmployeeModel> EmployeeModelList = new List <EmployeeModel>(); string EmployeeName = parameters["EmployeeName"]; int employeeType = Convert.ToInt32(parameters["employeeType"]); int positionID = Convert.ToInt32(parameters["positionID"]); int departmentID = Convert.ToInt32(parameters["departmentID"]); int? gradesID = Convert.ToInt32(parameters["gradesID"]); if (gradesID < 0) { gradesID = null; } int EmployeeStatusId = Convert.ToInt32(parameters["EmployeeStatusId"]); string recursionDepartment = parameters["recursionDepartment"]; string ageFrom = parameters["ageFrom"]; string ageTo = parameters["ageTo"]; try { ValidateAge(ageFrom, ageTo); EmployeeTypeEnum _employeeType = EmployeeTypeUtility.GetEmployeeTypeByID(employeeType); List <Employee> _EmployeeList = _IEmployeeFacade.GetEmployeeBasicInfoByBasicConditionWithCompanyAge( EmployeeName, _employeeType, positionID, gradesID, departmentID, intAgeFrom, intAgeTo, recursionDepartment == "true", EmployeeStatusId); _EmployeeList = HrmisUtility.RemoteUnAuthEmployee(_EmployeeList, AuthType.HRMIS, _Operator, HrmisPowers.A401); List <Employee> employees = new List <Employee>(); foreach (Employee emplyee in _EmployeeList) { //根据所属公司id,得到所属公司名称 var temp = emplyee; if (temp.EmployeeDetails == null || temp.EmployeeDetails.Work == null || temp.EmployeeDetails.Work.Company == null) { } else { //todo noted by wsl transfer waiting for modify temp.EmployeeDetails.Work.Company = _IDepartmentBll.GetDepartmentById( temp.EmployeeDetails.Work.Company.Id, new Account()); } temp.EmployeeDetails = temp.EmployeeDetails ?? new EmployeeDetails(); temp.EmployeeDetails.Work = temp.EmployeeDetails.Work ?? new Work(); temp.EmployeeDetails.Work.Company = temp.EmployeeDetails.Work.Company ?? new Department(); employees.Add(temp); } //列表中没有查出当前员工的信息时,满足一下两个条件的任何一个,再次加载当前员工的信息 //1.所选部门是当前员工的部门 //2.所选部门包含当前员工的部门 //如现实数据中王莎莉登录,无任何权限,只可看自己的信息 if (_Operator.Name.Contains(EmployeeName) && !HrmisUtility.IsEmployeeListContainEmployee(employees, _Operator.Id)) { if (departmentID == -1) { GetCurrEmployee(employees, employeeType, positionID, gradesID, departmentID); } else if (departmentID != _Operator.Dept.Id) { Department selectedDept = _IDepartmentBll.GetDepartmentById(departmentID, null); if (selectedDept.IsExistDept(_Operator.Dept.Id)) { GetCurrEmployee(employees, employeeType, positionID, gradesID, departmentID); } } else { GetCurrEmployee(employees, employeeType, positionID, gradesID, departmentID); } } EmployeeModelList = employees.Select(x => new EmployeeModel { PKID = x.Account.Id, EmployeeName = "<div class='info' pkid='" + SecurityUtil.DECEncrypt(x.Account.Id.ToString()) + "'>" + x.Account.Name + "</div>", EmployeeType = EmployeeTypeUtility.EmployeeTypeDisplay(x.EmployeeType), Department = x.Account.Dept.Name, Company = x.EmployeeDetails.Work.Company.Name, Position = x.Account.Position.Name, WorkTime = x.EmployeeDetails.Work.ComeDate.ToString("yyyy-MM-dd") }).ToList(); } catch (Exception ex) { errors.Add(new ControlError("lblMessage", ex.Message)); } _ResponseString = PageUtility.FomartSearchString(EmployeeModelList, errors); }
/// <summary> /// 绑定 /// </summary> /// <returns></returns> public string ToBind() { string result = String.Empty; if (ContractFieldPara.ContractType.Id.ToString() == _FieldParaBaseId) { List <ContractType> all = new GetContractType().GetContractTypeByCondition(-1, ""); foreach (ContractType item in all) { result += string.IsNullOrEmpty(result) ? item.ContractTypeName : "\n" + item.ContractTypeName; } } if (ContractFieldPara.PositionGrade.Id.ToString() == _FieldParaBaseId) { List <PositionGrade> all = BllInstance.PositionBllInstance.GetAllPositionGrade(); foreach (PositionGrade item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (ContractFieldPara.EmployeeType.Id.ToString() == _FieldParaBaseId) { Dictionary <string, string> AllEmployeeType = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); foreach (KeyValuePair <string, string> item in AllEmployeeType) { result += string.IsNullOrEmpty(result) ? item.Value : "\n" + item.Value; } } if (ContractFieldPara.Position.Id.ToString() == _FieldParaBaseId) { IPositionBll _IPositionBll = BllInstance.PositionBllInstance; List <Position> all = _IPositionBll.GetAllPosition(); foreach (Position item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (ContractFieldPara.Department.Id.ToString() == _FieldParaBaseId) { IDepartmentBll _IDepartmentBll = BllInstance.DepartmentBllInstance; List <Department> all = _IDepartmentBll.GetAllDepartment(); all = Tools.RemoteUnAuthDeparetment(all, AuthType.HRMIS, _OperatorAccount, HrmisPowers.A402); foreach (Department item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (ContractFieldPara.Company.Id.ToString() == _FieldParaBaseId) { GetCompanyInvolve _GetCompanyInvolve = new GetCompanyInvolve(); List <Department> all = _GetCompanyInvolve.GetAllCompanyHaveEmployee(); foreach (Department item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } if (ContractFieldPara.WorkType.Id.ToString() == _FieldParaBaseId) { List <WorkType> all = WorkType.GetAll(); foreach (WorkType item in all) { result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name; } } return(result); }
private void Init() { List <ControlError> errors = new List <ControlError>(); ParametersModel parametersModel = new ParametersModel(); try { #region positon List <Position> positions = _IPositionBll.GetAllPosition(); parametersModel.PossitionList = new List <ParameterModel>(); parametersModel.PossitionList.Add(new ParameterModel() { PKID = "-1", Name = "" }); parametersModel.PossitionList.AddRange(positions.Select(x => new ParameterModel { PKID = x.Id.ToString(), Name = x.Name }).ToList()); #endregion #region department List <Department> deptList = Tools.RemoteUnAuthDeparetment(_IDepartmentBll.GetAllDepartment(), AuthType.HRMIS, _Operator, HrmisPowers.A401); if (!Tools.IsDeptListContainsDept(deptList, _Operator.Dept)) { deptList.Add(_Operator.Dept); } List <Department> departmentList = _IDepartmentBll.GenerateDeptListWithLittleParentDept(deptList); parametersModel.DepartmentList = new List <ParameterModel>(); if (Powers.HasAuth(_Operator.Auths, AuthType.HRMIS, HrmisPowers.A401)) { parametersModel.DepartmentList.Add(new ParameterModel() { PKID = "-1", Name = "" }); } parametersModel.DepartmentList.AddRange(departmentList.Select(x => new ParameterModel { PKID = x.Id.ToString(), Name = x.Name }).ToList()); #endregion #region type Dictionary <string, string> employeeTypeSource = EmployeeTypeUtility.GetAllEmployeeTypeEnum(); parametersModel.EmployeeTypeList = new List <ParameterModel>(); parametersModel.EmployeeTypeList.Add(new ParameterModel() { PKID = "-1", Name = "" }); parametersModel.EmployeeTypeList.AddRange(employeeTypeSource.Select(x => new ParameterModel { PKID = x.Key, Name = x.Value }).ToList()); #endregion #region GradesType List <GradesType> gradesTypes = GradesType.GetAll(); parametersModel.GradesTypeList = new List <ParameterModel>(); parametersModel.GradesTypeList.Add(new ParameterModel() { PKID = "-1", Name = "" }); parametersModel.GradesTypeList.AddRange(gradesTypes.Select(x => new ParameterModel { PKID = x.ID.ToString(), Name = x.Name }).ToList()); #endregion } catch (Exception ex) { errors.Add(new ControlError("lblMessage", ex.Message)); } _ResponseString = PageUtility.FomartItemString(parametersModel, errors); }