Exemple #1
0
        /// <summary>
        /// BuildPackageData
        /// </summary>
        /// <param name="package"></param>
        /// <param name="itemType"></param>
        /// <returns></returns>
        public ItemPackageData BuildPackageData(ItemPackageFrame package, int itemType = 0)
        {
            var data = new ItemPackageData();

            data.Items = package.GetItemsByType(itemType);
            var teammember = MatchDataHelper.GetSolutionTeammembers(package.ManagerId);

            ItemPackageFrame.CaluPackageCardKpi(data.Items, teammember);
            data.PackageSize = package.PackageSize;
            return(data);
        }
Exemple #2
0
        public ItemPackageResponse GetPackageResponse(Guid managerId)
        {
            var package  = ItemPackageMgr.GetById(managerId);
            var response = ResponseHelper.CreateSuccess <ItemPackageResponse>();

            response.Data = package;

            //AchievementTaskCore.Instance.UpdatePlayCardCount(new ItemPackageFrame(package));

            var packageItemsEntity = SerializationHelper.FromByte <ItemPackageItemsEntity>(package.ItemString);

            if (packageItemsEntity == null || packageItemsEntity.Items == null)
            {
                response.Data.Items = new List <ItemInfoEntity>();
            }
            else
            {
                var teammember = MatchDataHelper.GetSolutionTeammembers(managerId);
                ItemPackageFrame.CaluPackageCardKpi(packageItemsEntity.Items, teammember);
                response.Data.Items = packageItemsEntity.Items;
            }

            return(response);
        }