Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void CreateIncome(CreateOperationEntity entity)
 {
     var income = new Income(entity.Name, entity.Amount, entity.Date);
     _operationRepository.Insert(income);
 }