Beispiel #1
0
        public void get3()
        {
            DataStoreAccess ds = new DataStoreAccess();


            Assert.AreEqual("staff", ds.get_role("*****@*****.**"));

            //   public string getemp_id(int user_id)
        }
Beispiel #2
0
        public void get4()
        {
            DataStoreAccess ds = new DataStoreAccess();


            Assert.AreEqual("manager", ds.get_role("*****@*****.**"));

            //   public string getemp_id(int user_id)
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataStoreAccess da = new DataStoreAccess();

            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("Enter All Fields");
            }
            else
            {
                email = textBox1.Text;
                string role = da.get_role(email);
                //  MessageBox.Show(role);
                string Password = textBox2.Text;

                string p2 = da.get_pass(email);

                if (p2 != null)
                {
                    //check for the both passwords are same
                    if (Password == encrypt.Decrypt(p2))
                    {
                        emp_id = da.get_emp(email);
                        if (role == "staff")
                        {
                            Staff s = new Staff();
                            s.Show();
                            this.Hide();
                        }
                        if (role == "manager")
                        {
                            Manager m = new Manager();
                            m.Show();
                            this.Hide();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Wrong Password");
                    }
                }
            }
        }