コード例 #1
0
        /// <summary>
        /// 新增数据的判断

        /// </summary>
        /// <param name="dr"></param>
        /// <param name="tran"></param>
        /// <returns></returns>
        private bool CheckInsertData(DataRow dr, DbTransaction tran, out string strInvalid)
        {
            bool flag = true;

            strInvalid = "";
            switch (dr.Table.TableName.ToUpper())
            {
            case "HC_ORD_PURCHASE":         //订单明细状态表
                flag = PurchaseCheck.GetInstance().CheckPurchaseForInsert(dr, out strInvalid);
                break;

            case "HC_ORD_PURCHASE_ITEM":     //产品匹配表


                flag = PurchaseCheck.GetInstance().CheckPurchaseItemForInsert(dr, out strInvalid);
                break;

            case "HC_ORD_ORDER":     //订单表


                flag = OrderCheck.GetInstance().CheckOrderForInsert(dr, out strInvalid);
                break;

            case "HC_ORD_ORDER_ITEM":          //订单明细表


                flag = OrderCheck.GetInstance().CheckOrderItemForInsert(dr, out strInvalid);
                break;

            default:
                break;
            }
            return(flag);
        }
コード例 #2
0
    public void BuyAdventurer(GameObject panel)
    {
        PurchaseCheck check = new PurchaseCheck();
        Adventurer    adv   = panel.GetComponent <MemberHirePanel>().adventurer;

        if (check.ableToPurchase(adv.price))
        {
            //take the money away
            Player.instance.gold -= adv.price;
            //add adventurer
            adventurer.Add(adv);
            Destroy(panel);
        }
    }
コード例 #3
0
    public void upgradeMonster()
    {
        PurchaseCheck pc = new PurchaseCheck();

        if (pc.ableToPurchase(monster.upgradePrice()))
        {
            if (monster.level < Player.instance.maxLevel)
            {
                Player.instance.gold -= monster.upgradePrice();
                monster.level        += 1;
                updateMonsterArea();
            }
        }
    }
コード例 #4
0
    public void UpgradeAdventurer()
    {
        PurchaseCheck pc = new PurchaseCheck();

        if (pc.ableToPurchase(adv.wealthCost()))
        {
            if (adv.wealth < Player.instance.maxLevel)
            {
                Debug.Log(adv.wealthCost());
                Player.instance.gold -= adv.wealthCost();
                adv.wealth           += 1;
                setupPanel();
            }
        }
    }
コード例 #5
0
    public void Upgrade()
    {
        PurchaseCheck check = new PurchaseCheck();

        if (check.ableToPurchase(adventurer.wealthCost()))
        {
            if (adventurer.wealth <= Player.instance.maxLevel)
            {
                Player.instance.gold -= adventurer.wealthCost();
                adventurer.wealth    += 1;
                EnemyManager.instance.updateMemberListArea();
                MemberPanel.instance.setupPanel();
                MemberPanel.instance.DetailedMember(adventurer);
            }
        }
    }
コード例 #6
0
        /// <summary>
        /// 删除数据的判断

        /// </summary>
        /// <param name="dr"></param>
        /// <param name="tran"></param>
        /// <returns></returns>
        private bool CheckDeleteData(DataRow dr, DbTransaction tran, out string strInvalid)
        {
            bool flag = true;

            strInvalid = "";
            switch (dr["Table_Name"].ToString().ToUpper())
            {
            case "HC_ORD_PURCHASE":
                flag = PurchaseCheck.GetInstance().CheckPurchaseForDelete(dr, out strInvalid);
                break;

            case "HC_ORD_PURCHASE_ITEM":
                flag = PurchaseCheck.GetInstance().CheckPurchaseItemForDelete(dr, out strInvalid);
                break;
            }
            return(flag);
        }