public ActionResult NewEmployeeLookup(string workerId, string hireType) { ViewBag.WorkerIDHelp = PowerShell.GetHTMLString("NewHires", "WorkerIDHelp", null); ViewBag.HireTypeGuidelines = PowerShell.GetHTMLString("NewHires", "HireTypeGuidelines", null); if (String.IsNullOrWhiteSpace(workerId)) { ModelState.AddModelError("WorkerID", "Worker ID Required"); return(View(NewHire.EmployeeHireTypes())); } NewHire employee = NewHire.EmployeeLookup(workerId, hireType, db); if (employee == null) { ModelState.AddModelError("WorkerID", "Workday Lookup Error"); return(View(NewHire.EmployeeHireTypes())); } if (employee.EmailAddress == null) { employee.SetEmailAddress(); } ViewBag.Countries = db.Countries.Select(x => x.Name).Distinct(); ViewBag.Offices = Office.GetOfficeNames(employee.Country, db); ViewBag.O365Profiles = O365Profile.GetSelectList(); ViewBag.O365ProfileDetails = PowerShell.GetHTMLString("NewHires", "O365ProfileDetails", null); return(View("NewEmployee", employee)); }
public ActionResult NewEmployeeLookup() { ViewBag.WorkerIDHelp = PowerShell.GetHTMLString("NewHires", "WorkerIDHelp", null); ViewBag.HireTypeGuidelines = PowerShell.GetHTMLString("NewHires", "HireTypeGuidelines", null); return(View(NewHire.EmployeeHireTypes())); }