Example #1
0
        private void ShowContractMoney(EntityData entity, string contractChangeCode)
        {
            entity.SetCurrentTable("Contract");

            decimal TotalMoney, TotalChangeMoney, OriginalMoney, NewTotalMoney, ChangeMoney, BudgetMoney, AdjustMoney;;

            OriginalMoney = entity.GetDecimal("OriginalMoney");
            BudgetMoney   = entity.GetDecimal("BudgetMoney");
            AdjustMoney   = entity.GetDecimal("AdjustMoney");

            TotalMoney       = Decimal.Zero;
            TotalChangeMoney = Decimal.Zero;
            NewTotalMoney    = Decimal.Zero;
            ChangeMoney      = Decimal.Zero;

            foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", contractChangeCode), "", System.Data.DataViewRowState.CurrentRows))
            {
                TotalMoney       = dr["Money"] != DBNull.Value ? (decimal)dr["Money"] : Decimal.Zero;
                TotalChangeMoney = dr["TotalChangeMoney"] != DBNull.Value ? (decimal)dr["TotalChangeMoney"] : Decimal.Zero;
                NewTotalMoney    = dr["NewMoney"] != DBNull.Value ? (decimal)dr["NewMoney"] : Decimal.Zero;
                ChangeMoney      = dr["ChangeMoney"] != DBNull.Value ? (decimal)dr["ChangeMoney"] : Decimal.Zero;
            }


            lblTotalMoney.Text       = TotalMoney.ToString("N");
            lblTotalChangeMoney.Text = TotalChangeMoney.ToString("N");
            lblChangeMoney.Text      = ChangeMoney.ToString("N");
            lblNewTotalMoney.Text    = NewTotalMoney.ToString("N");
        }
Example #2
0
    public void SaveGameInfo()
    {
        string filePath = Application.persistentDataPath + "/Game.xml";

        if (!File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            //头结点
            XmlElement root = xmlDoc.CreateElement("Game");

            XmlElement localMoney = xmlDoc.CreateElement("TotalMoney");
            localMoney.InnerText = TotalMoney.ToString();
            XmlElement localBgVolume = xmlDoc.CreateElement("BgVolume");
            localBgVolume.InnerText = BgVolume.ToString();
            XmlElement localEffectVolume = xmlDoc.CreateElement("EffectVolume");
            localEffectVolume.InnerText = EffectVolume.ToString();
            XmlElement localLevel2Lock = xmlDoc.CreateElement("Level2Lock");
            localLevel2Lock.InnerText = Level2Lock.ToString();
            XmlElement localLevel3Lock = xmlDoc.CreateElement("Level3Lock");
            localLevel3Lock.InnerText = Level3Lock.ToString();

            root.AppendChild(localMoney);
            root.AppendChild(localBgVolume);
            root.AppendChild(localEffectVolume);
            root.AppendChild(localLevel2Lock);
            root.AppendChild(localLevel3Lock);
            xmlDoc.AppendChild(root);
            xmlDoc.Save(filePath);
        }
    }
Example #3
0
    public void playButtonPressed()
    {
        switch (currentState)
        {
        case GameStatus.next:
            waveNumber++;
            totalEnemies += waveNumber;
            break;

        default:
            // reset everything including labels, towers on screen, total values
            totalEnemies             = 3;
            TotalEscaped             = 0;
            totalMoney               = 10;
            waveNumber               = 1;
            totalMoneyLabel.text     = TotalMoney.ToString();
            enemiesEscapedLabel.text = "Escaped : " + totalEscaped + "/10";
            currentWaveLabel.text    = "Wave " + waveNumber;
            TowerManager.getInstance().renameBuildSiteTag();
            TowerManager.getInstance().destroyAllTowers();
            audioSource.PlayOneShot(SoundManager.getInstance().NewGame);
            break;
        }
        destroyAllEnemies();
        AccessoryManager.getInstance().resetAccessoriesList();
        TotalKilled           = 0;
        RoundEscaped          = 0;
        currentWaveLabel.text = "Wave " + waveNumber;
        StartCoroutine(spawn());
        playButton.gameObject.SetActive(false);
    }
Example #4
0
    public void PlayBtnPressed()
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber++;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies   = 3;
            TotalEscaped   = 0;
            TotalMoney     = 10;
            EnemiesToSpawn = 0;
            YouWin.SetActive(false);
            TowerManager.Instance.DestroyAllTower();
            TowerManager.Instance.RenameTagsBuildSite();
            totalMoneytext.text = TotalMoney.ToString();
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);
            totalEscapedtext.text = "Excaped: " + TotalEscaped + " /10";
            break;
        }
        DestroyAllEnemies();
        TotalKilled          = 0;
        RoundEscaped         = 0;
        CurrentWavetext.text = "Wave: " + (waveNumber + 1);
        StartCoroutine(Spawn());
        PlayBtn.gameObject.SetActive(false);
    }
