Пример #1
0
        private void go_Click(object sender, RoutedEventArgs e)
        {
            object permission = model.CheckAuthorization(login.Text, password.Password);

            if (permission == null)
            {
                loginResult.Property(Label.ContentProperty).SetResourceValue("MainWindow_LoginFault");
            }
            else
            {
                try
                {
                    PermissionManager.Authorized(Convert.ToInt32(permission));
                    App.OpenWindow(WindowsFactory.MainMenu);
                    this.Close();
                    PermissionManager.USER = login.Text;
                    LoggingManager.LogAction(2, login.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }