Ejemplo n.º 1
0
        public override Recurrent Add(Recurrent item, TimeInterval timeInterval)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (item.Goal == null)
            {
                throw new ArgumentNullException("item", "Property item.Goal can't be Null.");
            }

            //  this should be here, since its the BL...
            item.Goal.OperationDetails = GoalEngine.Create(item.Goal, timeInterval);

            return(Add(item));
        }
Ejemplo n.º 2
0
        public virtual IServiceResult Validate(DateTime startDate, DateTime?endDate,
                                               double?partAmount,
                                               double?fullAmount,
                                               TimeInterval timeInterval)
        {
            var result = FieldValidations(startDate, endDate, partAmount, ref fullAmount, timeInterval);

            if (result.Errors.Any())
            {
                return(new ServiceResult(null, result.Errors));
            }

            var entity = result.Result as Goal;

            entity.OperationDetails = GoalEngine.Create(entity, timeInterval);

            return(new ServiceResult(entity, result.Errors));
        }