public ActionResult Add() { var model = new OrganizationDetailModel(); var allStateProvinces = StateProvincesService.Get(new StateProvinces()).StateProvinces; model.AllStateProvinces = new SelectList(allStateProvinces, "Id", "Name"); var allCategories = OrganizationCategoriesService.Get(new OrganizationCategories()).OrganizationCategories; model.AllOrganizationCategories = new SelectList(allCategories, "Id", "Name"); return View(model); }
public ActionResult Add(OrganizationDetailModel model) { try { var org = model.ToEntity(); OrganizationService.Post(org); return RedirectToAction("Index", "Organizations"); } catch (WebServiceException exception) { throw; } }