protected void Button1_Click(object sender, EventArgs e) { tblUser.Fill(ds1.UserInfo); cardNumber = Session["cardNumber"].ToString(); DataRow[] dr = ds1.UserInfo.Select("Card_Number = '" + cardNumber + "'"); dr[0]["Email"] = TextBox1.Text; dr[0]["Phone_Number"] = TextBox2.Text; dr[0]["Address"] = TextBox3.Text; tblUser.Update(ds1.UserInfo); ds1.AcceptChanges(); // tblUser.Transaction.Commit(); }
protected void btnYes_Click(object sender, EventArgs e) { //delete user info from table. string cardNumber = Session["cardNumber"].ToString(); tblUser.Fill(ds1.UserInfo); DataRow[] dr = ds1.UserInfo.Select("Card_Number = '" + cardNumber + "'"); dr[0].Delete(); tblUser.Update(dr); string script = "<script>alert('Your account has been deleted.' );</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", script); Response.Redirect("Login.aspx"); }
protected void btnOkay_Click(object sender, EventArgs e) { //change password: update user table with new password tblUser.Fill(ds1.UserInfo); string cardNumber = Session["cardNumber"].ToString(); DataRow[] dr = ds1.UserInfo.Select("Card_Number = '" + cardNumber + "'"); dr[0]["Password"] = txtConfirmPassword.Text; tblUser.Update(ds1); string script = "<script>alert('Your password has been changed');</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", script); Response.Redirect("Main.aspx"); }
protected void btnCreateAcc_Click(object sender, EventArgs e) { tblUser.Fill(ds1.UserInfo); DataSet1.UserInfoRow row = ds1.UserInfo.NewUserInfoRow(); row.Name = txtName.Text; row.Email = txtEmail.Text; row.Phone_Number = txtPhone.Text; row.Address = txtAddress.Text; row.Card_Number = txtCardNum.Text; row.Pin = txtPin.Text; row.password = txtPass.Text; ds1.UserInfo.Rows.Add(row); tblUser.Update(ds1.UserInfo); Label1.Text = "Account created Successfully... Redirecting to login page............"; Response.Redirect("Login.aspx"); }