public bool AddCar(CarInfo carInfo) { bool isValid = ValidationHelper.IsCarValid(carInfo); if (isValid) { carInfo.CarId = GetUnicId.GetNewGuid(); _carRepository.SaveCarData(carInfo); } return(isValid); }
public bool AddBrand(BrandInfo brandInfo) { bool isValid = ValidationHelper.IsBrandNameValid(brandInfo); if (isValid) { brandInfo.BrandId = GetUnicId.GetNewGuid(); _brandRepository.SaveBrandData(brandInfo); } return(isValid); }
public bool Registrate(UserRegistrationInfo userInfo) { bool isValid = ValidationHelper.IsRegFieldsCompleted(userInfo) && ValidationHelper.IsPasswordSame(userInfo.Password, userInfo.ConfirmPassword) && !_authenticationRepository.LoginExists(userInfo.Login); if (isValid) { userInfo.UserId = GetUnicId.GetNewGuid(); _authenticationRepository.SaveRegistrationDate(userInfo); } return(isValid); }