protected void UniqueEmail_ServerValidate(object source, ServerValidateEventArgs args) { CustomerStuff objCustomer = new CustomerStuff(); objCustomer.EmailAddr = EmailAddr.Text; objCustomer.MemberID = Session["LoginID"].ToString(); if (objCustomer.checkEmail() == 1) { args.IsValid = true; } else if (EmailAddr.Text == "") { args.IsValid = true; } else { args.IsValid = false; } }
protected void UniquePhoneNum_ServerValidate(object source, ServerValidateEventArgs args) { CustomerStuff objCustomer = new CustomerStuff(); objCustomer.PhoneNum = PhoneNum.Text; objCustomer.MemberID = Session["LoginID"].ToString(); if (objCustomer.checkPhoneNum() == 1) { args.IsValid = true; } else if (PhoneNum.Text == "") { args.IsValid = true; } else { args.IsValid = false; } }
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { CustomerStuff objCustomer = new CustomerStuff(); objCustomer.PassWord = NewPass.Text; objCustomer.MemberID = Session["LoginID"].ToString(); int errorCode = objCustomer.changePassWord(); if (errorCode == 0) { Response.Redirect("UpdateCustomer.aspx"); } else { Message.Text = "Update was unsuccessful, did you key in the right details?"; } } }
protected void SaveChanges_Click(object sender, EventArgs e) { if (Page.IsValid) { CustomerStuff objCustomer = new CustomerStuff(); objCustomer.ResidentialAddr = ResidentialAddr.Text; objCustomer.PhoneNum = PhoneNum.Text; objCustomer.EmailAddr = EmailAddr.Text; objCustomer.MemberID = Session["LoginID"].ToString(); int errorCode = objCustomer.ConfirmAdd(); if (errorCode == 0) { Response.Redirect("Profile.aspx"); } else { Message.Text = "Update was unsuccessful, did you key in the right details?"; } } }