Ejemplo n.º 1
0
        void BindPackage(ItemPackageEntity packageFrame)
        {
            var list        = new List <AdminItemInfoEntity>();
            var packageData = SerializationHelper.FromByte <ItemPackageItemsEntity>(packageFrame.ItemString);

            if (packageData.Items != null)
            {
                foreach (var itemInfo in packageData.Items)
                {
                    AdminItemInfoEntity entity = new AdminItemInfoEntity();
                    entity.GridIndex    = itemInfo.GridIndex;
                    entity.IsBinding    = itemInfo.IsBinding;
                    entity.IsBindingV   = itemInfo.IsDeal;
                    entity.ItemCode     = itemInfo.ItemCode;
                    entity.ItemCount    = itemInfo.ItemCount;
                    entity.Strength     = itemInfo.GetStrength();
                    entity.ItemId       = itemInfo.ItemId;
                    entity.ItemType     = itemInfo.ItemType;
                    entity.ItemTypeV    = CacheDataHelper.Instance.GetEnumDescription("EnumItemType", itemInfo.ItemType);
                    entity.ItemProperty = itemInfo.ItemProperty;
                    entity.Status       = itemInfo.Status;
                    entity.StatusV      = CacheDataHelper.Instance.GetEnumDescription("EnumItemStatus", itemInfo.Status);
                    BuildItemInfo(itemInfo, entity);
                    if (list.Exists(d => d.ItemId == itemInfo.ItemId))
                    {
                        entity.IsRepeat = true;
                    }
                    list.Add(entity);
                }

                lblPackageGrid.Text = string.Format("格数:{0}/{1}", packageData.Items.Count, packageFrame.PackageSize);
            }
            dgPackage.DataSource = list;
            dgPackage.DataBind();
        }
Ejemplo n.º 2
0
        void BuildItemInfo(ItemInfoEntity itemInfo, AdminItemInfoEntity wpfItemInfo)
        {
            var    itemCode = itemInfo.ItemCode;
            string enumName = "";

            switch (itemInfo.ItemType)
            {
            case (int)EnumItemType.PlayerCard:
                enumName = "EnumPlayerCardLevel";
                break;

            case (int)EnumItemType.Equipment:
                enumName = "EnumEquipmentQuality";
                break;

            case (int)EnumItemType.BallSoul:
                enumName = "EnumBallSoulColor";
                break;

            case (int)EnumItemType.MallItem:
                enumName = "EnumMallType";
                break;

            case (int)EnumItemType.SuitDrawing:
                enumName = "";
                break;
            }
            var itemDic = AdminCache.Instance.GetItem(itemCode);

            if (itemDic != null)
            {
                wpfItemInfo.Name = itemDic.ItemName;
                if (!string.IsNullOrEmpty(enumName))
                {
                    wpfItemInfo.SubTypeV = CacheDataHelper.Instance.GetEnumDescription(enumName, itemDic.SubType);
                }
            }
        }