Exemplo n.º 1
0
        public async Task <int> InsertEmployee(CarWashWorkersBll carWashWorkersBll)
        {
            CarWashWorkers carWashWorkers = Mapper.Map <CarWashWorkersBll, CarWashWorkers>(carWashWorkersBll);

            _unitOfWork.CarWashWorkersUnitOfWork.Insert(carWashWorkers);
            await _unitOfWork.Save();

            return(carWashWorkers.id);
        }
Exemplo n.º 2
0
        private CarWashWorkersBll СreateListCarWashWorkers(PremiumAndRateBll premiumAndRate)
        {
            CarWashWorkersBll carWash = new CarWashWorkersBll();

            carWash.id          = premiumAndRate.carWashWorkersId;
            carWash.Name        = premiumAndRate.CarWashWorkers.Name;
            carWash.Surname     = premiumAndRate.CarWashWorkers.Surname + " " + premiumAndRate.CarWashWorkers.Name;
            carWash.Patronymic  = premiumAndRate.CarWashWorkers.Patronymic;
            carWash.MobilePhone = premiumAndRate.CarWashWorkers.MobilePhone;

            return(carWash);
        }
Exemplo n.º 3
0
        public async Task UpdateEmploee(CarWashWorkersBll carWashWorkersId, string action)
        {
            CarWashWorkers carWashWorkers = Mapper.Map <CarWashWorkersBll, CarWashWorkers>(carWashWorkersId);

            if (action == "Delete")// перед увольнением предусмотреть
            {
                carWashWorkers.status        = false;
                carWashWorkers.DataDismissal = DateTime.Now;
            }

            _unitOfWork.CarWashWorkersUnitOfWork.Update(carWashWorkers);
            await _unitOfWork.Save();
        }