Exemple #1
0
        public ActionResult UpdateWardTypePrices(PriceListData data)
        {
            var newp = new WardTypeCharge();

            newp.DateAdded = DateTime.Now;
            newp.UserId    = (int)Session["UserId"];

            newp.BranchId = (int)Session["UserBranchId"];

            foreach (var entry in data.Items)
            {
                var p = db.WardTypeCharges.FirstOrDefault(e => e.ServiceId == entry.ServiceId && e.WardCategoryId == entry.WardCategoryId);
                if (p == null)
                {
                    newp.ServiceId      = entry.ServiceId;
                    newp.WardCategoryId = entry.WardCategoryId;
                    newp.Price          = entry.Price;
                    db.WardTypeCharges.Add(newp);
                }
                else
                {
                    p.Price = entry.Price;
                }

                db.SaveChanges();
            }

            return(Content("Prices Update Successuffly!"));
        }
Exemple #2
0
    public void OnBuffClick(int index)
    {
        Debug.Log("OnBuffClick:" + index);
        if (index == 0)
        {
            int priceId = DragonBaseData.dataMap[1].cutCompleteTimeFiveMinPrice;
            int price   = PriceListData.GetPrice(priceId, 0);

            MogoMessageBox.Confirm(LanguageData.dataMap[26307].Format(price),
                                   (isOk) =>
            {
                if (isOk)
                {
                    if (price > MogoWorld.thePlayer.diamond)
                    {
                        ShowLackOfDiamondTip();
                    }
                    else
                    {
                        RpcCall("ReduceConvoyTimeReq");
                    }
                    //todo请求缩短5分钟
                }
            });
        }
        else
        {
            int priceId = DragonBaseData.dataMap[1].immediateCompleteConvoyPrice;
            int time    = (int)m_currentData.matchTimeLeft / 60;
            if (time == 0)
            {
                time++;
            }
            int price = PriceListData.GetPrice(priceId, time);
            price *= time;


            MogoMessageBox.Confirm(LanguageData.dataMap[26308].Format(price),
                                   (isOk) =>
            {
                if (isOk)
                {
                    if (price > MogoWorld.thePlayer.diamond)
                    {
                        ShowLackOfDiamondTip();
                    }
                    else
                    {
                        //todo请求立刻完成比赛
                        RpcCall("ImmediateCompleteConvoyReq");
                    }
                }
            });
        }
    }
 /// <summary>
 /// 点击领悟UI重置按钮
 /// </summary>
 void OnLearnSkillUIResetUp()
 {
     MogoMessageBox.Confirm(LanguageData.GetContent(29602, PriceListData.GetPrice(22, 0)),
                            (flag) =>
     {
         if (flag)
         {
             ElfSystem.Instance.ResetElfSkillReq();
         }
     });
 }
Exemple #4
0
    public void OnRefreshOtherPlayers()
    {
        int priceId = DragonBaseData.dataMap[1].freshAdversaryPrice;
        int price   = PriceListData.GetPrice(priceId, 0);

        MogoMessageBox.Confirm(LanguageData.dataMap[26315].Format(price),
                               (isOk) =>
        {
            if (isOk)
            {
                //todo请求刷新其他玩家
                Debug.Log("OnRefreshOtherPlayers");
                MogoWorld.thePlayer.RpcCall("FreshAdversaryReq");
            }
        });
    }
Exemple #5
0
    public void OnBuyDragon(int id)
    {
        //请求购买
        int priceId = DragonBaseData.dataMap[1].goldDragonPrice;
        int price   = PriceListData.GetPrice(priceId, 0);

        MogoMessageBox.Confirm(LanguageData.dataMap[26311].Format(price),
                               (isOk) =>
        {
            if (isOk)
            {
                //todo请求购买金龙
                MogoWorld.thePlayer.RpcCall("BuyGoldDragonReq");
            }
        });
    }
Exemple #6
0
    public void OnHitTimesAddUp()
    {
        int priceId = DragonBaseData.dataMap[1].attackTimesPrice;
        int price   = PriceListData.GetPrice(priceId, 0);

        MogoMessageBox.Confirm(LanguageData.dataMap[26310].Format(price),
                               (isOk) =>
        {
            if (isOk)
            {
                Debug.Log("BuyAtkTimesReq");
                //todo请求增加袭击次数
                RpcCall("BuyAtkTimesReq");
            }
        });
    }
Exemple #7
0
    public void OnHitCDClearUp()
    {
        Debug.Log("OnHitCDClearUp");
        int priceId = DragonBaseData.dataMap[1].clearAttackCDPrice;
        //PriceListData priceData = PriceListData.dataMap.Get(priceId);
        int num = DragonMatchUIViewManager.Instance.GetHitCDLastSeconds() / 60;

        if (num == 0)
        {
            num = 1;
        }
        long price = PriceListData.GetPrice(priceId, 0) * (num);

        MogoMessageBox.Confirm(LanguageData.dataMap[26309].Format(price),
                               (isOk) =>
        {
            if (isOk)
            {
                //todo请求清楚cd
                RpcCall("ClearAttackCDReq");
            }
        });
    }
