public JsonResult Add(AddOrganisationViewModel model) { string message = string.Empty; OrganisationsViewModel orgModel = new OrganisationsViewModel(); try { var organisation = PopulateOrganisationFromViewModel(model); organisationService.AddOrganisation(organisation); orgModel.Organisations = organisationService.GetOrganisationsByCompanyId(SocialPipelineUser.CompanyId); } catch (UnableToAddOrganisationException exception) { message = "There was an issue registering this new organisation"; } return Json(new { Html = this.RenderPartialView("_Organisations", orgModel), Message = message }, JsonRequestBehavior.AllowGet); }
public ActionResult Index() { OrganisationsViewModel model = new OrganisationsViewModel(); model.Organisations = organisationService.GetOrganisationsByCompanyId(SocialPipelineUser.CompanyId); return View(model); }