コード例 #1
0
        public JsonResult CheckLogin(string username, string password)
        {
            db_WoodWiseEntities db = new db_WoodWiseEntities();
            var  dataItem          = db.Tbl_User.Where(x => x.UserName == username && x.Password == password).First();
            bool isLogged          = true;

            if (dataItem != null)
            {
                FormsAuthentication.SetAuthCookie(dataItem.UserName, false);
                isLogged = true;
            }
            else
            {
                isLogged = false;
            }
            return(Json(isLogged, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
 public GenericRepository(db_WoodWiseEntities DBEntity)
 {
     _DBEntity = DBEntity;
     _dbSet    = _DBEntity.Set <Tbl_Entity>();
 }