//Handles insert article public void Update_Article(Object s, EventArgs e) { //Instantiate database field ArticleInfo UpdateArticle = new ArticleInfo(); UpdateArticle.ID = (int)Util.Val(Request.QueryString["aid"]); UpdateArticle.Title = Request.Form["Title"]; UpdateArticle.Content = Request.Form["Content"]; UpdateArticle.Author = Request.Form["Author"]; UpdateArticle.CatID = int.Parse(Request.Form["CAT_ID"]); UpdateArticle.Keyword = Request.Form["Keyword"]; UpdateArticle.Summary = Request.Form["Summary"]; Caching.PurgeCacheItems("Newest_Articles"); //Notify user if error occured. if (UpdateArticle.Update() != 0) { JSLiteral.Text = Util.JSProcessingErrorAlert; return; } //Release allocated memory UpdateArticle = null; //If success, redirect to article update confirmation page. Util.PageRedirect(7); Util = null; }
public void Finalize_EditSubmission(Object s, EventArgs e) { //Instantiate database field ArticleInfo EditSubmission = new ArticleInfo(); EditSubmission.ID = (int)Util.Val(Request.QueryString["aid"]); EditSubmission.Title = Request.Form["Title"]; EditSubmission.Content = Request.Form["Content"]; EditSubmission.Author = Request.Form["Author"]; EditSubmission.CatID = int.Parse(Request.Form["CAT_ID"]); EditSubmission.Keyword = Request.Form["Keyword"]; EditSubmission.Summary = Request.Form["Summary"]; //Notify user if error occured. if (EditSubmission.Update() != 0) { JSLiteral.Text = Util.JSProcessingErrorAlert; return; } Response.Redirect("articlepreview.aspx?aid=" + EditSubmission.ID); //Release allocated memory EditSubmission = null; Util = null; }