コード例 #1
0
        public LoginResult UserLogin(QueryLogin login)
        {
            var           loginModel = new NTS.WEB.BLL.Account().GetAccount(login.LoginUser);
            List <string> menus      = new List <string>();
            var           menulist   = new NTS.WEB.BLL.User().GetSingleUserMenu(login.LoginUser);

            menus = (from i in menulist select i.LINKNAME.ToLower()).ToList <string>();
            string redirecturl = (from i in menus where i.EndsWith("html") select i).FirstOrDefault();

            if (string.IsNullOrEmpty(redirecturl))
            {
                redirecturl = "";
            }
            if (loginModel != null)
            {
                if (loginModel.UserPass == login.LoginPass)
                {
                    return(new LoginResult {
                        Success = true, Msg = "", Menus = menus, RedirectUrl = redirecturl
                    });
                }
                return(new LoginResult {
                    Success = false, Msg = "用户的密码不正确。"
                });
            }
            return(new LoginResult {
                Success = false, Msg = "用户名不存在。"
            });
        }
コード例 #2
0
        public UserResult GetUserInfo(string userName)
        {
            var loginModel = new NTS.WEB.BLL.Account().GetAccount(userName);

            if (loginModel != null)
            {
                return(new UserResult()
                {
                    UserName = loginModel.UserName,
                    UserPass = loginModel.UserPass
                });
            }
            return(null);
        }
コード例 #3
0
ファイル: User.cs プロジェクト: NickQi/TianheDemo
        public LoginResult UserLogin(QueryLogin login)
        {
            var loginModel = new NTS.WEB.BLL.Account().GetAccount(login.LoginUser);
            List<string> menus = new List<string>();
            var menulist = new NTS.WEB.BLL.User().GetSingleUserMenu(login.LoginUser);
            menus = (from i in menulist select i.LINKNAME.ToLower()).ToList<string>();
            string redirecturl = (from i in menus where i.EndsWith("html") select i).FirstOrDefault();
            if (string.IsNullOrEmpty(redirecturl))
            {
                redirecturl = "";
            }
            if (loginModel != null)
            {
                if (loginModel.UserPass == login.LoginPass)
                {
                    return new LoginResult { Success = true, Msg = "", Menus = menus, RedirectUrl = redirecturl };

                }
                return new LoginResult { Success = false, Msg = "用户的密码不正确。" };
            }
            return new LoginResult { Success = false, Msg = "用户名不存在。" };
        }
コード例 #4
0
ファイル: User.cs プロジェクト: NickQi/TianheDemo
 public UserResult GetUserInfo(string userName)
 {
     var loginModel = new NTS.WEB.BLL.Account().GetAccount(userName);
     if (loginModel != null)
     {
         return new UserResult()
             {
                 UserName = loginModel.UserName,
                 UserPass = loginModel.UserPass
             };
     }
     return null;
 }