public static User Login() { var loginDialog = new UserLoginDialog(); User user = null; try { loginDialog.ShowDialog(); if ((bool)loginDialog.DialogResult) { user = users.FirstOrDefault(u => u.Username.Equals(loginDialog.Username.ToLower())); if (user != null) { user = ProcessLogin((UserLogin)user, loginDialog.Password); } else { new InvalidUsernameDialog().ShowDialog(); ESB2UserEventLog.LogUserEvent(loginDialog.Username, EventLoggerEvents.InvalidUsername); } } }catch (Exception e) { ESB2ExceptionEventLog.LogExceptionEvent(e); } return(user); }
public static User Login() { var loginDialog = new UserLoginDialog(); User user = null; loginDialog.ShowDialog(); if ((bool)loginDialog.DialogResult) { user = users.FirstOrDefault(u => u.Username.Equals(loginDialog.Username)); if (user == null) { user = ProcessLogin((UserLogin)user, loginDialog.Password); } } return(user); }