Example #5
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"CreatedAt = {(CreatedAt == null ? "null" : CreatedAt == string.Empty ? "" : CreatedAt)}");
     toStringOutput.Add($"UpdatedAt = {(UpdatedAt == null ? "null" : UpdatedAt == string.Empty ? "" : UpdatedAt)}");
     toStringOutput.Add($"AmountMoney = {(AmountMoney == null ? "null" : AmountMoney.ToString())}");
     toStringOutput.Add($"TipMoney = {(TipMoney == null ? "null" : TipMoney.ToString())}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"AppFeeMoney = {(AppFeeMoney == null ? "null" : AppFeeMoney.ToString())}");
     toStringOutput.Add($"ProcessingFee = {(ProcessingFee == null ? "null" : $"[{ string.Join(", ", ProcessingFee)} ]")}");
     toStringOutput.Add($"RefundedMoney = {(RefundedMoney == null ? "null" : RefundedMoney.ToString())}");
     toStringOutput.Add($"Status = {(Status == null ? "null" : Status == string.Empty ? "" : Status)}");
     toStringOutput.Add($"DelayDuration = {(DelayDuration == null ? "null" : DelayDuration == string.Empty ? "" : DelayDuration)}");
     toStringOutput.Add($"DelayAction = {(DelayAction == null ? "null" : DelayAction == string.Empty ? "" : DelayAction)}");
     toStringOutput.Add($"DelayedUntil = {(DelayedUntil == null ? "null" : DelayedUntil == string.Empty ? "" : DelayedUntil)}");
     toStringOutput.Add($"SourceType = {(SourceType == null ? "null" : SourceType == string.Empty ? "" : SourceType)}");
     toStringOutput.Add($"CardDetails = {(CardDetails == null ? "null" : CardDetails.ToString())}");
     toStringOutput.Add($"LocationId = {(LocationId == null ? "null" : LocationId == string.Empty ? "" : LocationId)}");
     toStringOutput.Add($"OrderId = {(OrderId == null ? "null" : OrderId == string.Empty ? "" : OrderId)}");
     toStringOutput.Add($"ReferenceId = {(ReferenceId == null ? "null" : ReferenceId == string.Empty ? "" : ReferenceId)}");
     toStringOutput.Add($"CustomerId = {(CustomerId == null ? "null" : CustomerId == string.Empty ? "" : CustomerId)}");
     toStringOutput.Add($"EmployeeId = {(EmployeeId == null ? "null" : EmployeeId == string.Empty ? "" : EmployeeId)}");
     toStringOutput.Add($"RefundIds = {(RefundIds == null ? "null" : $"[{ string.Join(", ", RefundIds)} ]")}");
     toStringOutput.Add($"RiskEvaluation = {(RiskEvaluation == null ? "null" : RiskEvaluation.ToString())}");
     toStringOutput.Add($"BuyerEmailAddress = {(BuyerEmailAddress == null ? "null" : BuyerEmailAddress == string.Empty ? "" : BuyerEmailAddress)}");
     toStringOutput.Add($"BillingAddress = {(BillingAddress == null ? "null" : BillingAddress.ToString())}");
     toStringOutput.Add($"ShippingAddress = {(ShippingAddress == null ? "null" : ShippingAddress.ToString())}");
     toStringOutput.Add($"Note = {(Note == null ? "null" : Note == string.Empty ? "" : Note)}");
     toStringOutput.Add($"StatementDescriptionIdentifier = {(StatementDescriptionIdentifier == null ? "null" : StatementDescriptionIdentifier == string.Empty ? "" : StatementDescriptionIdentifier)}");
     toStringOutput.Add($"ReceiptNumber = {(ReceiptNumber == null ? "null" : ReceiptNumber == string.Empty ? "" : ReceiptNumber)}");
     toStringOutput.Add($"ReceiptUrl = {(ReceiptUrl == null ? "null" : ReceiptUrl == string.Empty ? "" : ReceiptUrl)}");
 }
