public ActionResult AddSlide(SliderArea sliderArea, int id = 0) { if (ModelState.IsValid) { if (id == 0) { if (ServiceArea.AddSlider(sliderArea)) { return(RedirectToAction("Index")); } } else { ServiceArea.UpdateSlider(sliderArea, id); return(RedirectToAction("Index")); } } if (id != 0) { SliderArea temp = db.SliderAreas.FirstOrDefault(f => f.SliderAreaId == id); return(View(temp)); } return(View()); }
public ActionResult AddSlide(SliderArea sliderArea) { ServiceArea.AddSlider(sliderArea); return(RedirectToAction("Index")); }