public async Task <int> InsertEmployee(CarWashWorkersBll carWashWorkersBll) { CarWashWorkers carWashWorkers = Mapper.Map <CarWashWorkersBll, CarWashWorkers>(carWashWorkersBll); _unitOfWork.CarWashWorkersUnitOfWork.Insert(carWashWorkers); await _unitOfWork.Save(); return(carWashWorkers.id); }
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); }
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(); }