using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using ButterfieldGardens.Web; public partial class admin_index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session["USERID"] == null) { Response.Redirect("/admin/"); } Navigation objNav = new Navigation(); header.InnerHtml = objNav.GetAdminHeader(); adminNav.InnerHtml = objNav.GetAdminSubNavMenu("password"); footer.InnerHtml = objNav.GetFooter(false, false); } protected void ProcessPassword(object sender, EventArgs e) { if (ValidateForm()) { cUserDAO objUserDAO = new cUserDAO(); objUserDAO.ChangePassword(Session["USERID"].ToString(), txtNew.Text); Response.Redirect("/admin/dashboard.aspx"); } else { Literal lit = new Literal(); lit.Text = "You must provide all required information. Please try again."; lblError.Controls.Add(lit); lblError.CssClass = "error"; lblError.Visible = true; } } private Boolean ValidateForm() { Boolean returnVal = true; if (txtNew.Text.Equals("")) { returnVal = false; } if (txtRepeat.Text.Equals("")) { returnVal = false; } if (!txtNew.Text.Trim().Equals(txtRepeat.Text.Trim())) { returnVal = false; } return returnVal; } }