예제 #1
0
        public RegisterUserPage()
        {
            InitializeComponent();
            DataContext = _correnClients;

            SuperShopEntities1.Getcontext().Клиенты.ToList();
        }
예제 #2
0
 public static SuperShopEntities1 Getcontext()
 {
     if (_context == null)
     {
         _context = new SuperShopEntities1();
     }
     return(_context);
 }
예제 #3
0
        private void Button_Click(object sender, RoutedEventArgs e) // кнопка зарегестрировать
        {
            string userName     = textBoxNamef_reg.Text.Trim();
            string userLastName = textBoxNameLast_reg.Text.Trim();
            string phone        = textBoxPhone.Text.Trim();
            string login        = textBoxLogin.Text.Trim();
            string password     = PasswordBox.Password;
            string password1    = PasswordBox.Password;

            if (login.Length < 5)
            {
                textBoxLogin.ToolTip    = "Минимум 6 символов";
                textBoxLogin.Background = Brushes.DarkRed;
            }
            else if (password.Length < 5)
            {
                PasswordBox.ToolTip    = "Минимум 6 символов";
                PasswordBox.Background = Brushes.DarkRed;
            }
            else if (password != password1)
            {
                PasswordBox.ToolTip    = "Пароль не совпадает";
                PasswordBox.Background = Brushes.DarkRed;
            }
            else if (userName == "")
            {
                textBoxNamef_reg.ToolTip    = "Введите имя";
                textBoxNamef_reg.Background = Brushes.DarkRed;
            }
            else if (phone == "")
            {
                textBoxPhone.ToolTip    = "Вы забыли про телефон";
                textBoxPhone.Background = Brushes.DarkRed;
            }



            else
            {
                textBoxLogin.ToolTip    = "";
                textBoxLogin.Background = Brushes.Transparent;

                MessageBox.Show("Все хорошо");

                SuperShopEntities1.Getcontext().Клиенты.Add(_correnClients);

                SuperShopEntities1.Getcontext().SaveChanges();
            }
        }
예제 #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string login    = EnterName.Text.Trim();
            string password = EnterPassword.Password.Trim();

            Клиенты authUser = null;

            using (SuperShopEntities1 db = new SuperShopEntities1())
            {
                authUser = db.Клиенты.Where(d => d.логин == login && d.пароль == password).FirstOrDefault();
            }

            if (authUser != null)
            {
                MessageBox.Show("Имя: " + authUser.имя + " | " + "Фамилия: " + authUser.фамилия);
            }
            else
            {
                MessageBox.Show("Пользователь не найден");
            }
        }
예제 #5
0
        public testingPage()
        {
            InitializeComponent();

            DGTable.ItemsSource = SuperShopEntities1.Getcontext().Клиенты.ToList();
        }
예제 #6
0
        public LoginEnterPage()
        {
            InitializeComponent();

            SuperShopEntities1.Getcontext().Клиенты.ToList();
        }