public void Insert(UserCar userCar) { if (userCar == null) return; db.UserCars.Add(userCar); db.SaveChanges(); }
public void Update(UserCar userCar) { if (userCar == null) return; UserCar dbUserCar = GetUserCarById(userCar.ID); if (dbUserCar == null) return; dbUserCar.CarId = userCar.CarId; db.SaveChanges(); }
public bool UpdateUserCar(UserCar userCar) { throw new NotImplementedException(); }
public bool CreateUserCar(string userValue, string carValue) { try { var user = _userRepo.GetUserById(Convert.ToInt32(userValue)); var car = _carRepo.GetCarById(Convert.ToInt32(carValue)); if (user == null || car == null) return false; var userCar = new UserCar { CarId = car.ID, UserId = user.ID, IsActive = true }; _userCarRepo.Insert(userCar); return true; } catch (Exception ex) { HandleLogging.LogMessage(ex, "WCF - CreateUserCar", 1, WebOperationContext.Current); return false; } }
public bool UpdateUserCar(UserCar userCar) { return new UserService().UpdateUserCar(userCar); }