public ActionResult GetUserInfo()
        {
            Avatar avatar = Session[SessionKey.AvatarKey] as Avatar;
            //Session[SessionKey.AvatarKey] = avatar;
            UserPiecesTotal usepiecestotal = new UserPiecesTotal();

            usepiecestotal.AreaID = avatar.GameAreaID;
            usepiecestotal.UserId = avatar.UserID;
            List <UserPiecesTotal> userinfo = PuzzleEventBll.GetUserPiecesTotalAll(usepiecestotal);
            var data = new { UserID = UserCookie.UserID, LoginName = UserCookie.LoginName, GameAreaID = avatar.GameAreaID, AvatarName = avatar.AvatarName, userinfo = userinfo };

            return(Jsonp(ErrorCode.Succuess, data));
        }
Exemplo n.º 2
0
        public List <UserPiecesTotal> GetUserPiecesTotalAll(UserPiecesTotal userpiecestotal)
        {
            _client = new PuzzleEventService.PuzzleEventServiceClient();
            List <UserPiecesTotal> lists = new List <UserPiecesTotal>();

            try
            {
                lists = _client.GetUserPiecesTotalAll(userpiecestotal);
                _client.Close();
                return(lists);
            }
            catch (Exception ex)
            {
                _client.CloseCatch(ex, "GetUserPiecesTotalAll 获取指定用户信息失败");
                return(lists);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取 UserPiecesTotal 全部数据
        /// </summary>
        /// Create By zhouqi
        /// 2016/4/5 18:44:26
        /// <returns></returns>
        public List <UserPiecesTotal> GetUserPiecesTotalAll(UserPiecesTotal userpiecestotal)
        {
            DbCommand cmd = DB.GetStoredProcCommand("UserPiecesTotal_GetAll");

            DB.AddInParameter(cmd, UserPiecesTotal.AreaIDField, DbType.Int32, userpiecestotal.AreaID);
            DB.AddInParameter(cmd, UserPiecesTotal.UserIdField, DbType.Int64, userpiecestotal.UserId);
            List <UserPiecesTotal> userPiecesTotalList = new List <UserPiecesTotal>();

            using (IDataReader dr = DB.ExecuteReader(cmd))
            {
                if (dr.FieldCount > 0)
                {
                    int coRecordID       = dr.GetOrdinal(UserPiecesTotal.RecordIDField);
                    int coUserId         = dr.GetOrdinal(UserPiecesTotal.UserIdField);
                    int coAreaID         = dr.GetOrdinal(UserPiecesTotal.AreaIDField);
                    int coPiecesTotal    = dr.GetOrdinal(UserPiecesTotal.PiecesTotalField);
                    int coPiecesConsume  = dr.GetOrdinal(UserPiecesTotal.PiecesConsumeField);
                    int coPiecesBalance  = dr.GetOrdinal(UserPiecesTotal.PiecesBalanceField);
                    int coPiecesOccupied = dr.GetOrdinal(UserPiecesTotal.PiecesOccupiedField);
                    int coPuzzleTypeID   = dr.GetOrdinal(UserPiecesTotal.PuzzleTypeIDField);
                    int coRemainPoints   = dr.GetOrdinal(UserPiecesTotal.RemainPointsField);
                    int coIsFirst        = dr.GetOrdinal(UserPiecesTotal.IsFirstField);
                    while (dr.Read())
                    {
                        UserPiecesTotal userPiecesTotal = new UserPiecesTotal();

                        userPiecesTotal.RecordID       = dr.IsDBNull(coRecordID) ? (long)0 : dr.GetInt64(coRecordID);
                        userPiecesTotal.UserId         = dr.IsDBNull(coUserId) ? (long)0 : dr.GetInt64(coUserId);
                        userPiecesTotal.AreaID         = dr.IsDBNull(coAreaID) ? (int)0 : dr.GetInt32(coAreaID);
                        userPiecesTotal.PiecesTotal    = dr.IsDBNull(coPiecesTotal) ? (long)0 : dr.GetInt64(coPiecesTotal);
                        userPiecesTotal.PiecesConsume  = dr.IsDBNull(coPiecesConsume) ? (int)0 : dr.GetInt32(coPiecesConsume);
                        userPiecesTotal.PiecesBalance  = dr.IsDBNull(coPiecesBalance) ? (int)0 : dr.GetInt32(coPiecesBalance);
                        userPiecesTotal.PiecesOccupied = dr.IsDBNull(coPiecesOccupied) ? (int)0 : dr.GetInt32(coPiecesOccupied);
                        userPiecesTotal.PuzzleTypeID   = dr.IsDBNull(coPuzzleTypeID) ? (int)0 : dr.GetInt32(coPuzzleTypeID);
                        userPiecesTotal.RemainPoints   = dr.IsDBNull(coRemainPoints) ? (int)0 : dr.GetInt32(coRemainPoints);
                        userPiecesTotal.IsFirst        = dr.IsDBNull(coIsFirst) ? (int)0 : dr.GetInt32(coIsFirst);
                        userPiecesTotalList.Add(userPiecesTotal);
                    }
                }
            }

            //UserPiecesTotal UserPoints = new UserPiecesTotal();
            //UserPoints.RemainPoints = Convert.ToInt64(DB.GetParameterValue(cmd, UserPiecesTotal.RemainPointsField));
            //userPiecesTotalList.Add(UserPoints);
            return(userPiecesTotalList);
        }
Exemplo n.º 4
0
        public List <UserPiecesTotal> GetUserPiecesTotalList(ref DataPage dp, UserPiecesTotal searchUserPiecesTotal)
        {
            _admin = new PuzzleEventAdminService.PuzzleEventAdminServiceClient();
            List <UserPiecesTotal> lists = new List <UserPiecesTotal>();

            try
            {
                lists = _admin.GetUserPiecesTotalList(ref dp, searchUserPiecesTotal);
                _admin.Close();
                return(lists);
            }
            catch (Exception ex)
            {
                _admin.CloseCatch(ex, "GetUserPiecesTotalList 获取拼图列表失败");
                return(lists);
            }
        }
Exemplo n.º 5
0
 public List <UserPiecesTotal> GetUserPiecesTotalList(ref DataPage dp, UserPiecesTotal searchUserPiecesTotal)
 {
     return(_dal.GetUserPiecesTotalList(ref dp, searchUserPiecesTotal));
 }
Exemplo n.º 6
0
 public List <UserPiecesTotal> GetUserPiecesTotalAll(UserPiecesTotal userpiecestotal)
 {
     return(_dal.GetUserPiecesTotalAll(userpiecestotal));
 }