コード例 #1
0
ファイル: ESB2Login.cs プロジェクト: dsbjax/ESB2
        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);
        }
コード例 #2
0
        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);
        }