コード例 #1
0
        private void SearchCompanyEmployees(CompanyEmployeeSearchViewModel model)
        {
            using (UnitOfWorkManager.NewUnitOfWork())
            {
                LoadPostStatus(model);
                var healthStatus = _categoryService.GetByParentName("HealthStatus");
                LoadHealthStatus(model, healthStatus);
                var adverseFactors = _companyEmployeeService.GetAdverseFactors();
                LoadAdverseFator(model, _companyEmployeeService.GetAdverseFactors());
                IList <string> departments = _companyEmployeeService.GetDepartments();
                IList <string> workTypes   = _companyEmployeeService.GetWorkTypes(WorkContext.CurrentMembershipUser.Company.Id);
                LoadDepartments(model, departments);
                LoadWorkTypes(model, workTypes);

                var searchModel = new CompanyEmployeeSearchModel
                {
                    PageIndex             = model.PageIndex,
                    KeyWords              = string.IsNullOrEmpty(model.KeyWords) ? "" : model.KeyWords,
                    SelectedAdverseFactor = model.SelectedAdverseFactor,
                    SelectedHealthStatus  = model.SelectedHealthStatus,
                    SelectedPostStatus    = model.SelectedPostStatus,
                    SeletedWorkType       = model.SelectedWorkType,
                    SelectedDepartment    = model.SelectedDepartment,
                    CompanyId             = WorkContext.CurrentMembershipUser.Company.Id,
                    PageSize              = int.MaxValue
                };
                model.Employees = _companyEmployeeService.Search(searchModel);
            }
        }
コード例 #2
0
        public ActionResult SelectEmployeeModal()
        {
            var model = new CompanyEmployeeSearchViewModel();

            SearchCompanyEmployees(model);
            return(PartialView(model));
        }
コード例 #3
0
        // GET: EmployeeManage
        public ActionResult Index()
        {
            var model = new CompanyEmployeeSearchViewModel();

            SearchCompanyEmployees(model);
            return(View(model));
        }
コード例 #4
0
 private void LoadPostStatus(CompanyEmployeeSearchViewModel model)
 {
     model.PostStatusList.Add(new SelectListItem {
         Text = "所有", Value = string.Empty
     });
     model.PostStatusList.Add(new SelectListItem {
         Text = "在职", Value = ((int)CompanyEmployeePostStatus.Stay).ToString()
     });
     model.PostStatusList.Add(new SelectListItem {
         Text = "离职", Value = ((int)CompanyEmployeePostStatus.Leave).ToString()
     });
 }
コード例 #5
0
 private void LoadHealthStatus(CompanyEmployeeSearchViewModel model, IList <Category> healthStatus)
 {
     model.HealthStatusList.Add(new SelectListItem {
         Text = "所有", Value = string.Empty
     });
     foreach (var item in healthStatus)
     {
         model.HealthStatusList.Add(new SelectListItem {
             Text = item.Name, Value = item.Id.ToString()
         });
     }
 }
コード例 #6
0
 private void LoadAdverseFator(CompanyEmployeeSearchViewModel model, IList <string> list)
 {
     foreach (var item in list)
     {
         if (item == string.Empty)
         {
             model.AdverseFactorList.Add("NULL");
         }
         else
         {
             model.AdverseFactorList.Add(item);
         }
     }
 }
コード例 #7
0
 private void LoadDepartments(CompanyEmployeeSearchViewModel model, IList <string> departments)
 {
     foreach (var item in departments)
     {
         if (item == string.Empty)
         {
             model.DepartmentList.Add("NULL");
         }
         else
         {
             model.DepartmentList.Add(item);
         }
     }
 }
コード例 #8
0
 private void LoadWorkTypes(CompanyEmployeeSearchViewModel model, IList <string> workTypes)
 {
     foreach (var item in workTypes)
     {
         if (item == string.Empty)
         {
             model.WorkTypeList.Add("NULL");
         }
         else
         {
             model.WorkTypeList.Add(item);
         }
     }
 }
コード例 #9
0
 public ActionResult SelectEmployeeModal(CompanyEmployeeSearchViewModel model)
 {
     SearchCompanyEmployees(model);
     return(PartialView(model));
 }
コード例 #10
0
 public ActionResult Index(CompanyEmployeeSearchViewModel model)
 {
     SearchCompanyEmployees(model);
     return(View(model));
 }