protected void Page_Load(object sender, EventArgs e) { DBconnection dbg = new DBconnection(); string q = "Select * from UserInfo where UserEmail='" + SignIn.ema + "'"; DataTable dt = dbg.getData(q); ab = Convert.ToInt32(dt.Rows[0]["UserID"]); lblName.Text = dt.Rows[0]["UserName"].ToString(); lblPhone.Text = dt.Rows[0]["UserPhone"].ToString();; lblEmail.Text = dt.Rows[0]["UserEmail"].ToString();; lblDOB.Text = dt.Rows[0]["UserDob"].ToString();; DBconnection dba = new DBconnection(); string ageq = "Select DATEDIFF(YY,UserDob,GETDATE()) From UserInfo where UserEmail='" + lblEmail.Text + "'"; DataTable dta = dba.getData(ageq); lblAge.Text = dta.Rows[0][0].ToString(); }
protected void btnSignIn_Click(object sender, EventArgs e) { ema = tbEmail.Text; DBconnection dbcd = new DBconnection(); string q = "Exec sp_FindAccount @em='" + tbEmail.Text + "', @pa='" + tbPass1.Text + "'"; bool avlbl = dbcd.checkData(q); if (avlbl == true) { Response.Write("<script>alert('Login successful!')</script>"); Response.Redirect("GetLoan.aspx"); } else { Response.Write("<script>alert('Invalid credentials provided')</script>"); } }
protected void btnShow_Click(object sender, EventArgs e) { DBconnection dbv = new DBconnection(); string query; if (ddOptions.SelectedValue == "UserAccounts") { query = "Select UserID, UserName,UserEmail,UserDob,UserPhone from UserInfo"; } else { query = "Select * from Loans"; } DataTable dtr = dbv.getData(query); dgvRecords.DataSource = dtr; dgvRecords.DataBind(); }