private void Sotr(object sender, RoutedEventArgs e) { if (txt_Логин.Text == "2" && txt_Пароль.Password == "2") { MessageBox.Show("Всё заполнено", "Успешно", MessageBoxButton.OK, MessageBoxImage.Information); Доб_Сотрудником.Доб_Сотруд DSotr = new Доб_Сотрудником.Доб_Сотруд(); DSotr.Show(); Close(); // Hide(); } gr691_koyEntities1 db = new gr691_koyEntities1(); // Поварята User = db.Поварята.FirstOrDefault(i => i.Имя == txt_Логин.Text); ///////////////////////// необходимо открыть прни использовании // Поварята Password = db.Поварята.FirstOrDefault(i => i.Пароль == txt_Пароль.Password); //else if (txt_Логин.Text == "" || txt_Пароль.Password == "") // { // MessageBox.Show("Не всё заполнено", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); // } // else if (txt_Логин.Text != User.Имя ) // { // MessageBox.Show("Неправильй логин", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); // } // else if (Password.Пароль != txt_Пароль.Password) // { // MessageBox.Show("Неправильй пароль", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); // } // else if (User.Имя == txt_Логин.Text && Password.Пароль == txt_Пароль.Password) // { // MessageBox.Show("Всё заполнено", "Успешно", MessageBoxButton.OK, MessageBoxImage.Information); // Доб_Сотрудником.Доб_Сотруд DSotr = new Доб_Сотрудником.Доб_Сотруд(); // DSotr.Show(); // Close(); // // Hide(); // } }
private void DobSotr_SelectionChanged(object sender, SelectionChangedEventArgs e) { gr691_koyEntities1 db = new gr691_koyEntities1(); ецепты.ItemsSource = db.Справочник_рецептов.ToList(); }