// ------------------------ BasePage.PageLoad ------------------------ public void PageLoad(object sender, System.EventArgs e) { if (Page.IsPostBack == false) { string LoadId = LoadMaster.NewPage(this, PageTitle); ViewState["LoadId"] = LoadId; Trace.Write("PageLoad. LoadId", ViewState["LoadId"].ToString( )); } }
// --------------------- BasePage.ReturnLinkClickHandler ------------------ // return to referrer page link click handler. public void ReturnLinkClickHandler(System.Web.UI.WebControls.LinkButton InLink) { if (InLink.Visible == true) { LoadMaster lm = PageReferrerLoadMaster; if (lm != null) { Response.Redirect(lm.RawUrl); } } }
// ----------------------- BasePage.ReturnLinkSetup -------------------- // enable and setup the text of the return to referrer link. public void ReturnLinkSetup(System.Web.UI.WebControls.LinkButton InLink) { LoadMaster lm = PageReferrerLoadMaster; if (lm == null) { InLink.Visible = false; } else { InLink.Visible = true; InLink.Text = "back to " + lm.PageTitle; } }
// ------------------------ LoadMaster.NewPage -------------------------- public static string NewPage(AutoCoder.BasePage InPage, string InPageTitle) { LoadMaster lm = new LoadMaster( ); lm.RawUrl = InPage.Request.RawUrl; lm.PageTitle = InPageTitle; try { lm.Add(InPage); } // catch the add exception. ( probably the table does not exist. ) If the LoadMaster // table does not exist, try to create it, then try the add again. catch (SqlException excp) { if (AutoCoder.Common.IsObjectNotFoundExcp(excp) == false) { throw(excp); } LoadMaster.CreateTable(InPage); lm.Add(InPage); } return(lm.LoadId); }