Beispiel #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (var ctx = new EntityContext())
                {
                    var user = ctx.User.FirstOrDefault(u => u.Login == login.Text && u.Password == password.Text);
                    if (user == null)
                    {
                        throw new Exception("Неверный логин или пароль!");
                    }

                    UserModelSingleton.Instance().GetModel(user).OpenWindow();
                    Close();
                }
            }
            catch (Exception ex)
            {
                DialogService.ShowError(ex.Message, "Ошибка!");
            }
        }
 public ManagerWindow()
 {
     InitializeComponent();
     MessageBox.Show("Hello, " + UserModelSingleton.Instance().FirstName);
     DataContext = coeffVM = Singleton <ViewModel.CoefficientViewModel> .Instance();
 }