Пример #1
0
        /// <summary>
        /// 获取单条数据
        /// </summary>
        /// <returns></returns>
        public V_xy_sp_userView GetCurrentUserStatebyUserID(string UserID)
        {
            V_xy_sp_userView           userV = new V_xy_sp_userView();
            tm_pm_userinfoBLL          ubll  = new tm_pm_userinfoBLL();
            xy_sp_userspiritBLL        upbll = new xy_sp_userspiritBLL();
            xy_sp_spiritequipmentBLL   sqBll = new xy_sp_spiritequipmentBLL();
            xy_sp_spiritskillBLL       skBll = new xy_sp_spiritskillBLL();
            xy_sp_userspiritpackageBLL spBll = new xy_sp_userspiritpackageBLL();
            xy_sp_taskBLL tkBll = new xy_sp_taskBLL();

            using (xy_sp_userspiritDAL dal = new xy_sp_userspiritDAL())
            {
                userV.User = ubll.GetUserInfoByID(UserID);
                xy_sp_userspirit entity = dal.GetSpiritbyUserID(UserID);
                userV.Spirit = EntityToModel(entity);
                //用户背包
                userV.Spirit.packageList = spBll.GetSpPackageListBySpID(userV.Spirit.SpiritID);
                //用户装备
                userV.Spirit.spEquipmentList = sqBll.GetSpEqListBySpID(userV.Spirit.SpiritID);
                //用户技能
                userV.Spirit.spSkillList = skBll.GetListBySpID(userV.Spirit.SpiritID);


                userV.Task = tkBll.getTaskContext(entity.CurrentTaskID);
                return(userV);
            }
        }
 public ActionResult Index()
 {
     ViewBag.para = "";
     HttpCookie cookie = Request.Cookies["Token"];
     if (cookie != null)
     {
         string tokenValue = cookie.Value;
         if (!string.IsNullOrEmpty(tokenValue))
         {
             V_tm_pm_userinfo user = new tm_pm_userinfoBLL().GetLoginInfo(tokenValue);
             if (user != null)
                 return View();
         }
     }
     return Redirect("User/Login");
 }