protected void btnsubmit_Click(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Username = txtemail.Text; usr.Password = txtregisterpassword.Text; string szID = usr.CheckLogin(usr); if (szID == "1") { Session["USERNAME"] = usr.Username; Session["USERID"] = usr.UserID; Response.Redirect("~/User/UserProfile.aspx"); } else { } }
protected void insert(object sender, EventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Lname= txtfirst.Text; usr.Fname = txtlast.Text; usr.Username = txtemail.Text; usr.Password = txtpassword.Text; string szID = usr.CheckLogin(usr); if (szID == "0") { usr.RegisterUser(usr); Response.Redirect("login.aspx"); } else { lblemail.Text = "Email found"; } }
protected void btnregistersubmit_Click(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Lname = txtfirst.Text; usr.Fname = txtlast.Text; usr.Username = txtemails.Text; usr.Password = txtpasswords.Text; string szID = usr.CheckLogin(usr); if (szID == "0") { usr.RegisterUser(usr); Response.Redirect("~/Default2.aspx"); } else { // lblemail.Text = "Email found"; } }
protected void btnupdate_Click(object sender, EventArgs e) { Security.UserInfo usr = new Security.UserInfo(); try { string email = Session["USERNAME"].ToString(); usr.Username = email; usr.Password = txtold.Text; string update = usr.CheckLogin(usr); if (update == "1") { usr.Password = txtnew.Text; update=usr.UpdateUserInfoEmail(usr); } } catch (Exception ex) { // prevent the exception from propagating, but return false to // signal the error ex.ToString(); } }