public JsonResult DeleteWidget(string ID) { WidgetBase widget = _widgetService.Get(ID); if (widget != null) { widget.CreateServiceInstance().DeleteWidget(ID); return(Json(ID)); } return(Json(false)); }
public ActionResult Edit(WidgetBase widget, string ReturnUrl) { if (!ModelState.IsValid) { return(View(widget)); } widget.CreateServiceInstance().UpdateWidget(widget); if (!ReturnUrl.IsNullOrEmpty()) { return(Redirect(ReturnUrl)); } if (!widget.PageID.IsNullOrEmpty()) { return(RedirectToAction("Design", "Page", new { module = "admin", ID = widget.PageID })); } return(RedirectToAction("LayoutWidget", "Layout", new { module = "admin" })); }
public ActionResult Edit(WidgetBase widget, string ReturnUrl) { if (!ModelState.IsValid) { return View(widget); } widget.CreateServiceInstance().UpdateWidget(widget); if (!ReturnUrl.IsNullOrEmpty()) { return Redirect(ReturnUrl); } if (!widget.PageID.IsNullOrEmpty()) { return RedirectToAction("Design", "Page", new { module = "Common", ID = widget.PageID }); } else { return RedirectToAction("LayoutWidget", "Layout", new { module = "Common" }); } }
public ActionResult Create(WidgetBase widget, string ReturnUrl) { if (!ModelState.IsValid) { return(View(widget)); } widget.CreateServiceInstance().AddWidget(widget); if (widget.ActionType == ActionType.Continue) { return(RedirectToAction("Edit", new { widget.ID, ReturnUrl })); } else if (!ReturnUrl.IsNullOrEmpty()) { return(Redirect(ReturnUrl)); } else if (!widget.PageID.IsNullOrEmpty()) { return(RedirectToAction("Design", "Page", new { module = "Common", ID = widget.PageID })); } else { return(RedirectToAction("LayoutWidget", "Layout", new { module = "Common" })); } }
public ActionResult Create(WidgetBase widget, string ReturnUrl) { if (!ModelState.IsValid) { return View(widget); } widget.CreateServiceInstance().AddWidget(widget); if (widget.ActionType == ActionType.Continue) { return RedirectToAction("Edit", new { widget.ID, ReturnUrl }); } else if (!ReturnUrl.IsNullOrEmpty()) { return Redirect(ReturnUrl); } else if (!widget.PageID.IsNullOrEmpty()) { return RedirectToAction("Design", "Page", new { module = "Common", ID = widget.PageID }); } else { return RedirectToAction("LayoutWidget", "Layout", new { module = "Common" }); } }