Пример #1
0
        public async Task <IActionResult> Index(string selectedOrg)
        {
            var organizations = await _sysAdminService.GetOrganiztions();

            SelectList listItems = new SelectList(organizations,
                                                  nameof(Organization.ID), nameof(Organization.Name));

            if (string.IsNullOrEmpty(selectedOrg))
            {
                selectedOrg = organizations.FirstOrDefault()?.ID.ToString();
            }
            var employees = await _employeeService.GetEmployeesInOrg(Convert.ToInt32(selectedOrg ?? "0"));

            EmployeeListViewModel model = new EmployeeListViewModel
            {
                OrgList     = listItems,
                SelectedOrg = selectedOrg,
                Employees   = employees
            };

            return(View(model));
        }
Пример #2
0
        internal static async Task WriteExcelReference(MemoryStream stream, ISysAdminService sysAdminService)
        {
            IWorkbook   workbook   = new XSSFWorkbook();
            IDataFormat dataformat = workbook.CreateDataFormat();
            ICellStyle  dateStyle  = workbook.CreateCellStyle();

            dateStyle.DataFormat = dataformat.GetFormat("yyyy-MM-dd");

            ISheet orgSheet  = workbook.CreateSheet("Organizations");
            ISheet specSheet = workbook.CreateSheet("Specialties");

            FullSheet <Entity.Organization>(await sysAdminService.GetOrganiztions(), orgSheet, dateStyle);
            FullSheet <Entity.Reference>(await sysAdminService.GetReferences(Entity.ReferenceTypeEnum.Specialty), specSheet, dateStyle);

            workbook.Write(stream);
        }
Пример #3
0
        /// <summary>
        /// 处理视图模型,包括ViewBag
        /// </summary>
        /// <param name="originModel"></param>
        /// <returns></returns>
        async Task <RecruitViewModel> ProcessRecruitViewModel(RecruitViewModel originModel)
        {
            var orgs = await _sysAdminService.GetOrganiztions();

            var specs = await _sysAdminService.GetReferences(ReferenceTypeEnum.Specialty);

            var duties = await _sysAdminService.GetReferences(ReferenceTypeEnum.Duty);

            ViewBag.OrgList  = new SelectList(orgs, nameof(Organization.ID), nameof(Organization.Name));
            ViewBag.SpecList = new SelectList(specs, nameof(Reference.ID), nameof(Reference.ReferenceValue));
            ViewBag.DutyList = new SelectList(duties, nameof(Reference.ID), nameof(Reference.ReferenceValue));
            var result = await _employeeService.SearchEmployee(originModel.GetCriteria());

            originModel.Total      = result.Total;
            originModel.Candidates = result.Records.Select(e => ProjEmployeeViewModel.Create(e, specs)).ToArray();
            return(originModel);
        }
Пример #4
0
        public async Task <IActionResult> Organizations()
        {
            Organization[] organizations = await _sysAdminSvc.GetOrganiztions();

            return(View(organizations));
        }