protected void btn_add_Click1(object sender, EventArgs e) { try { tbl_user_BAL objbal = new tbl_user_BAL(); cryptography objcrypt = new cryptography(); string query = "where str_email='" + txt_user_name.Text + "'"; DataSet ds = objbal.getdata(query); if (ds.Tables[0].Rows.Count > 0) { string str = objcrypt.Decrypt(ds.Tables[0].Rows[0]["str_password"].ToString()); //int cnt = Convert.ToInt16(ds.Tables[0].Rows[0]["int_user_id"]); if (str.Equals(txt_password.Text)) { Session["uname"] = txt_user_name.Text; Session["uid"] = ds.Tables[0].Rows[0]["int_user_id"]; Session["unm"] = ds.Tables[0].Rows[0]["str_user_name"]; Session["add"] = ds.Tables[0].Rows[0]["str_address"]; Session["con"] = ds.Tables[0].Rows[0]["int_contact"]; Session["email"] = ds.Tables[0].Rows[0]["str_email"]; Response.Redirect("inquiry_page.aspx"); } } } catch (Exception ex) { } }
public void binddata(string query) { try { tbl_user_BAL objbal = new tbl_user_BAL(); DataSet ds = objbal.getdata(query); gvlist.DataSource = ds; gvlist.DataBind(); } catch (Exception ex) { } }
public void binddata(string query) { tbl_user_BAL objbal = new tbl_user_BAL(); DataSet ds = objbal.getdata(query); //DataBind(); lblname.Text = Session["unm"].ToString(); lbladd.Text = Session["add"].ToString(); lblcont.Text = Session["con"].ToString(); lblemail.Text = Session["email"].ToString(); }
protected void btn_login_Click(object sender, EventArgs e) { try { tbl_user_BAL objbal = new tbl_user_BAL(); cryptography objcrypt = new cryptography(); string query = "where str_email='" + txt_user_name.Text + "'"; DataSet ds = objbal.getdata(query); if (ds.Tables[0].Rows.Count > 0) { string str = objcrypt.Decrypt(ds.Tables[0].Rows[0]["str_password"].ToString()); //int cnt = Convert.ToInt16(ds.Tables[0].Rows[0]["int_user_id"]); if (str == txt_password.Text) { if (str.Equals(txt_password.Text)) { Session["uname"] = txt_user_name.Text; Session["uid"] = ds.Tables[0].Rows[0]["int_user_id"]; Session["unm"] = ds.Tables[0].Rows[0]["str_user_name"]; Session["add"] = ds.Tables[0].Rows[0]["str_address"]; Session["con"] = ds.Tables[0].Rows[0]["int_contact"]; Session["email"] = ds.Tables[0].Rows[0]["str_email"]; Response.Redirect("user_profile.aspx"); } } else { lblmsg.Text = "wrong emailid and password ..try again..."; lblmsg.ForeColor = System.Drawing.Color.Red; } } else { lblmsg.Text = "wrong emailid and password ..try again..."; lblmsg.ForeColor = System.Drawing.Color.Red; } } catch (Exception ex) { } }