Ejemplo n.º 1
0
        public async Task <int> Insert(ClientsOfCarWashBll AddCliens)
        {
            ClientsOfCarWash clientsOfCarWash = TransformAnEntity(AddCliens);

            _unitOfWork.ClientsOfCarWashUnitOfWork.Insert(clientsOfCarWash);

            await _unitOfWork.Save();

            return(clientsOfCarWash.id);
        }
Ejemplo n.º 2
0
        public async Task <int> Distribute(ClientViewsBll client)

        {
            ClientsOfCarWashBll clientsOfCarWash = new ClientsOfCarWashBll();
            ClientInfoBll       clientInfoBll    = new ClientInfoBll();

            clientInfoBll.Name             = client.Name;
            clientInfoBll.Surname          = client.Surname;
            clientInfoBll.PatronymicName   = client.PatronymicName;
            clientInfoBll.Phone            = client.phone;
            clientInfoBll.DateRegistration = client.DateRegistration;
            clientInfoBll.Email            = client.Email;
            clientInfoBll.barcode          = client.barcode;
            clientInfoBll.note             = client.note;

            ClientInfo clientInfo = Mapper.Map <ClientInfoBll, ClientInfo>(clientInfoBll);

            _unitOfWork.ClientInfoUnitOfWork.Insert(clientInfo);
            await _unitOfWork.Save();

            clientsOfCarWash.IdBody          = client.IdBody;
            clientsOfCarWash.IdClientsGroups = client.IdClientsGroups;
            clientsOfCarWash.IdInfoClient    = clientInfo.Id;
            clientsOfCarWash.IdMark          = client.Idmark;
            clientsOfCarWash.IdModel         = client.Idmodel;
            clientsOfCarWash.IdBody          = client.IdBody;
            clientsOfCarWash.NumberCar       = client.NumberCar;
            clientsOfCarWash.discont         = client.discont;
            clientsOfCarWash.arxiv           = true;

            ClientsOfCarWash clientsOfCar = Mapper.Map <ClientsOfCarWashBll, ClientsOfCarWash>(clientsOfCarWash);

            _unitOfWork.ClientsOfCarWashUnitOfWork.Insert(clientsOfCar);
            await _unitOfWork.Save();

            return(clientsOfCar.id);
        }