Example #6
0
    //Control events when play button pressed
    public void playBtnPressed()
    {
        //if currentState = gameStatus.next wave number will increse and total enemy for next round will add up with waveNumber
        //else all things have to be reset
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies   = 4;   //have to be 5
            TotalEscaped   = 0;
            TotalMoney     = 10;
            enemiesToSpawn = 0;
            waveNumber     = 0;
            TowerManager.Instance.DestroyAllTower();
            TowerManager.Instance.RenameBuiltSitesTags();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped " + TotalEscaped + "/" + escapeLimit;
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);
            break;
        }
        //reset parameters for new wave
        DestroyAllEnemies();
        TotalKilled         = 0;
        RoundEscaped        = 0;
        currentWaveLbl.text = "Wave " + (waveNumber + 1);
        //for new wave we have to call spawn again with new values
        StartCoroutine(spawn());
        playBtn.gameObject.SetActive(false);
    }
    public void PlayButtonPressed()
    {
        switch (currentState)
        {
        case GameStatus.Next:
            currentWave += 1;
            if (currentWave <= enemies.Length)
            {
                typeOfEnemies = currentWave;
            }
            totalEnemies += currentWave;
            break;

        default:
            totalEnemies  = 3;
            TotalEscaped  = 0;
            TotalMoney    = 10;
            typeOfEnemies = 0;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped " + TotalEscaped + "/10";
            soundFx.PlayOneShot(SoundManager.Instance.Newgame);
            break;
        }
        DestroyAllEnemies();
        TotalKilled         = RoundEscaped = 0;
        currentWaveLbl.text = "Wave " + (currentWave + 1);
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #8
0
    public void PlayBtnPressed()
    {
        switch (currentState)
        {
        case GameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        // play game for first time or gameover
        default:
            totalEnemies = 3;
            TotalEscaped = 0;
            TotalMoney   = 10;
            //skully spawns at begging
            enemiesToSpawn = 0;
            TowerManager.Instance.DestroyAllTower();
            TowerManager.Instance.RenameTagsBuildSite();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped" + TotalEscaped + "/10";
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);
            break;
        }

        DestroyAllEnemies();
        TotalKilled         = 0; // only cares for this during a wave
        RoundEscaped        = 0; //only cares for this during a wave
        currentWaveLbl.text = "Wave " + (waveNumber + 1);
        //need to spawn enemies:
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #9
0
    public void PlayButtonPressed()   // Вызывается после нажатия Play, устанавливает все начальные значения
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber++;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies         = 1;
            TotalEscaped         = 0;
            TotalMoney           = 10;
            enemiesToSpawn       = 0;
            totalMoneyLabel.text = TotalMoney.ToString();
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagBuildSite();
            totalEscapedLabel.text = "Escaped " + totalEscaped + "/" + totalEnemies;
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);

            break;
        }
        DestroyEnemies();
        RoundEscaped = 0;
        TotalKilled  = 0;

        currentWave.text = "Wave " + (waveNumber);
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #10
0
    public void playBtnPressed()
    {
        //Debug.Log("playBtnPressed, gameStatus = " + currentState);
        GameStatusBtn.gameObject.SetActive(false);
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies   = 3;
            TotalEscaped   = 0;
            waveNumber     = 0;
            enemiesToSpawn = 0;
            TotalMoney     = STARTING_MONEY;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLabel.text = TotalMoney.ToString();
            escapedLabel.text    = "Escaped " + TotalEscaped + "/10";
            GameStatusBtn.gameObject.SetActive(false);
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);
            break;
        }
        DestroyAllEnemies();
        TotalKilled    = 0;
        roundEscaped   = 0;
        waveLabel.text = "Wave " + (waveNumber + 1);
        StartCoroutine(spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #11
0
    public void playBtnPressed()
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies       = 3;
            TotalEscaped       = 0;
            TotalMoney         = 10;
            totalMoneyLbl.text = TotalMoney.ToString();

            TowerManager.Instance.DestroyAllTower();
            TowerManager.Instance.RenameTagsBuildSites();

            totalEscapedLbl.text = "Escaped" + TotalEscaped + "/10";

            audioSource.PlayOneShot(SoundManager.Instance.NewGame);

            break;
        }
        DestroyAllEnemies();
        TotalKilled         = 0;
        RoundEscaped        = 0;
        currentWaveLbl.text = "Wave " + (waveNumber + 1).ToString();
        StartCoroutine(spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #12
0
    public void playBtnPressed()
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies = 3;
            //DEFAULT number of enemies to Spawn: Changeable.
            TotalEscaped = 0;
            TotalMoney   = 10;
            TowerManager.Instance.DestroyAllTower();
            TowerManager.Instance.RenameTagsBuildSite();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped: " + TotalEscaped + "/10";
            break;
        }

        DestroyAllEnemies();
        TotalKilled         = 0;
        RoundEscaped        = 0;
        currentWaveLbl.text = "Wave: " + (waveNumber + 1);
        StartCoroutine(spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #13
0
    public void playBtnPressed()
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber += 1;
            break;

        default:
            waveNumber = 1;
            TowerManager.Instance.destroyAllTowers();
            TowerManager.Instance.renameTagsBildSites();
            TotalEscaped         = 0;
            TotalMoney           = 15;
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped " + TotalEscaped + "/" + totalEnemies;
            audioSource.PlayOneShot(SoundManager.Instance.Newgame);
            break;
        }
        DestroyAllEnemies();
        TotalKilled  = 0;
        RoundEscaped = 0;

        currentWaveLbl.text = "Level " + waveNumber.ToString();
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #14
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"LocationId = {(LocationId == null ? "null" : LocationId == string.Empty ? "" : LocationId)}");
     toStringOutput.Add($"ReferenceId = {(ReferenceId == null ? "null" : ReferenceId == string.Empty ? "" : ReferenceId)}");
     toStringOutput.Add($"Source = {(Source == null ? "null" : Source.ToString())}");
     toStringOutput.Add($"CustomerId = {(CustomerId == null ? "null" : CustomerId == string.Empty ? "" : CustomerId)}");
     toStringOutput.Add($"LineItems = {(LineItems == null ? "null" : $"[{ string.Join(", ", LineItems)} ]")}");
     toStringOutput.Add($"Taxes = {(Taxes == null ? "null" : $"[{ string.Join(", ", Taxes)} ]")}");
     toStringOutput.Add($"Discounts = {(Discounts == null ? "null" : $"[{ string.Join(", ", Discounts)} ]")}");
     toStringOutput.Add($"ServiceCharges = {(ServiceCharges == null ? "null" : $"[{ string.Join(", ", ServiceCharges)} ]")}");
     toStringOutput.Add($"Fulfillments = {(Fulfillments == null ? "null" : $"[{ string.Join(", ", Fulfillments)} ]")}");
     toStringOutput.Add($"Returns = {(Returns == null ? "null" : $"[{ string.Join(", ", Returns)} ]")}");
     toStringOutput.Add($"ReturnAmounts = {(ReturnAmounts == null ? "null" : ReturnAmounts.ToString())}");
     toStringOutput.Add($"NetAmounts = {(NetAmounts == null ? "null" : NetAmounts.ToString())}");
     toStringOutput.Add($"RoundingAdjustment = {(RoundingAdjustment == null ? "null" : RoundingAdjustment.ToString())}");
     toStringOutput.Add($"Tenders = {(Tenders == null ? "null" : $"[{ string.Join(", ", Tenders)} ]")}");
     toStringOutput.Add($"Refunds = {(Refunds == null ? "null" : $"[{ string.Join(", ", Refunds)} ]")}");
     toStringOutput.Add($"Metadata = {(Metadata == null ? "null" : Metadata.ToString())}");
     toStringOutput.Add($"CreatedAt = {(CreatedAt == null ? "null" : CreatedAt == string.Empty ? "" : CreatedAt)}");
     toStringOutput.Add($"UpdatedAt = {(UpdatedAt == null ? "null" : UpdatedAt == string.Empty ? "" : UpdatedAt)}");
     toStringOutput.Add($"ClosedAt = {(ClosedAt == null ? "null" : ClosedAt == string.Empty ? "" : ClosedAt)}");
     toStringOutput.Add($"State = {(State == null ? "null" : State.ToString())}");
     toStringOutput.Add($"Version = {(Version == null ? "null" : Version.ToString())}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"TotalTaxMoney = {(TotalTaxMoney == null ? "null" : TotalTaxMoney.ToString())}");
     toStringOutput.Add($"TotalDiscountMoney = {(TotalDiscountMoney == null ? "null" : TotalDiscountMoney.ToString())}");
     toStringOutput.Add($"TotalTipMoney = {(TotalTipMoney == null ? "null" : TotalTipMoney.ToString())}");
     toStringOutput.Add($"TotalServiceChargeMoney = {(TotalServiceChargeMoney == null ? "null" : TotalServiceChargeMoney.ToString())}");
     toStringOutput.Add($"PricingOptions = {(PricingOptions == null ? "null" : PricingOptions.ToString())}");
     toStringOutput.Add($"Rewards = {(Rewards == null ? "null" : $"[{ string.Join(", ", Rewards)} ]")}");
 }
