/// <summary> /// Creates a new Individual Car Was object. /// </summary> public Wash(DateTime date, string carNumber, Income income) { Date = date; WashType = WashType.IndividualCarWash; CarNumber = carNumber; Income = income; IncomeId = income.Id; }
/// <summary> /// Creates a new Carpet Wash object. /// </summary> public Wash(DateTime date, decimal squareArea, Income income) { Date = date; WashType = WashType.CarpetWash; SquareArea = squareArea; Income = income; IncomeId = income.Id; }
private void CreateCarpetWash(CreateWashEntity entity) { if (!entity.Amount.HasValue) { throw new BusinessLayerException("Carpet wash has no amount."); } if (!entity.SquareArea.HasValue) { throw new BusinessLayerException("Carpet wash has no square area."); } var income = new Income(entity.WashType.Localize(), entity.Amount.Value, entity.Date); _operationRepository.Insert(income); var wash = new Wash(entity.Date, entity.SquareArea.Value, income); _washRepository.Insert(wash); income.Wash = wash; income.WashId = wash.Id; _operationRepository.Update(income); }
private void CreateIndividualCarWash(CreateWashEntity entity) { if (!entity.Amount.HasValue) { throw new BusinessLayerException("Individual Car wash has no amount."); } var income = new Income(entity.WashType.Localize(), entity.Amount.Value, entity.Date); var wash = new Wash(entity.Date, entity.CarNumber, income); _washRepository.Insert(wash); income.Wash = wash; income.WashId = wash.Id; _operationRepository.Insert(income); }
public void CreateIncome(CreateOperationEntity entity) { var income = new Income(entity.Name, entity.Amount, entity.Date); _operationRepository.Insert(income); }