Exemple #1
0
        private void btnlog_Click(object sender, EventArgs e)
        {
            try
            {
                con.connection();
                con.qurry("select * from log where UserName='******';");

                con.ad();
                String id = "";
                String pw = "";



                id = con.dt.Rows[0][2].ToString();
                pw = con.dt.Rows[0][1].ToString();
                con.dt.Clear();
                con.conclose();



                if (pw.Equals(txtp.Text))
                {
                    if (id.Equals("1"))
                    {
                        this.Hide();
                        admin a = new admin();
                        a.Show();
                    }
                    else
                    {
                        this.Hide();
                        home h = new home();
                        h.Show();
                    }
                }
                else
                {
                    ep_w.Clear();

                    ep_w.SetError(txtp, "enter correct password");
                }
            }



            catch (Exception)
            {
                ep_w.Clear();
                ep_w.SetError(txtu, "enter correct username");
                ep_w.SetError(txtp, "enter correct password");
                // MessageBox.Show("Check Your Username or Password");
            }
        }
Exemple #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            home h1 = new home();

            h1.Show();
        }