//Get: UtilityCompany/Delete public ActionResult Delete(int id) { var service = new UtilityCompanyService(); var utilityCompany = service.GetUtilityCompany(id); return(View(utilityCompany)); }
//Get: Company/Detail/{id} public ActionResult Details(int id) { var service = new UtilityCompanyService(); var utilityName = service.GetUtilityCompany(id); return(View(utilityName)); }
public ActionResult DeletePost(int id) { var service = new UtilityCompanyService(); if (service.DeleteUtilityCompany(id)) { TempData["SaveResult"] = "Utility Company Deleted"; return(RedirectToAction("Index")); } ModelState.AddModelError("", "Utility Company could not be updated"); var model = service.GetUtilityCompany(id); return(View(model)); }
//Get: Company/Edit/{id} public ActionResult Edit(int id) { var service = new UtilityCompanyService(); var detail = service.GetUtilityCompany(id); var model = new UtilityCompanyEdit { UtilityCompanyId = detail.UtilityCompanyId, UtilityName = detail.UtilityName, Website = detail.Website, UserLogin = detail.UserLogin, UserPassword = detail.UserPassword, PhoneNumber = detail.PhoneNumber }; return(View(model)); }