Ejemplo n.º 1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            pharmacist p = new pharmacist();

            p.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        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");
            //}
        }