Пример #1
0
 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);
 }
Пример #2
0
        public ActionResult Add(CrueltySpotDetailModel model)
        {
            try
            {
                var crueltySpot = model.ToEntity();
                CrueltySpotService.Post(crueltySpot);
                return RedirectToAction("Index", "CrueltySpots");

            }
            catch (WebServiceException exception)
            {
                throw;
            }
        }