12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace OUP
- {
- public class MainViewModel : BaseViewModel
- {
- private RelayCommand _authcommand;
- private string _login;
- private string _password;
- public string Login
- {
- get => _login;
- set
- {
- _login = value;
- OnPropertyChanged();
- }
- }
- public string Password
- {
- get => _password;
- set
- {
- _password = value;
- OnPropertyChanged();
- }
- }
- public RelayCommand AuthCommand
- {
- get
- {
- return _authcommand ??
- (_authcommand = new RelayCommand((x) =>
- {
- var authUser = Helper.GetContext().Employees.SingleOrDefault(user => user.Login == Login && user.Password == Password);
- if (authUser == null)
- {
- MessageBox.Show("Введите верный логин и пароль");
- return;
- }
- else
- {
- OUP Window1 = new OUP();
- Window1.Show();
- }
- }));
- }
- }
- }
- }
|