コード例 #1
0
        public JsonResult DeleteWidget(string ID)
        {
            WidgetBase widget = _widgetService.Get(ID);

            if (widget != null)
            {
                widget.CreateServiceInstance().DeleteWidget(ID);
                return(Json(ID));
            }
            return(Json(false));
        }
コード例 #2
0
 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" }));
 }
コード例 #3
0
 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" });
     }
 }
コード例 #4
0
 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" }));
     }
 }
コード例 #5
0
 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" });
     }
 }