示例#1
0
 public ActionResult DeletePageForm(string pageName)
 {
     if (_signInManager.IsSignedIn(User))
     {
         SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess();
         sa.DeletePage(pageName);
         return(RedirectToAction("ViewPage", new { id = "Index" }));
     }
     else
     {
         return(RedirectToAction("ViewPage", "Page"));
     }
 }
示例#2
0
 public ActionResult EditPageForm(string pageName, string HtmlEdit, string CssEdit, string JsEdit, string HeadEdit, string saveAsDraft)
 {
     if (_signInManager.IsSignedIn(User))
     {
         SqlAccess.SqlAccess sa = new SqlAccess.SqlAccess();
         string newPageName     = pageName;
         if (saveAsDraft == "Yes")
         {
             newPageName = "Draft|" + pageName;
         }
         else if (saveAsDraft == "Undraft")
         {
             newPageName = pageName.Substring(6);
             sa.DeletePage(pageName);
         }
         sa.NewPage(newPageName, HtmlEdit, CssEdit, JsEdit, HeadEdit);
         return(RedirectToAction("ViewPage", new { id = newPageName }));
     }
     else
     {
         return(RedirectToAction("ViewPage", "Page"));
     }
 }