Esempio n. 1
0
    // Transfer data from Server data struction
    public void UpdateFromServerData(sg.GS2C_Pay_Get_Goods_Res.PayGoodInfo source)
    {
        currency = (CurrencyType)source.amountUnit;
        comType  = CommodityType.Recharge;

        base.ItemID = source.id;

        BasicData.Name          = source.name;
        BasicData.Description   = source.summary;
        BasicData.Count         = 1;
        BasicData.Icon          = source.icon;
        BasicData.IsFirstDouble = source.isFirstDouble;
        CommodityStr            = source.commodityStr;
        currPrice     = source.rebateAmount;
        originalPrice = source.amount;

        buyTime      = source.payTime;
        recvIgnotCnt = source.virtualAmount;

        foreach (sg.BI_Pay_HandselResources_Mes info in source.handselResourcesArray)
        {
            ItemMultData data = new ItemMultData();

            data.LogicID   = info.handselType;
            data.ItemCount = info.handselValue;

            // Just for show the free goods icon
            freeGoodsList.Add(data);
        }

        if (!string.IsNullOrEmpty(source.rebateBeginTime))
        {
            bargainEvent           = new CommodityEvent();
            bargainEvent.eventId   = CommodityEvent.CommodityEventId.Discount;
            bargainEvent.beginTime = source.rebateBeginTime;
            bargainEvent.endTime   = source.rebateEndTime;
        }

        if (!string.IsNullOrEmpty(source.handselBeginTime))
        {
            handselEvent           = new CommodityEvent();
            handselEvent.eventId   = CommodityEvent.CommodityEventId.Handsel;
            handselEvent.beginTime = source.handselBeginTime;
            handselEvent.endTime   = source.handselEndTime;
        }
    }
Esempio n. 2
0
    public void UpdateFromServerData(sg.GS2C_ItemMall_Get_Goods_Res.BuyGoodsInfo source)
    {
        currency = CurrencyType.Diamond;
        comType  = CommodityType.GameInner;

        BasicData.LogicID = source.id;
        BasicData.FillDataFromConfig();

        BasicData.Name        = source.name;
        BasicData.Description = source.summary;
        BasicData.Icon        = source.icon;

        currPrice     = source.rebateAmount;
        originalPrice = source.amount;

        buyTime = source.buyTime;

        if (0 != source.handselItemId || -1 != source.handselItemId)
        {
            ItemMultData data = new ItemMultData();
            data.LogicID   = source.handselItemId;
            data.ItemCount = source.handselItemNumber;
            // source.handselBeginTime;
            // source.handselEndTime;

            freeGoodsList.Add(data);
        }

        if (!string.IsNullOrEmpty(source.rebateBeginTime))
        {
            bargainEvent           = new CommodityEvent();
            bargainEvent.eventId   = CommodityEvent.CommodityEventId.Discount;
            bargainEvent.beginTime = source.rebateBeginTime;
            bargainEvent.endTime   = source.rebateEndTime;
        }

        if (!string.IsNullOrEmpty(source.handselBeginTime))
        {
            handselEvent           = new CommodityEvent();
            handselEvent.eventId   = CommodityEvent.CommodityEventId.Handsel;
            handselEvent.beginTime = source.handselBeginTime;
            handselEvent.endTime   = source.handselEndTime;
        }
    }