Example #15
0
    public void PlayButton_Pressed()
    {
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            TotalEnemies += waveNumber + 1;
            break;

        default:
            TotalEnemies = 3;
            TotalEscaped = 0;
            TotalMoney   = 10;
            TowerManager.Instace.DestroyAllTowers();
            TowerManager.Instace.RenameTagsBuildSites();
            totalMoneyLbl.text  = TotalMoney.ToString();
            totalEscapeLbl.text = "Escaped " + TotalEscaped + "/10";
            audioSource.PlayOneShot(SoundManager.Instace.NewGame);
            break;
        }
        DistroyAllEnemies();
        TotalKills         = 0;
        RoundEscaped       = 0;
        curentWaveLbl.text = "Wave " + (waveNumber + 1);
        //Mic delay de 2 secunde la inceput :)
        StartCoroutine(WaitForSeconds(2));

        playButton.gameObject.SetActive(false);
        ShowTowers(true);

        //SartSpawning
        StartCoroutine(SpawnEnemyInterval());
    }
Example #16
0
    public void PlayBtnPressed()
    {
        switch (currentState)
        {
        case GameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies = 3;
            TotalEscaped = 0;
            totalMoney   = 10;
            TowerController.Shared.DestroyAllTowers();
            TowerController.Shared.RenametagsBuildSite();
            totalMoneyLbl.text  = TotalMoney.ToString();
            totalEscapeLbl.text = "Escaped: " + TotalEscaped.ToString();
            audioSource.PlayOneShot(SoundController.Shared.NewGame);
            break;
        }

        DestroyAllEnemies();
        totalKilled         = 0;
        RoundEscaped        = 0;
        currentWaveLbl.text = "Wave " + (waveNumber + 1);
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #17
0
    public void playButtonPressed()
    {
        Debug.Log("pressed");
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies = 3;
            totalEscaped = 0;
            TotalMoney   = 40;
            waveNumber   = 0;
            TowerManager.Instance.destroyAllTowers();
            TowerManager.Instance.renameBuildsiteTags();
            lblTotalMoney.text   = TotalMoney.ToString();
            lblTotalEscaped.text = $"Escaped {TotalEscaped}/10";
            enemiesToSpawn       = 0;
            break;
        }

        DestroyAllEnemies();
        TotalKilled         = 0;
        WaveEscaped         = 0;
        lblCurrentWave.text = $" Wave {waveNumber + 1}";
        StartCoroutine(EnemySpawner());
        playButton.gameObject.SetActive(false);
    }
