Ejemplo n.º 1
0
        private void UpdateLabelPayments()
        {
            if (ClientPayments.ClientPaymentsTable.Rows.Count >= 1)
            {
                foreach (DataRow Row in ClientPayments.ClientPaymentsTable.Rows)
                {
                    if (Row["CurrencyTypeID"].ToString() == "1")
                    {
                        ClientPayments.SummMoneyEURPayments();
                        NameLabel.Text = "Евро";

                        TotalLabel.Text       = ClientPayments.CostEUR.ToString("N", nfi1);
                        SumShipmentLabel.Text = ClientPayments.CostEURShipping.ToString("N", nfi1);
                        SumPaymentLabel.Text  = ClientPayments.CostEURPayment.ToString("N", nfi1);
                    }

                    if (Row["CurrencyTypeID"].ToString() == "2")
                    {
                        ClientPayments.SummMoneyUSDPayments();
                        NameLabel.Text        = "Доллар";
                        TotalLabel.Text       = ClientPayments.CostUSD.ToString("N", nfi1);
                        SumShipmentLabel.Text = ClientPayments.CostUSDShipping.ToString("N", nfi1);
                        SumPaymentLabel.Text  = ClientPayments.CostUSDPayment.ToString("N", nfi1);
                    }

                    if (Row["CurrencyTypeID"].ToString() == "3")
                    {
                        ClientPayments.SummMoneyRURPayments();
                        NameLabel.Text        = "Рубль(RUR)";
                        TotalLabel.Text       = ClientPayments.CostRUR.ToString("N", nfi1);
                        SumShipmentLabel.Text = ClientPayments.CostRURShipping.ToString("N", nfi1);
                        SumPaymentLabel.Text  = ClientPayments.CostRURPayment.ToString("N", nfi1);
                    }

                    if (Row["CurrencyTypeID"].ToString() == "5")
                    {
                        ClientPayments.SummMoneyBYRPayments();
                        NameLabel.Text        = "Рубль(BYN)";
                        TotalLabel.Text       = ClientPayments.CostBYR.ToString("N", nfi1);
                        SumShipmentLabel.Text = ClientPayments.CostBYRShipping.ToString("N", nfi1);
                        SumPaymentLabel.Text  = ClientPayments.CostBYRPayment.ToString("N", nfi1);
                    }
                }
            }
            else
            {
                NameLabel.Text        = "";
                TotalLabel.Text       = "";
                SumShipmentLabel.Text = "";
                SumPaymentLabel.Text  = "";
            }
        }