public bool SaveAgencyType(AgencyTypeVM model) { var agencyType = new AgencyType() { Description = model.Description }; _context.AgencyTypes.Add(agencyType); _context.SaveChanges(); return(true); }
public bool UpdateAgencyType(AgencyTypeVM model) { if (model.AgencyTypeId != 0) { var agencyType = _context.AgencyTypes.Single(p => p.AgencyTypeId == model.AgencyTypeId); agencyType.Description = model.Description; _context.SaveChanges(); return(true); } return(false); }
public ActionResult UpdateAgencyType(AgencyTypeVM model) { if (ModelState.IsValid) { bool result = _adminService.UpdateAgencyType(model); if (result) { TempData["SuccessMessage"] = "Agency Type updated successfully."; return(RedirectToAction("AgencyType")); } } TempData["ErrorMessage"] = "Agency Type not updated."; return(RedirectToAction("EditAgencyType")); }
public bool UpdateAgencyType(AgencyTypeVM model) { return(_adminRepository.UpdateAgencyType(model)); }
public bool SaveAgencyType(AgencyTypeVM model) { return(_adminRepository.SaveAgencyType(model)); }