TheAirline.GUIModel.PagesModel.AirlinersPageModel.AirlinerOrdersMVVM.orderUpdated C# (CSharp) Метод

orderUpdated() публичный Метод

public orderUpdated ( ) : void
Результат void
        public void orderUpdated()
        {
            long price = this.Orders.Sum(o => o.getOrderPrice());

            this.Discount =
                Convert.ToInt64(price * (GeneralHelpers.GetAirlinerOrderDiscount(this.Orders.Sum(o => o.Amount)) / 100));

            if (GameObject.GetInstance().HumanAirline.Contract != null && this.Orders.Count > 0
                && GameObject.GetInstance().HumanAirline.Contract.Manufacturer == this.Orders.First().Type.Manufacturer)
            {
                this.Discount += Convert.ToInt64(
                    price * (GameObject.GetInstance().HumanAirline.Contract.Discount / 100));
            }

            this.TotalAmount = price - this.Discount;

            this.DeliveryDate = this.getDeliveryDate();
        }