private void backButton_Click(object sender, EventArgs e) { pharmacist p = new pharmacist(); p.Show(); this.Hide(); }
private void pharLoginButton_Click(object sender, EventArgs e) { DB_Connect(); comm = new OracleCommand(); comm.CommandText = "select * from pharmacist where username ='******'"; comm.CommandType = CommandType.Text; ds = new DataSet(); da = new OracleDataAdapter(comm.CommandText, conn); da.Fill(ds, "pharmacist"); dt = ds.Tables["pharmacist"]; int t = dt.Rows.Count; try { dr = dt.Rows[i]; if (textBox2.Text.ToString().Equals(dr["password"].ToString())) { pharmacist pf = new pharmacist(); pf.Show(); this.Hide(); } else { MessageBox.Show("Wrong username/password"); } } catch (Exception ex) { MessageBox.Show("Wrong Username"); textBox1.Clear(); textBox2.Clear(); } //MessageBox.Show(dr["password"].ToString()); //if (textBox2.Text.ToString().Equals(dr["password"].ToString())) //{ // pharmacist pf = new pharmacist(); // pf.Show(); // this.Hide(); //} //else //{ // MessageBox.Show("Wrong username/password"); //} }