public async Task <OrderColorModel> OrderingColor(int idClient)
        {
            OrderColorModel orderColor = new OrderColorModel();

            orderColor.nameGroup = await _groupColor.GetTableAll();

            orderColor.priceColor = await _priceColor.GetTableAll();

            orderColor.clientInfo = await _clientInfo.ClientInfoGetId(idClient);

            return(orderColor);
        }
Exemplo n.º 2
0
        // GET: ClientInfo/Details/5
        public async Task <ActionResult> ClientDetails(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ClientInfoView clientInfoView = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(id));
            var            clientCar      = Mapper.Map <IEnumerable <ClientsOfCarWashView> >(await _clientsOfCarWash.GetAll(id));

            if (clientCar != null)
            {
                ViewBag.ClientCar = clientCar;
            }

            if (clientInfoView == null)
            {
                return(HttpNotFound());
            }
            return(View(clientInfoView));
        }
        //-----------------------------------------------

        public async Task <ActionResult> EditClient(int?id, int?idCar)
        {
            if (id == null && idCar == null)
            {
                var infoLog = new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                return(RedirectToAction("Client"));
            }

            ClientInfoView       clientInfo   = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(id));
            ClientsOfCarWashView clientsOfCar = Mapper.Map <ClientsOfCarWashView>(await _services.GetId(idCar));

            ViewBag.Group    = new SelectList(await _clientsGroups.GetClientsGroups(), "Id", "Name", clientsOfCar.IdClientsGroups);
            ViewBag.IdClient = id;
            ViewBag.IdCar    = idCar;

            if (clientInfo == null)
            {
                return(HttpNotFound());
            }

            return(View(clientInfo));
        }
        // GET: OrderCarpetWashing/Create
        public async Task <ActionResult> AddOrderCarpetWashing(int?idClient)
        {
            if (idClient == null)
            {
                return(Redirect("/ClientsOfCarWashViews/ClientCarpetWashing"));
            }

            var client              = Mapper.Map <ClientInfoView>(await _clientInfo.ClientInfoGetId(idClient.Value));
            var brigadeForToday     = Mapper.Map <IEnumerable <BrigadeForTodayView> >(await _brigadeForToday.GetDateTimeNow());
            var resultServisesPrice = Mapper.Map <DetailingsView>(await _detailings.GetId(87));

            TempData["priseServis"] = resultServisesPrice.S;

            ViewBag.Client        = client;
            ViewBag.Adninistrator = brigadeForToday.Where(x => x.StatusId < 3);
            ViewBag.Brigade       = brigadeForToday.Where(x => x.StatusId == 3);
            ViewBag.Servises      = resultServisesPrice;

            return(View());
        }