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; }
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(); } } }
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(); } } } }
/// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUsers(USER uSER) { base.AddObject("Users", uSER); }
/// <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; }