private void PrepareEditWindowModel <T>(RequestEditWindowModel <T> editWindowModel) where T : class
        {
            editWindowModel.Stores = new RequestEditWindowStoresModel();

            editWindowModel.Stores.Customers = _requestService.GetAllOrderedCustomerModels(null)
                                               .Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = $"{x.Name}, {x.ContactPersonPhone}"
            })
                                               .ToList()
                                               .AddEmptyElement("Ввести вручную");

            editWindowModel.Stores.Cars = _carService.GetAllCarModels(null)
                                          .Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = $"{x.Mark} {x.Number}"
            })
                                          .ToList()
                                          .AddEmptyElement();

            editWindowModel.Stores.Containers = _containerService.GetAllContainerModels(null)
                                                .Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = $"{x.Number} ({x.ContainerType.Name})"
            })
                                                .ToList()
                                                .AddEmptyElement();

            editWindowModel.Stores.Drivers = _driverService.GetAllDriverModels(null)
                                             .Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = x.Name
            })
                                             .ToList()
                                             .AddEmptyElement();

            editWindowModel.Stores.Polygons = _polygonService.GetAllPolygonModels(null)
                                              .Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = x.Name
            })
                                              .ToList()
                                              .AddEmptyElement();

            editWindowModel.Stores.RequestStatuses = Enum.GetValues(typeof(RequestStatus))
                                                     .Cast <RequestStatus>()
                                                     .Select(x => new SelectListItem {
                Value = x.ToString(), Text = x.GetDescription()
            })
                                                     .ToList();

            editWindowModel.Stores.RequestTypes = Enum.GetValues(typeof(RequestType))
                                                  .Cast <RequestType>()
                                                  .Select(x => new SelectListItem {
                Value = x.ToString(), Text = x.GetDescription()
            })
                                                  .ToList();

            editWindowModel.Stores.PaymentTypes = Enum.GetValues(typeof(PaymentType))
                                                  .Cast <PaymentType>()
                                                  .Select(x => new SelectListItem {
                Value = x.ToString(), Text = x.GetDescription()
            })
                                                  .ToList();
        }
        // GET: Containers
        public ActionResult Index()
        {
            var model = _containertService.GetAllContainerModels(null);

            ViewBag.TotalCount     = model.Count;
            ViewBag.FreeCount      = model.Count(x => x.Status == ContainerStatus.Free);
            ViewBag.InstalledCount = model.Count(x => x.Status == ContainerStatus.Installed);

            ViewBag.CountByType = model
                                  .GroupBy(x => x.ContainerType?.Name)
                                  .OrderBy(x => x.Key)
                                  .Select(x => $" {x.Key}: {x.Sum(s => 1)} шт.")
                                  .ToList();

            return(View(model));
        }
        public HttpResponseMessage GetList([FromUri] StoreLoadParams storeLoadParams = null)
        {
            var result = containerService.GetAllContainerModels(storeLoadParams);

            return(Success(result));
        }