示例#1
0
        public bool SaveAgencyType(AgencyTypeVM model)
        {
            var agencyType = new AgencyType()
            {
                Description = model.Description
            };

            _context.AgencyTypes.Add(agencyType);
            _context.SaveChanges();
            return(true);
        }
示例#2
0
 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);
 }
示例#3
0
 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"));
 }
示例#4
0
 public bool UpdateAgencyType(AgencyTypeVM model)
 {
     return(_adminRepository.UpdateAgencyType(model));
 }
示例#5
0
 public bool SaveAgencyType(AgencyTypeVM model)
 {
     return(_adminRepository.SaveAgencyType(model));
 }