Exemplo n.º 1
0
        public void UpdateVehicleWheel(int vehicleId, List <VehicleWheelViewModel> vehicleWheels, int userId)
        {
            DateTime serverTime = DateTime.Now;

            foreach (var vw in vehicleWheels)
            {
                VehicleWheel vwEntity = _vehicleWheelRepository.GetById(vw.Id);
                vwEntity.WheelDetailId = vw.WheelDetailId;
                vwEntity.ModifyDate    = serverTime;
                vwEntity.ModifyUserId  = userId;
                vwEntity.VehicleId     = vehicleId;

                _vehicleWheelRepository.AttachNavigation(vwEntity.Vehicle);
                _vehicleWheelRepository.AttachNavigation(vwEntity.WheelDetail);
                _vehicleWheelRepository.AttachNavigation(vwEntity.CreateUser);
                _vehicleWheelRepository.AttachNavigation(vwEntity.ModifyUser);
                _vehicleWheelRepository.Update(vwEntity);
                _unitOfWork.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public int GetCurrentWheelDetailId(int vehicleWheelId)
        {
            VehicleWheel result = _vehicleWheelRepository.GetById(vehicleWheelId);

            return(result.WheelDetailId);
        }