public async Task <IActionResult> Details(int id) { Firm item = await FirmRepo.Find(id); if (item == null) { return(RedirectToAction("Index")); } return(View(item)); }
public async Task <IActionResult> Delete(int id) { Firm firm = await FirmRepo.Find(id); if (firm == null) { return(RedirectToAction("Index")); } return(View(firm)); }
public async Task <IActionResult> Edit(int id) { Firm model = await FirmRepo.Find(id); if (model == null) { return(RedirectToAction("Index")); } return(View(model)); }
public async Task <IActionResult> DeleteConfirmed(int id) { Firm firm = await FirmRepo.Find(id); if (firm == null) { return(RedirectToAction("Index")); } await FirmRepo.Remove(id); return(RedirectToAction("Index")); }
public async Task <IActionResult> Edit(int id, Firm item) { Firm firm = await FirmRepo.Find(id); if (firm != null && ModelState.IsValid) { await FirmRepo.Update(item); return(RedirectToAction("Details", new { id = firm.Id })); } return(View(firm)); }
public async Task <IActionResult> Employees(int id) { List <Employee> employeeList = await EmployeeRepo.GetFirmEmployees(id); Firm firm = await FirmRepo.Find(id); FirmEmployeesViewModel firmEmployeesViewModel = new FirmEmployeesViewModel() { Employees = employeeList, PageTitle = firm.Name + "'s Employees", Id = firm.Id }; return(View(firmEmployeesViewModel)); }