public ActionResult Add() { var model = new CrueltySpotDetailModel(); var allStateProvinces = StateProvincesService.Get(new StateProvinces()).StateProvinces; model.AllStateProvinces = new SelectList(allStateProvinces, "Id", "Name"); var allCategories = CrueltySpotCategoriesService.Get(new CrueltySpotCategories()).CrueltySpotCategories; model.AllCrueltySpotCategories = new SelectList(allCategories, "Id", "Name"); return View(model); }
public ActionResult Add(CrueltySpotDetailModel model) { try { var crueltySpot = model.ToEntity(); CrueltySpotService.Post(crueltySpot); return RedirectToAction("Index", "CrueltySpots"); } catch (WebServiceException exception) { throw; } }