public JsonResult AddSection(int pageId, int pageSectionTypeId, string componentStamp) { try { var pageAssociation = _sectionService.Add(pageId, pageSectionTypeId, componentStamp); return(Json(new { State = true, PageSectionId = pageAssociation.PageSection.PageSectionId, PageAssociationId = pageAssociation.PageAssociationId })); } catch (Exception) { return(Json(new { State = false })); } }
public JsonResult Add(int pageId, int pageSectionTypeId, string componentStamp) { try { var pageSectionId = _pageSectionService.Add(pageId, pageSectionTypeId, componentStamp); return(new JsonResult { Data = pageSectionId }); } catch (Exception ex) { return(Json(new { State = false, ex.InnerException.Message })); } }
public ActionResult Add(AddViewModel model) { _pageSectionService.Add(model.PageId, model.PageSectionTypeId); return(Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri)); }