示例#1
0
 public static bool AuthentificateUser(USER user)
 {
     var cu = DataManager.Instance.GetUser(user.NAME, user.PASSWORD);
     if (cu != null)
     {
         currentUser = cu;
         authentificated = true;
         return true;
     }
     else
     {
         currentUser = null;
         authentificated = true;
         return true;
     }
     return false;
 }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if ((txtName.Text != "") & (txtPassword.Text != ""))
            {
                var user = new USER();
                user.NAME = txtName.Text;
                user.PASSWORD = txtPassword.Text;
                if (Authentification.AuthentificateUser(user))
                {
                    MainWindowViewModel main = new MainWindowViewModel();
                    MainWindow window = new MainWindow { DataContext = main };
                    window.Show();

                    this.Close();
                }

            }
        }
示例#3
0
        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                if ((txtName.Text != "") & (txtPassword.Text != ""))
                {
                    var user = new USER();
                    user.NAME = txtName.Text;
                    user.PASSWORD = txtPassword.Text;
                    if (Authentification.AuthentificateUser(user))
                    {
                        MainWindowViewModel main = new MainWindowViewModel();
                        MainWindow window = new MainWindow { DataContext = main };
                        window.Show();

                        this.Close();
                    }

                }
            }
        }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(USER uSER)
 {
     base.AddObject("Users", uSER);
 }
示例#5
0
 /// <summary>
 /// Create a new USER object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="nAME">Initial value of the NAME property.</param>
 /// <param name="pASSWORD">Initial value of the PASSWORD property.</param>
 public static USER CreateUSER(global::System.Guid id, global::System.String nAME, global::System.String pASSWORD)
 {
     USER uSER = new USER();
     uSER.Id = id;
     uSER.NAME = nAME;
     uSER.PASSWORD = pASSWORD;
     return uSER;
 }