private void buttonEmployeeHomePage(object sender, RoutedEventArgs e)
        {
            this.Hide();
            employeeHomePage h = new employeeHomePage();

            h.Show();
        }
Esempio n. 2
0
 private void buttonCancel(object sender, RoutedEventArgs e)
 {
     if (b == 1)
     {
         this.Hide();
         Home h = new Home();
         h.Show();
     }
     if (b == 2)
     {
         this.Hide();
         employeeHomePage h = new employeeHomePage();
         h.Show();
     }
 }
        private void login(object sender, RoutedEventArgs e)
        {
            string str1 = username.Text;
            string str2 = pass.Password;

            connection();
            string            strsql = "select designation from employee where employee_id =" + str1 + "and password ="******"'" + str2 + "'";
            OracleDataAdapter da1    = new OracleDataAdapter(strsql, con);
            DataSet           ds1    = new DataSet();

            da1.Fill(ds1, "set");
            DataTable dt1 = new DataTable();

            dt1 = ds1.Tables[0];
            if (dt1.Rows.Count == 0)
            {
                MessageBox.Show("Invalid credentials", "ERROR");
                username.Text = "";
                pass.Password = "";
            }
            else
            {
                string desig = dt1.Rows[0]["designation"].ToString();
                if (desig == "receptionist")
                {
                    this.Hide();
                    Home h = new Home();
                    h.Show();
                }
                else if (desig == "employee")
                {
                    this.Hide();
                    employeeHomePage h = new employeeHomePage();
                    h.Show();
                }
                else
                {
                    this.Hide();
                    manager h = new manager();
                    h.Show();
                }
            }
        }