Example #18
0
    public void PlayButtonPressed()
    {
        switch (currentStatus)
        {
        case GameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        default:
            totalEnemies = 5;
            TotalEscaped = 0;
            TotalMoney   = 10;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagBuildSide();
            totalMoneyLabel.text   = TotalMoney.ToString();
            totalEscapedLabel.text = TotalEscaped + " / 10";
            break;
        }
        DestroyEnemies();
        TotalKilled      = 0;
        RoundEscaped     = 0;
        currentWave.text = "Wave " + (waveNumber + 1);
        StartCoroutine(Spawn());
        playBtn.gameObject.SetActive(false);
    }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"TaxMoney = {(TaxMoney == null ? "null" : TaxMoney.ToString())}");
     toStringOutput.Add($"DiscountMoney = {(DiscountMoney == null ? "null" : DiscountMoney.ToString())}");
     toStringOutput.Add($"TipMoney = {(TipMoney == null ? "null" : TipMoney.ToString())}");
     toStringOutput.Add($"ServiceChargeMoney = {(ServiceChargeMoney == null ? "null" : ServiceChargeMoney.ToString())}");
 }
Example #20
0
        /// <summary>
        /// 装载控件数据
        /// </summary>
        public void LoadData()
        {
            try
            {
                string projectCode = Request["ProjectCode"] + "";
                string paymentCode = Request["PaymentCode"] + "";

                EntityData entity = DAL.EntityDAO.PaymentDAO.GetStandard_PaymentByCode(paymentCode);

                if (entity.HasRecord())
                {
                    string     contractCode = entity.GetString("ContractCode");
                    EntityData entityCon    = DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(contractCode);
                    if (entityCon.HasRecord())
                    {
                        lblProjectName.Text  = BLL.ProjectRule.GetProjectName(projectCode);
                        lblContractName.Text = entityCon.GetString("ContractName");
                        lblContractID.Text   = entityCon.GetString("ContractID");
                        lblSupplierName.Text = entity.GetString("SupplyName");
                        lblCheckOpinion.Text = HttpUtility.HtmlEncode(entity.GetString("CheckOpinion")).Replace("\n", "<br>");

                        //显示合同金额
                        decimal TotalMoney, TotalChangeMoney, ChangeMoney, OriginalMoney, BudgetMoney, AdjustMoney, NewTotalMoney;

                        TotalMoney    = entityCon.GetDecimal("TotalMoney");
                        OriginalMoney = entityCon.GetDecimal("OriginalMoney");
                        BudgetMoney   = entityCon.GetDecimal("BudgetMoney");
                        AdjustMoney   = entityCon.GetDecimal("AdjustMoney");

                        TotalChangeMoney = TotalMoney - OriginalMoney;
                        ChangeMoney      = BLL.MathRule.SumColumn(entityCon.Tables["ContractChange"].Select("Status in ( 1,2)", "", System.Data.DataViewRowState.CurrentRows), "ChangeMoney");
                        NewTotalMoney    = TotalMoney + ChangeMoney;


                        lblTotalMoney.Text       = TotalMoney.ToString("N");
                        lblTotalChangeMoney.Text = TotalChangeMoney.ToString("N");
                        lblChangeMoney.Text      = ChangeMoney.ToString("N");
                        lblNewTotalMoney.Text    = NewTotalMoney.ToString("N");
                    }

                    decimal negAHMoney, TotalItemMoney, TotalPayMoney;

                    TotalItemMoney = entity.GetDecimal("Money");
                    negAHMoney     = -BLL.CBSRule.GetAHMoney("", "", "", contractCode, "1", "");
                    TotalPayMoney  = TotalItemMoney - negAHMoney;


                    lblTotalPayMoney.Text  = TotalPayMoney.ToString("N");
                    lblNegAHMoney.Text     = negAHMoney.ToString("N");
                    lblTotalItemMoney.Text = TotalItemMoney.ToString("N");
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"InitiatedAt = {(InitiatedAt == null ? "null" : InitiatedAt == string.Empty ? "" : InitiatedAt)}");
     toStringOutput.Add($"BankAccountId = {(BankAccountId == null ? "null" : BankAccountId == string.Empty ? "" : BankAccountId)}");
     toStringOutput.Add($"Entries = {(Entries == null ? "null" : $"[{ string.Join(", ", Entries)} ]")}");
 }
Example #22
0
    public void playBtnPressed()
    {
        if (pause == false)
        {
            int enemyId = 0;
            switch (currentState)
            {
            case GameStatus.next:
                waveNumber++;
                if (waveNumber >= 0 && waveNumber < 4)
                {
                    totalEnemies += 2;
                    enemyId       = 0;
                }
                else if (waveNumber >= 4 && waveNumber < 7)
                {
                    totalEnemies += 1;
                    enemyId       = 1;
                }
                else if (waveNumber >= 7 && waveNumber < 9)
                {
                    totalEnemies += 2;
                    enemyId       = 1;
                }
                else if (waveNumber >= 9 && waveNumber < 11)
                {
                    totalEnemies += 1;
                    enemyId       = 2;
                }
                else if (waveNumber >= 11)
                {
                    totalEnemies += 2;
                    enemyId       = 2;
                }
                break;

            default:
                totalEnemies         = 6;
                totalEscaped         = 0;
                TotalMoney           = 10;
                totalMoneyLbl.text   = TotalMoney.ToString();
                totalEscapedLbl.text = "Escaped: " + totalEscaped.ToString() + "/10";
                TowerManager.Instance.destroyAllTowers();
                TowerManager.Instance.renameTagsBuildSite();
                audioSource.PlayOneShot(SoundManager.Instance.NewGame);
                break;
            }
            DestroyAllEnemies();
            totalKilled         = 0;
            roundEscaped        = 0;
            currentWaveLbl.text = "Wave " + (waveNumber + 1);
            StartCoroutine(spawn(enemyId));
            playButton.gameObject.SetActive(false);
            TowerManager.Instance.destroyAllProjectiles();
        }
    }
Example #23
0
    public void PlayButtonPressed()
    {
        switch (currentState)
        {
        case GameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        case GameStatus.gameover:
            totalEnemies        = 3;
            totalEscaped        = 0;
            totalMoney          = 10;
            waveNumber          = 0;
            whichEnemiesToSpawn = 0;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped " + TotalEscaped + " /10";
            break;

        case GameStatus.win:
            totalEnemies        = 5;
            totalEscaped        = 0;
            totalMoney          = 20;
            waveNumber          = 0;
            whichEnemiesToSpawn = 0;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLbl.text = TotalMoney.ToString();

            totalEscapedLbl.text = "Escaped " + TotalEscaped + " /10";
            break;

        default:
            totalEnemies = 3;
            totalEscaped = 0;
            totalMoney   = 10;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLbl.text   = TotalMoney.ToString();
            totalEscapedLbl.text = "Escaped " + TotalEscaped + " /10";
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);
            //play one shot ensures to complete the sound before playing another
            break;
        }
        DestroyAllEnemies();
        TotalKilled         = 0;
        RoundEscaped        = 0;
        currentWaveLbl.text = "Wave " + (waveNumber + 1);
        StartCoroutine(Spawn());
        playButton.gameObject.SetActive(false);
    }
