// GET: TireStorageServices
 public async Task <ActionResult> Price()
 {
     return(View(Mapper.Map <IEnumerable <TireStorageServicesView> >(await _tireStorageServices.GetTableAll())));
 }
        public async Task <ReviwOrderModelBll> ReviwOrder(OrderTireStorageModelBll tireStorage)
        {
            var servicesTireStorage = await _tireStorageServices.GetTableAll();

            var detailing = await _detailings.GetPriceGroupWashServices(20);

            reviwOrder.tireStorageServices = new List <TireStorageServicesBll>();

            // наличие дисков
            if (tireStorage.discAvailability != null)
            {
                var resultPriceDisk = servicesTireStorage.Single(x => x.Id == 16);
                AddTireStoregeService(resultPriceDisk);
                reviwOrder.priceDisk = (double)tireStorage.quantity * resultPriceDisk.Price.Value;
            }

            // время хранения
            if (tireStorage.storageTime == 6)
            {
                // количество шин для хранения
                if (tireStorage.quantity == 4)
                {
                    TireStorageServicesBll priceResult = PriceRadius(tireStorage.radius, 4, servicesTireStorage, 6);
                    AddTireStoregeService(priceResult);
                    radius = priceResult.radius.Value;
                    reviwOrder.priceOfTire = priceResult.Price.Value;
                }
                else if (tireStorage.quantity < 4)
                {
                    TireStorageServicesBll priceResult = PriceRadius(tireStorage.radius, 1, servicesTireStorage);
                    AddTireStoregeService(priceResult);
                    radius = priceResult.radius.Value;
                    reviwOrder.priceOfTire = priceResult.Price.Value * (double)tireStorage.quantity;
                }
            }
            else
            {
                // количество шин для хранения если время хранение меньше 6 месяцев ()

                TireStorageServicesBll priceResult = PriceRadius(tireStorage.radius, 1, servicesTireStorage);
                AddTireStoregeService(priceResult);
                radius = priceResult.radius.Value;
                reviwOrder.priceOfTire = priceResult.Price.Value * (double)tireStorage.quantity;
            }

            // Мойка колес (шт)
            if (tireStorage.wheelWash != null)
            {
                if (tireStorage.wheelWash == 4)
                {
                    var wheelWashPrice = servicesTireStorage.Single(x => x.Id == 9);
                    AddTireStoregeService(wheelWashPrice);
                    reviwOrder.priceWheelWash = wheelWashPrice.Price.Value;
                    reviwOrder.IdWheelWash    = wheelWashPrice.Id;
                }
                else if (tireStorage.wheelWash < 4)
                {
                    var wheelWashPrice = servicesTireStorage.Single(x => x.Id == 9);
                    AddTireStoregeService(wheelWashPrice);
                    reviwOrder.priceWheelWash = wheelWashPrice.Price.Value * (double)tireStorage.wheelWash;
                    reviwOrder.IdWheelWash    = wheelWashPrice.Id;
                }
            }

            // Количество пакетов
            if (tireStorage.tireStorageBags != null)
            {
                var packets = servicesTireStorage.Single(x => x.Id == 7);
                AddTireStoregeService(packets);
                reviwOrder.priceNumberOfPackets = (double)tireStorage.tireStorageBags * packets.Price.Value;
            }

            // Селикон
            if (tireStorage.silicone != null)
            {
                if (tireStorage.silicone == 4)
                {
                    var siliconePrice = servicesTireStorage.Single(x => (x.radius == radius) && (x.amount == 4) && (x.ServicesName.Contains("обработать селиконом")));
                    AddTireStoregeService(siliconePrice);
                    reviwOrder.priceSilicone   = siliconePrice.Price.Value;
                    reviwOrder.IdpriceSilicone = siliconePrice.Id;
                }
                else if (tireStorage.silicone < 4)
                {
                    var siliconePrice = servicesTireStorage.Single(x => (x.radius == radius) && (x.amount == 1) && (x.ServicesName.Contains("обработать селиконом")));
                    AddTireStoregeService(siliconePrice);
                    reviwOrder.priceSilicone   = siliconePrice.Price.Value * (double)tireStorage.silicone;
                    reviwOrder.IdpriceSilicone = siliconePrice.Id;
                }
            }

            return(reviwOrder);
        }