예제 #1
0
        private void btnAdmin_Click(object sender, RoutedEventArgs e)
        {
            string username   = txtUsername.Text;
            string paswoord   = txtPaswoord.Password;
            var    checkAdmin = cxt.Paswoords.Where(ap => ap.UserName == username && ap.UserPaswoord == paswoord && ap.UserId == 1).Count();

            if (checkAdmin == 1)
            {
                Paswoord    login       = cxt.Paswoords.Where(p => p.UserName == username).FirstOrDefault();
                AdminScreen adminScreen = new AdminScreen();
                adminScreen.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("You are not administrator");
            }
        }
예제 #2
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            string username = txtUsername.Text;
            string paswoord = txtPaswoord.Password;

            if (txtUsername.Text == "" || txtPaswoord.Password == "")
            {
                MessageBox.Show("Please fill in User name and Pasword ");
            }

            var checkPaswoord = cxt.Paswoords.Where(p => p.UserName == username && p.UserPaswoord == paswoord).Count();

            if (checkPaswoord == 1)
            {
                Paswoord     login        = cxt.Paswoords.Where(p => p.UserName == username).FirstOrDefault();
                ShoppingMenu shoppingMenu = new ShoppingMenu();
                shoppingMenu.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Not corect paswoord or username", "Error Box");
            }
        }
예제 #3
0
 partial void UpdatePaswoord(Paswoord instance);
예제 #4
0
 partial void DeletePaswoord(Paswoord instance);
예제 #5
0
 partial void InsertPaswoord(Paswoord instance);