Пример #1
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            AdminPanel l = new AdminPanel(session);

            l.Show();
            this.Hide();
        }
Пример #2
0
        private void logincheck()
        {
            try
            {
                Connection CN = new Connection();
                CN.thisConnection.Open();

                OracleCommand thisCommand = new OracleCommand();
                thisCommand.Connection  = CN.thisConnection;
                thisCommand.CommandText = "SELECT * FROM users WHERE username='******' AND password='******'and employeeid='" + metroTextBox1.Text + "'";

                OracleDataReader thisReader = thisCommand.ExecuteReader();

                if (thisReader.Read())
                {
                    string type = thisReader["TYPE"].ToString();
                    if (type == "Generel")
                    {
                        LeaveApp oform = new LeaveApp(thisReader["employeeid"].ToString());
                        this.Hide();
                        oform.Show();
                    }
                    else if (type == "Admin")
                    {
                        AdminPanel oform = new AdminPanel(thisReader["employeeid"].ToString());
                        this.Hide();
                        oform.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Username or Password Incorrect");
                }
                CN.thisConnection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }