Ejemplo n.º 1
0
        private void btnlogin_Click(object sender, RoutedEventArgs e)
        {
            try {
                string myConnection = "datasource=localhost;port=3306;username=root;password="******"select * from coffeeshopms.userinfo where username='******' and password='******' ;", mySqlConnection);
                MySqlDataReader myReader;


                mySqlConnection.Open();
                myReader = SelectCommand.ExecuteReader();


                if (myReader.Read())
                {
                    MessageBox.Show("Username and Password is correct!");
                    hw = new HomeWindow(this);
                    hw.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("invalid username or password!");
                }
                mySqlConnection.Close();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
 void DataWindow_Closing(object sender, CancelEventArgs e)
 {
     if (hw != null)
     {
         hw.Close();
         hw = null;
     }
 }
 public EmployeeWindow(HomeWindow passedwindow, MainWindow login)
 {
     InitializeComponent();
     this.hw = passedwindow;
     this.mw = login;
 }
 public CustomerWIndow(HomeWindow passedwindow, MainWindow login)
 {
     InitializeComponent();
     this.hw = passedwindow;
     this.mw = login;
 }
 public CoffeeWindow(HomeWindow passedwindow)
 {
     InitializeComponent();
     this.hw = passedwindow;
 }