// add customisable items to the session for the user to fill in public void addcustomisables(string article, sessioncustomisations sc) { foreach (sometext st in textparts) { st.addcustomisables(article, sc); } }
protected void Page_Load(object sender, EventArgs e) { // get the existing customisations sc = (sessioncustomisations)Session["sessioncustomisation"]; if (sc == null) { Response.Redirect("~/default.aspx", true); } if (sc.getsessioncustomisation("", "Nickname") == null) { Response.Redirect("~/default.aspx", true); } if (sc.getsessioncustomisation("", "First Name") == null) { Response.Redirect("~/default.aspx", true); } if (sc.getsessioncustomisation("", "Surname") == null) { Response.Redirect("~/default.aspx", true); } // get the layout, if there is no layout specified then redirect back to the home page spl = (sessionpagelayout)Session["sessionpagelayout"]; if (spl != null) { pl = ceddio.loadpagelayout(spl.pagelayoutfilename); } if (pl == null) { Response.Redirect("~/default.aspx", true); } // get the article index to choose from the query string try { farticleindex = Convert.ToInt16(Request.QueryString["article"]); } catch { farticleindex = 0; } // get the total number of articles farticlestotal = pl.articles.Count; // get the prompt for the current article farticleprompt = pl.articles[articleindex].prompt; farticlename = pl.articles[articleindex].name; if (Page.IsPostBack == true) { return; } DataBind(); ceddutils.databindrepeater("spArticlesGetAll", rarticles, "htsp"); }
// adds items to sc for all customisable items public void addcustomisables(string article, sessioncustomisations sc) { if (sc == null) { return; } foreach (articlepart ap in List) { ap.addcustomisables(article, sc); } }
// add custimisable items to the session object to show to the user and ask for new values public void addcustomisables(string article, sessioncustomisations sc) { foreach (paragraph p in fparagraphs) { p.addcustomisables(article, sc); } foreach (paragraph p in ffinetune) { p.addcustomisables(article, sc); } }
protected void Page_Load(object sender, EventArgs e) { // get the article index to choose from the query string try { farticleindex = Convert.ToInt16(Request.QueryString["article"]); } catch { farticleindex = 0; } // get the page layout spl = (sessionpagelayout)Session["sessionpagelayout"]; if (spl == null) { Response.Redirect("~/default.aspx", true); } pl = ceddio.loadpagelayout(spl.pagelayoutfilename); // if there is no layout specified the redirect back to the home page if (pl == null) { Response.Redirect("~/default.aspx", true); } // get the customisation scs = (sessioncustomisations)Session["sessioncustomisation"]; if (scs == null) { scs = new sessioncustomisations(); } // get all the articles and add all customisable items sas = (sessionarticles)Session["sessionarticles"]; if (sas == null) { Response.Redirect("~/default.aspx", true); } sa = sas.getarticle(pl.articles[articleindex].name); if (sa == null) { Response.Redirect("~/default.aspx", true); } if (Page.IsPostBack == false) { setuppage(); } else { savecustomisations(); } }
protected void bok_Click(object sender, EventArgs e) { // the command name is the id of the layout to choose. // command argument is the filename of layout to use sessioncustomisations sc; sc = (sessioncustomisations)Session["sessioncustomisation"]; if (sc == null) { sc = new sessioncustomisations(); } sc.addsessioncustomisation("", "Nickname", tbnickname.Text, false, true, false); sc.addsessioncustomisation("", "First Name", tbfirstname.Text, false, true, false); sc.addsessioncustomisation("", "Surname", tbsurname.Text, false, true, false); sc.setcookie(Response); Session["sessioncustomisation"] = sc; Response.Redirect("~/choose_layout.aspx"); }
protected void savecustomisations() { // get the customisation sessioncustomisations scs; scs = (sessioncustomisations)Session["sessioncustomisation"]; if (scs == null) { scs = new sessioncustomisations(); } string s; // loop form variables, look for the ones that we are after and save these for (int i = 0; i < Request.Form.Count; i++) { s = Request.Form.GetKey(i); if (s.StartsWith("htsp")) { s = s.Substring(4); scs.addsessioncustomisation(sa.articlefilename, s, Request.Form[i], true, true, false); } } // save these values in a cookie and in the session scs.setcookie(Response); Session["sessioncustomisation"] = scs; if (Request.QueryString["return"] == "true") { Response.Redirect("~/review.aspx"); } // otherwise if we have finished choosing articles go on to customise them else if (articleindex >= pl.articles.Count - 1) { Response.Redirect("~/choose_pictures.aspx"); } // otherwise choose the next article else { Response.Redirect("~/customise_articles.aspx?article=" + (articleindex + 1).ToString()); } }
// adds customisable items to the session to be filled in by the user public override void addcustomisables(string article, sessioncustomisations sc) { sc.addsessioncustomisation(article, prompt, finitialtext, true, false, true); }
// customises customisable text in the article with the passed customisations public override void customise(string article, sessioncustomisations sc) { fcurrenttext = sc.customise(article, prompt, finitialtext); }
// adds customisable items to the session for the user to change public virtual void addcustomisables(string article, sessioncustomisations sc) { }
// customises customisable text in the article with the passed customisations public virtual void customise(string article, sessioncustomisations sc) { }