Ejemplo n.º 1
0
        public async Task <IActionResult> SearchByEmployeeNumber(string search)
        {
            ViewData["currentFilter"] = search;

            var viewModel = new HomeFlowViewModel();

            viewModel.Employees = await _homeRepository.GetEmployee();

            if (!string.IsNullOrEmpty(search))
            {
                viewModel.Employees = from e in viewModel.Employees
                                      where e.EmployeeNumber.ToString().Equals(search)
                                      select e;
            }

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> SearchByWorkstation(string search)
        {
            ViewData["currentFilter"] = search;

            var viewModel = new HomeFlowViewModel();

            viewModel.Employees = await _homeRepository.GetWorkstations();

            if (!string.IsNullOrEmpty(search))
            {
                viewModel.Employees = from e in viewModel.Employees
                                      where e.PrimarySkill.Equals(int.Parse(search)) || e.SecondarySkill.Equals(int.Parse(search)) || e.ThirdSkill.Equals(int.Parse(search))
                                      orderby e.PrimarySkill.Equals(int.Parse(search)),
                e.SecondarySkill.Equals(int.Parse(search)), e.ThirdSkill.Equals(int.Parse(search))
                select e;
            }

            return(View(viewModel));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Flow(int id)
        {
            var viewModel = new HomeFlowViewModel();

            viewModel.Departments = await _homeRepository.GetDeptDetails();

            if (id == 1 || id == 2 || id == 3 || id == 4)
            {
                viewModel.Departments = from e in viewModel.Departments
                                        where e.DepartmentId.Equals(id)
                                        select e;
            }
            else
            {
                return(RedirectToRoute(new { controller = "Home", action = "About" }));
            }

            return(View(viewModel));
        }