protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RegistrationDAO registerDAO = new RegistrationDAO(); BPositiveGrid.DataSource = registerDAO.ShowListByBloodGroup("B+"); BPositiveGrid.DataBind(); } }
public ActionResult ProcessRegistration(UserModel userModel) { //save to db if (userModel != null) { RegistrationDAO registraionDAO = new RegistrationDAO(); registraionDAO.CreateRegistration(userModel); return(View("ProcessRegistration", userModel)); } else { return(View("no value added")); } }
protected void LoginButton_Click(object sender, EventArgs e) { RegistrationDAO registrationDAO = new RegistrationDAO(); string LoginEmail = LoginEmailText.Text; string LoginPassword = LoginPassText.Text; int temp = registrationDAO.CheckExistingMember(LoginEmail); if (temp == 1) { //user exists string DBPassword = registrationDAO.CheckLogin(LoginEmail); if (LoginPassword == DBPassword) { if (LoginEmail == "Admin") { Session["Admin"] = "Admin"; Panel3.Visible = true; Panel1.Visible = false; Panel2.Visible = false; // Response.Write("Password is correct"); } else { Session["New"] = registrationDAO.GetNameAfterLogin(LoginEmail); Session["Email"] = LoginEmail; Session["Password"] = LoginPassword; Session["ID"] = registrationDAO.GetIDAfterLogin(LoginEmail); //Response.Write("Password is correct"); //Response.Redirect("Account_Pages/Profile.aspx"); Response.Redirect("Home.aspx"); } } else { PassLabel.Text = "Password is incorrect"; //Response.Write("Password is incorrect"); } } }
protected void SubmitButton_Click(object sender, EventArgs e) { if (memberExists == false) { RegistrationDAO registrationDao = new RegistrationDAO(); string name = NameText.Text; string email = EmailText.Text; string password = PasswordText.Text; string district = DistrictList.Text; string bloodGroup = GroupList.Text; string contactNo = ContactNoText.Text; int DonorID = registrationDao.CreateMember(new RegistrationDTO(name, email, password, district, bloodGroup, contactNo)); Response.Write("Your Registration is Successful"); registrationDao.InsertDonorIDinOtherTables(DonorID); Response.Redirect("Home.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { RegistrationDAO registrationDao = new RegistrationDAO(); memberExists = false; if (IsPostBack) { string email = EmailText.Text; int temp = registrationDao.CheckExistingMember(email); if (temp == 1) { Response.Write("User Already Exists"); memberExists = true; } } }
protected void UpdateButton_Click(object sender, EventArgs e) { //string OldPassword=Session["Password"]; RegistrationDAO registrationDAO = new RegistrationDAO(); string OldPassword = Session["Password"].ToString(); string checkOldPass = OldPassBox.Text; string newPassword = NewPassBox.Text; string retypePassword = ReTypePassBox.Text; if (OldPassword == checkOldPass && newPassword == retypePassword) { string email = Session["Email"].ToString(); registrationDAO.UpdatePassword(new RegistrationDTO(email, newPassword)); //Response.Write("Password changed successfully"); ResponseLabel.Text = "Password changed successfully"; } Session["Email"] = Session["Email"].ToString(); }