Example #1
0
    public static void ChargeMoney(int exchangeTableId, int count = 1)
    {
        CRequestExchangeBill bill = new CRequestExchangeBill();

        bill.goodid  = exchangeTableId;
        bill.goodnum = count;

        IOControler.GetInstance().SendProtocol(bill);
    }
Example #2
0
    /// <summary>
    /// 购买物品接口
    /// </summary>
    /// <param name="shopId">shop表id</param>
    /// <param name="count">购买数量</param>
    /// <param name="isdiscount">是否在打折</param>
    /// <param name="errStr">返回的错误信息</param>
    /// <returns></returns>
    public static void BuyItem(int shopId, int count, bool isdiscount)
    {
        UI_ShopMgr.CanBuyItem = false;

        ShopTemplate shopT = DataTemplate.GetInstance().GetShopTemplateByID(shopId);

        if (shopT.getTabID() == (int)SHOP_TAB.CHARGE)
        {
            CRequestExchangeBill bill = new CRequestExchangeBill();
            bill.goodid  = shopT.getId();
            bill.goodnum = count;

            IOControler.GetInstance().SendProtocol(bill);
        }
        else
        {
            CShopBuy csb = new CShopBuy();
            csb.isdiscount = System.Convert.ToByte(isdiscount);
            csb.shopid     = shopId;
            csb.num        = count;

            IOControler.GetInstance().SendProtocol(csb);
        }
    }