Example #24
0
    // Start is called before the first frame update
    void Start()
    {
        LoadParams();
        ManagerScene.Instance.GeneratePath();

        Waves = ManagerScene.Instance.SetWaves();
        SetPossibleEnemies();
        Health = TotalHealth;
        totalMoneyLabel.text = TotalMoney.ToString();
        healthLabel.text     = TotalHealth.ToString();
        playBtn.gameObject.SetActive(false);
        AudioSrc = GetComponent <AudioSource>();
        ShowMenu();
    }
Example #25
0
 private void PlayAgain()
 {
     audioSource.PlayOneShot(SoundManager.Instance.NewGameSFX);
     totalEnemies        = 3;                                                  //enemy start count
     EnemyToSpawn        = 0;                                                  //spawns lowest strength enemies
     TotalEscapedEnemies = 0;                                                  //starting live or amount of enemies lost
     waveNumber          = 0;                                                  //reset wave number to zero
     TotalMoney          = 10;                                                 //starting money
     TotalScore          = 0;                                                  //starting score
     TowerManager.Instance.DestroyAllTowers();                                 //clears board of all towers
     TowerManager.Instance.RenameBuildSiteTags();                              //resets all build tiles so player can build on them
     moneyTextLabel.text          = TotalMoney.ToString();                     //displays money
     escapedEnemiesTextLabel.text = "Escaped " + TotalEscapedEnemies + " /10"; //displays label ui text
     gameOverDisplay.gameObject.SetActive(false);
 }
