Пример #1
0
 public ActionResult Edit(SubSpecialityViewModel model)
 {
     if (ModelState.IsValid)
     {
         var subSpeciality = _subSpecialityService.GetSubSpecialitybyId(model.Id);
         subSpeciality.Name         = model.Name;
         subSpeciality.DisplayOrder = model.DisplayOrder;
         subSpeciality.IsActive     = model.IsActive;
         subSpeciality.SpecialityId = model.SpecialityId;
         _subSpecialityService.UpdateSubSpeciality(subSpeciality);
         return(RedirectToAction("List"));
     }
     return(View(model));
 }
Пример #2
0
 public ActionResult Edit(SubSpecialityViewModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var subSpeciality = _subSpecialityService.GetSubSpecialitybyId(model.Id);
             subSpeciality.Name         = model.Name;
             subSpeciality.DisplayOrder = model.DisplayOrder;
             subSpeciality.IsActive     = model.IsActive;
             subSpeciality.SpecialityId = model.SpecialityId;
             _subSpecialityService.UpdateSubSpeciality(subSpeciality);
             SuccessNotification("sub speciality updated successfully.");
             return(RedirectToAction("List"));
         }
         return(View(model));
     }
     catch { throw; }
 }