public ActionResult BeforeLogin()
        {

            string APPKEY = Guid.NewGuid().ToString();
            string APPSECRET = Guid.NewGuid().ToString();


            var ss = new AccountContext();
         var bm=   ss.BussinessManagers.FirstOrDefault(m => m.APPKEY == APPKEY&m.APPSECRET == APPSECRET);
         if (bm == null)
             return Content("业务系统没注册");
     
            else
             return base.Redirect("~/account/login");

         //return base.Redirect("~/ControllerDemo/ContentResult");
           
        }
Beispiel #2
0
        private bool CanPass()
        {
            AccountContext acContext=new AccountContext();

         var cuser=   acContext.Users.Where(m => m.Name == _userName & m.Password == _pwd).FirstOrDefault();
            if (cuser!=null)
            {
                this._userID = cuser.UserID;
                return true;
            }
            //这里朋友们可以根据自己的需要改为从数据库中验证用户名和密码, 
            //这里为了方便我直接指定的字符串 
            //if (_userName == "*****@*****.**")
            //{
            //    return true;
            //}
            else
            {
                return false;
            }
        } 
Beispiel #3
0
        public UserD() {

            acContext = new AccountContext();
        }