Example #26
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Uid = {(Uid == null ? "null" : Uid == string.Empty ? "" : Uid)}");
     toStringOutput.Add($"SourceServiceChargeUid = {(SourceServiceChargeUid == null ? "null" : SourceServiceChargeUid == string.Empty ? "" : SourceServiceChargeUid)}");
     toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}");
     toStringOutput.Add($"CatalogObjectId = {(CatalogObjectId == null ? "null" : CatalogObjectId == string.Empty ? "" : CatalogObjectId)}");
     toStringOutput.Add($"Percentage = {(Percentage == null ? "null" : Percentage == string.Empty ? "" : Percentage)}");
     toStringOutput.Add($"AmountMoney = {(AmountMoney == null ? "null" : AmountMoney.ToString())}");
     toStringOutput.Add($"AppliedMoney = {(AppliedMoney == null ? "null" : AppliedMoney.ToString())}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"TotalTaxMoney = {(TotalTaxMoney == null ? "null" : TotalTaxMoney.ToString())}");
     toStringOutput.Add($"CalculationPhase = {(CalculationPhase == null ? "null" : CalculationPhase.ToString())}");
     toStringOutput.Add($"Taxable = {(Taxable == null ? "null" : Taxable.ToString())}");
     toStringOutput.Add($"AppliedTaxes = {(AppliedTaxes == null ? "null" : $"[{ string.Join(", ", AppliedTaxes)} ]")}");
 }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}");
     toStringOutput.Add($"Quantity = {(Quantity == null ? "null" : Quantity.ToString())}");
     toStringOutput.Add($"ItemizationType = {(ItemizationType == null ? "null" : ItemizationType.ToString())}");
     toStringOutput.Add($"ItemDetail = {(ItemDetail == null ? "null" : ItemDetail.ToString())}");
     toStringOutput.Add($"Notes = {(Notes == null ? "null" : Notes == string.Empty ? "" : Notes)}");
     toStringOutput.Add($"ItemVariationName = {(ItemVariationName == null ? "null" : ItemVariationName == string.Empty ? "" : ItemVariationName)}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"SingleQuantityMoney = {(SingleQuantityMoney == null ? "null" : SingleQuantityMoney.ToString())}");
     toStringOutput.Add($"GrossSalesMoney = {(GrossSalesMoney == null ? "null" : GrossSalesMoney.ToString())}");
     toStringOutput.Add($"DiscountMoney = {(DiscountMoney == null ? "null" : DiscountMoney.ToString())}");
     toStringOutput.Add($"NetSalesMoney = {(NetSalesMoney == null ? "null" : NetSalesMoney.ToString())}");
     toStringOutput.Add($"Taxes = {(Taxes == null ? "null" : $"[{ string.Join(", ", Taxes)} ]")}");
     toStringOutput.Add($"Discounts = {(Discounts == null ? "null" : $"[{ string.Join(", ", Discounts)} ]")}");
     toStringOutput.Add($"Modifiers = {(Modifiers == null ? "null" : $"[{ string.Join(", ", Modifiers)} ]")}");
 }
