Esempio n. 1
0
        private void back_Click(object sender, EventArgs e)
        {
            UserPanel S = new UserPanel(ps);

            S.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void Log1_Click(object sender, EventArgs e)
        {
            string s   = textBox1.Text;
            string s2  = textBox2.Text;
            var    str = from a2 in cntx.Peoples
                         where a2.UserName == s && a2.password == s2

                         select a2;
            People pa = str.First();

            s2 = pa.password.ToString();
            string s3 = pa.UserType.ToString();


            if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Customer"))
            {
                UserPanel U = new UserPanel(s);
                U.Show();
                this.Hide();
            }

            else if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Manager"))
            {
                ManagerPanel U = new ManagerPanel(s);
                U.Show();
                this.Hide();
            }

            else if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Admin"))
            {
                Admin_Panel U = new Admin_Panel(s);
                U.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid input");
            }
        }