public bool ChangePassword(Query_DB cdb) { bool temp = false; string query = string.Format("update Admin set [Password]='{0}' where [ID]={1}", cdb.PASSWORD, cdb.ID); if (bl.NonQuery(query) == 1) { temp = true; } return(temp); }
public bool VerifyUser(Query_DB qdb) { bool temp = false; string query = string.Format("select count(*) from Admin where Email='{0}' and Password = '******'", qdb.EMAIL, qdb.PASSWORD); OleDbDataReader rec = bl.SelectQuery(query); while (rec.Read()) { if (rec[0].ToString().Equals("1")) { temp = true; } } return(temp); }
private void button1_Click(object sender, EventArgs e) { qd.EMAIL = Email.Text; qd.PASSWORD = Password.Text; if (qd.VerifyUser(qd)) { qd = qd.GetUserDetails(qd); DeshBoard ad = new DeshBoard(qd); ad.Show(); Email.Text = ""; Password.Text = ""; Wrong.Text = ""; } else { Wrong.Text = "** Wrong Username OR Password **"; } }
public Query_DB GetUserDetails(Query_DB cdb) { string query = string.Format("select ID,Email,Password,Type from Admin where Email='{0}' and Password = '******'", cdb.EMAIL, cdb.PASSWORD); OleDbDataReader rec = bl.SelectQuery(query); while (rec.Read()) { if (!rec[0].ToString().Equals(" ") && Convert.ToInt32(rec[0].ToString()) >= 1) { Query_DB utb = new Query_DB(); utb.ID = Convert.ToInt32(rec[0].ToString()); utb.EMAIL = rec[1].ToString(); utb.PASSWORD = rec[2].ToString(); utb.TYPE = Convert.ToInt32(rec[3].ToString()); return(utb); } } return(null); }
public DeshBoard(Code.Query_DB qd) { InitializeComponent(); pb = qd; }
public ChangePassword(Code.Query_DB qdb) { InitializeComponent(); qd = qdb; }