Example #28
0
    public void playBtnPressed(bool userClickedEscape)
    {
        GameStatusBtn.gameObject.SetActive(false);
        Debug.Log("playBtnPressed, currentState = " + currentState);
        switch (currentState)
        {
        case gameStatus.next:
            waveNumber   += 1;
            totalEnemies += waveNumber;
            break;

        case gameStatus.gameover:
            totalEnemies   = 3;
            TotalEscaped   = 0;
            waveNumber     = 0;
            enemiesToSpawn = 0;
            TotalMoney     = STARTING_MONEY;
            TowerManager.Instance.DestroyAllTowers();
            TowerManager.Instance.RenameTagsBuildSites();
            totalMoneyLabel.text = TotalMoney.ToString();
            escapedLabel.text    = "Escaped " + TotalEscaped + "/" + maxAllowedEscaped;
            GameStatusBtn.gameObject.SetActive(false);
            audioSource.PlayOneShot(SoundManager.Instance.NewGame);

            if (!userClickedEscape)
            {
                currentState = gameStatus.play;
            }
            break;

        case gameStatus.win:
            Debug.Log("win");
            TowerManager.Instance.DestroyAllTowers();
            StartCoroutine(unloadSceneWithData(true));
            break;
        }
        DestroyAllEnemies();
        TotalKilled  = 0;
        roundEscaped = 0;
        Debug.Log("wave number = " + waveNumber);
        waveLabel.text = "Wave " + (waveNumber + 1);
        StartCoroutine(spawn());
        playBtn.gameObject.SetActive(false);
    }
Example #29
0
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"Type = {(Type == null ? "null" : Type.ToString())}");
     toStringOutput.Add($"Name = {(Name == null ? "null" : Name == string.Empty ? "" : Name)}");
     toStringOutput.Add($"EmployeeId = {(EmployeeId == null ? "null" : EmployeeId == string.Empty ? "" : EmployeeId)}");
     toStringOutput.Add($"ReceiptUrl = {(ReceiptUrl == null ? "null" : ReceiptUrl == string.Empty ? "" : ReceiptUrl)}");
     toStringOutput.Add($"CardBrand = {(CardBrand == null ? "null" : CardBrand.ToString())}");
     toStringOutput.Add($"PanSuffix = {(PanSuffix == null ? "null" : PanSuffix == string.Empty ? "" : PanSuffix)}");
     toStringOutput.Add($"EntryMethod = {(EntryMethod == null ? "null" : EntryMethod.ToString())}");
     toStringOutput.Add($"PaymentNote = {(PaymentNote == null ? "null" : PaymentNote == string.Empty ? "" : PaymentNote)}");
     toStringOutput.Add($"TotalMoney = {(TotalMoney == null ? "null" : TotalMoney.ToString())}");
     toStringOutput.Add($"TenderedMoney = {(TenderedMoney == null ? "null" : TenderedMoney.ToString())}");
     toStringOutput.Add($"TenderedAt = {(TenderedAt == null ? "null" : TenderedAt == string.Empty ? "" : TenderedAt)}");
     toStringOutput.Add($"SettledAt = {(SettledAt == null ? "null" : SettledAt == string.Empty ? "" : SettledAt)}");
     toStringOutput.Add($"ChangeBackMoney = {(ChangeBackMoney == null ? "null" : ChangeBackMoney.ToString())}");
     toStringOutput.Add($"RefundedMoney = {(RefundedMoney == null ? "null" : RefundedMoney.ToString())}");
     toStringOutput.Add($"IsExchange = {(IsExchange == null ? "null" : IsExchange.ToString())}");
 }
Example #30
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            scoreText.Text     = Score.ToString("N0");
            highScoreText.Text = HighScore.ToString("N0");
            int realtimeMoney = GameSettingHelper.GetMoney();

            if (TotalMoney != realtimeMoney - AdditionMoney)
            {
                totalMoneyText.Text       = GameSettingHelper.GetMoney().ToString("N0");
                additionMoneyText.Visible = false;
            }
            else
            {
                totalMoneyText.Text    = TotalMoney.ToString("N0");
                additionMoneyText.Text = "+ " + AdditionMoney.ToString("N0");
            }
        }