public EmployeeInformation Search(string name) { var result = GenericFunc.regexChecker(name); if (result != null) { return(_eManager.Search(result)); } else { throw new Exception("please enter valid name"); } }
// company directory displays all the results public IActionResult Directory(string empSearch) { var user = userId(); var employees = _employee.Print(user); if (employees.Count == 0) { ViewBag.display = "not-disp"; return(View(employees)); } if (empSearch != null) { ViewBag.display = "disp"; var updatedLists = _employee.Search(empSearch, user); return(View(updatedLists)); } else { ViewBag.display = "disp-full"; return(View(employees)); } }