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"); } }
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"); } }
partial void UpdatePaswoord(Paswoord instance);
partial void DeletePaswoord(Paswoord instance);
partial void InsertPaswoord(Paswoord instance);