Exemplo n.º 1
0
        public async Task <IEnumerable <CarJoinClientModelBll> > JoinServicesClientCar()
        {
            var client = Mapper.Map <IEnumerable <ClientInfoBll> >(await _clientInfo.ClientInfoAll());
            var car    = Mapper.Map <IEnumerable <ClientsOfCarWashBll> >(await _clientsOfCarWash.GetAll());

            var resultJoin = (from t1 in client
                              join t2 in car on t1.Id equals t2.IdInfoClient
                              where t2.arxiv == true
                              select new CarJoinClientModelBll()
            {
                idCar = t2.id,
                idClien = t1.Id,
                IdClientsGroups = t2.ClientsGroups.Name,
                Surname = t1.Surname,
                Name = t1.Name,
                PatronymicName = t1.PatronymicName,
                phone = t1.Phone,
                DateRegistration = t1.DateRegistration,
                Email = t1.Email,
                discont = t2.discont,
                carMarkName = t2.car_mark.name,
                carModelName = t2.car_model.name,
                carBodyName = t2.CarBody.Name,
                NumberCar = t2.NumberCar
            });

            return(resultJoin.AsEnumerable());
        }
Exemplo n.º 2
0
        public async Task RemoveClientCar(int ClientId)
        {
            await _clientInfo.Delete(Mapper.Map <ClientInfoBll>(await _unitOfWork.ClientInfoUnitOfWork.GetById(ClientId)));

            var removeCarClient = await _clientsOfCarWash.GetAll(ClientId);

            foreach (var item in removeCarClient)
            {
                await _clientsOfCarWash.Delete(item);
            }
        }
        // Autocomplete Textbox - NumberCar
        public async Task <JsonResult> GetName(string searchInput)
        {
            var washWorkersViews = Mapper.Map <IEnumerable <ClientsOfCarWashView> >(await _clientsOfCarWash.GetAll(searchInput));

            List <ClientsOfCarWashView> washWorkersViewsList = washWorkersViews.Select(x => new ClientsOfCarWashView
            {
                id        = x.id,
                NumberCar = x.NumberCar
            }).ToList();

            return(new JsonResult {
                Data = washWorkersViewsList, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 4
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));
        }
 private async Task <IEnumerable <ClientsOfCarWashView> > ClientSearch()
 {
     return(Mapper.Map <IEnumerable <ClientsOfCarWashView> >(await _services.GetAll()));
 }