public bool savePagePivot(string pName, string pCode, string pId, string pContent, string pType, string pDefault, string un, string token) { if (isValidUser(un, token)) { PivotCardService.PivotData p = new PivotCardService.PivotData(); p.PivotCode = pCode; if (pId == "null") { pId = genID().ToString(); } p.PivotId = pId; if (pType == "pl") { p.PivotContent = PCDecode(pContent); } else { p.PivotContent = pContent; } p.PivotType = pType; p.PivotDefault = pDefault; return(PivotCardService.PivotData.savePivot(pName, p)); } else { return(false); } }
protected void Page_Load(object sender, EventArgs e) { string pCode = "", pName = ""; bool defaultVal; defaultVal = false; pName = Page.RouteData.Values["pivotname"] as string; pCode = Page.RouteData.Values["pivotcode"] as string; if (pCode == null) { defaultVal = true; } string redirPth = ""; string pageContent = ""; try { if (PivotCardService.UserData.checkPivot(pName)) { PivotCardService.PivotData p = PivotCardService.PivotData.getPivotRedir(pName, pCode, defaultVal); if (p.PivotType == "pl") { redirPth = p.PivotContent; } else { Title = pName + " - " + p.PivotCode; pageContent = p.PivotContent; } } else { redirPth = "~/error.aspx"; } } catch (Exception exp) { redirPth = "~/error.aspx"; } //} if (redirPth != "") { Response.Redirect(redirPth); } else if (pageContent != "") { pivotPageMain.InnerHtml = pageContent; } else { Response.Redirect("~/error.aspx"); } }