예제 #1
0
파일: Wash.cs 프로젝트: Sp1n89/AutoDok
 /// <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;
 }
예제 #2
0
파일: Wash.cs 프로젝트: Sp1n89/AutoDok
 /// <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;
 }
예제 #3
0
파일: WashBll.cs 프로젝트: Sp1n89/AutoDok
        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);
        }
예제 #4
0
파일: WashBll.cs 프로젝트: Sp1n89/AutoDok
        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);
        }
예제 #5
0
 public void CreateIncome(CreateOperationEntity entity)
 {
     var income = new Income(entity.Name, entity.Amount, entity.Date);
     _operationRepository.Insert(income);
 }