Exemple #8
0
    private void UpgradeDragonReq()
    {
        int[] cost = DragonBaseData.GetCostItem();
        if (InventoryManager.Instance.GetItemNumById(cost[0]) < cost[1])
        {
            //请求购买
            int priceId = DragonBaseData.dataMap[1].upgradeQualityCost;
            int price   = PriceListData.GetPrice(priceId, 0);

            // 判断是否需要重置(每天第一次登陆重置为true)
            if (MogoTime.Instance.GetCurrentDateTime().Day != Mogo.Util.SystemConfig.Instance.UpgradeDragonTipDialogDisableDay)
            {
                Mogo.Util.SystemConfig.Instance.IsShowUpgradeDragonTipDialog     = true;
                Mogo.Util.SystemConfig.Instance.UpgradeDragonTipDialogDisableDay = MogoTime.Instance.GetCurrentDateTime().Day;
                Mogo.Util.SystemConfig.SaveConfig();
            }

            if (Mogo.Util.SystemConfig.Instance.IsShowUpgradeDragonTipDialog) // 需要显示提示框
            {
                MogoUIManager.Instance.ShowOKCancelTipUI(() =>
                {
                    OKCancelTipUILogicManager.Instance.TruelyConfirm(LanguageData.dataMap[26312].Format(price),
                                                                     (isOK, isNoTip) =>
                    {
                        if (isNoTip)
                        {
                            Mogo.Util.SystemConfig.Instance.IsShowUpgradeDragonTipDialog     = false;
                            Mogo.Util.SystemConfig.Instance.UpgradeDragonTipDialogDisableDay = MogoTime.Instance.GetCurrentDateTime().Day;
                            Mogo.Util.SystemConfig.SaveConfig();
                        }

                        if (isOK)
                        {
                            if (price > MogoWorld.thePlayer.diamond)
                            {
                                ShowLackOfDiamondTip();
                            }
                            else
                            {
                                //todo请求
                                MogoWorld.thePlayer.RpcCall("FreshDragonQualityReq");
                            }
                        }
                    }, true);
                }, true);
            }
            else // 不用提示,直接提升
            {
                if (price > MogoWorld.thePlayer.diamond)
                {
                    ShowLackOfDiamondTip();
                }
                else
                {
                    //todo请求
                    MogoWorld.thePlayer.RpcCall("FreshDragonQualityReq");
                }
            }
        }
        else
        {
            MogoWorld.thePlayer.RpcCall("FreshDragonQualityReq");
        }
    }
Exemple #9
0
    private void SetupChooseDragonView()
    {
        //Debug.Log("SetupChooseDragonView");
        List <ChooseDragonGridData> chooseDragonGridDataList = new List <ChooseDragonGridData>();
        List <DragonQualityData>    dragonDataList           = DragonQualityData.GetDataList();

        for (int i = 0; i < dragonDataList.Count; i++)
        {
            ChooseDragonGridData gridData = new ChooseDragonGridData();
            gridData.dragonID      = dragonDataList[i].id;
            gridData.dragonQuality = dragonDataList[i].quality;
            if (dragonDataList[i].quality != m_currentData.dragonQuality)
            {
                gridData.enable = false;
            }
            else
            {
                gridData.enable = true;
            }

            gridData.finishTime     = LanguageData.dataMap.Get(26300).Format((dragonDataList[i].convoyCompleteTime[m_currentData.currentRound + 1] / 60));
            gridData.additionReward = LanguageData.GetContent(26301, (dragonDataList[i].rewardAddition / 100));
            if (i == 4 && m_currentData.dragonQuality != 6)
            {
                gridData.showBuy = true;
            }
            else
            {
                gridData.showBuy = false;
            }
            chooseDragonGridDataList.Add(gridData);
        }
        ChooseDragonUILogicManager.Instance.SetChooseDragonGridDataList(chooseDragonGridDataList);

        DragonQualityData currentDragon  = DragonQualityData.GetDragonQualityData(m_currentData.dragonQuality);
        string            nextDragonName = string.Empty;

        if (m_currentData.dragonQuality < 6)
        {
            nextDragonName = DragonQualityData.GetDragonQualityData(m_currentData.dragonQuality + 1).GetName(true);
        }
        ChooseDragonUIViewManager.Instance.SetCurrentChooseDragon(currentDragon.GetName(true), nextDragonName);
        ChooseDragonUIViewManager.Instance.SetRewardCurrentTime(m_currentData.currentRound + 1);

        ChooseDragonUIViewManager.Instance.SetRewardExp(Rewards[1]);
        ChooseDragonUIViewManager.Instance.SetRewardGold(Rewards[2]);
        int[]  cost        = DragonBaseData.GetCostItem();
        int    costNum     = cost[1];
        int    costID      = cost[0];
        int    materialNum = InventoryManager.Instance.GetItemNumById(costID);
        string costStr     = string.Empty;

        if (costNum <= materialNum)
        {
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedIcon(ItemParentData.GetItem(costID).Icon);
            costStr = string.Concat(costNum, "/", materialNum);
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedNum(costStr);
        }
        else
        {
            int priceId = DragonBaseData.dataMap[1].upgradeQualityCost;
            int price   = PriceListData.GetPrice(priceId, 0);

            costStr = string.Concat(price, "/", MogoWorld.thePlayer.diamond);
            if (price > MogoWorld.thePlayer.diamond)
            {
                costStr = MogoUtils.GetRedString(costStr);
            }
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedIcon(ItemParentData.GetItem(3).Icon);
            ChooseDragonUIViewManager.Instance.SetUpgradeNeedNum(costStr);
        }
    }