public ActionResult Create(SubSpecialityViewModel model) { if (ModelState.IsValid) { var subSpeciality = new SubSpeciality { Name = model.Name, DisplayOrder = model.DisplayOrder, IsActive = model.IsActive, SpecialityId = model.SpecialityId }; _subSpecialityService.AddSubSpeciality(subSpeciality); return(RedirectToAction("List")); } model.AvailableSpeciality = GetSpecialityList(); return(View(model)); }
public ActionResult Create(SubSpecialityViewModel model) { try { if (ModelState.IsValid) { var subSpeciality = new SubSpeciality { Name = model.Name, DisplayOrder = model.DisplayOrder, IsActive = model.IsActive, SpecialityId = model.SpecialityId }; _subSpecialityService.AddSubSpeciality(subSpeciality); SuccessNotification("sub speciality added successfully."); return(RedirectToAction("List")); } model.AvailableSpeciality = GetSpecialityList(); return(View(model)); } catch { throw; } }