Example #1
0
 }                                                       // тут будет форма
 public EnterFiled()
 {
     InitializeComponent();
     context  = new UserContext();
     temp     = new User();
     Instance = this;
 }
Example #2
0
        public static User is_Entered(string Login, string Password, string Name, DbSet <User> users, EnterFiled enterField)
        {
            bool entered = false;

            User user = new User();

            using (UserContext data = new UserContext())
            {
                foreach (var client in users)
                {
                    if (client.Login == Login & client.Password == Password & client.Name == Name)
                    {
                        entered = true;
                        user    = client;
                        break;
                    }
                }
            }

            if (entered == true)
            {
                MessageBox.Show($"Здравствуйте {user.Name}, теперь вы можете перейти в личный кабинет");


                MainWindow.Instance.LabelEventler.Visibility   = Visibility.Visible;
                MainWindow.Instance.MainRoomFeild.IsEnabled    = true;
                MainWindow.Instance.NameLabel.Content          = $"Имя: {user.Name}";
                MainWindow.Instance.PersonMoneyLabel.Content   = $"Счёт: {user.Cash}";
                MainWindow.Instance.FaceLabel.Content          = $"Лицо: {user.Face}";
                MainWindow.Instance.CreditHistoryLabel.Content = $"Кр.История: {user.creditHistory}";
                MainWindow.Instance.EnterCaller.Visibility     = Visibility.Collapsed;

                enterField.Close();
            }
            else
            {
                MessageBox.Show("Такого пользователя не существует");
            }
            return(user);
        }
Example #3
0
        private void EnterCaller_Click(object sender, RoutedEventArgs e) // Вызов окна входа
        {
            EnterFiled enterFiled = new EnterFiled();

            enterFiled.Show();
        }