public JsonResult validateLogin(User u)
        {
            Object data   = null;
            bool   val    = false;
            String r      = "null";
            User   result = LoginHistoryDAL.insert(u);

            if (result != null)
            {
                Session.Add("user", result);
                Session.Add("userType", result.Type);
                ViewBag.type = result.Type;
                val          = true;
                r            = result.Type;
                r            = r.Trim();
            }
            data = new
            {
                res = r
            };
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public int insert(int Id, string Name, string IP)
        {
            LoginHistoryDAL logins = new LoginHistoryDAL();

            return(logins.insert(Id, Name, IP));
        }
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="dal"></param>
 public LoginHistoryService(LoginHistoryDAL dal) : base(dal)
 {
 }
Example #4
0
        public List <LoginHistoryModel> SelectLogin()
        {
            LoginHistoryDAL loginHistory = new LoginHistoryDAL();

            return(loginHistory.SelectLogin());
        }