public OperationResult Create(Note note)
 {
     try
     {
         _dao.Create(note);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
Beispiel #2
0
 public OperationResult Create(UserTransaction userTransaction)
 {
     try
     {
         _dao.Create(userTransaction);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
 public OperationResult Create(Categories category)
 {
     try
     {
         _dao.Create(category);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
 public OperationResult Create(TimesOfDay item)
 {
     try
     {
         _dao.Create(item);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
 public OperationResult Create(WeightMultiplier weightMultiplier)
 {
     try
     {
         _dao.Create(weightMultiplier);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
Beispiel #6
0
        public OperationResult Create(Foods food)
        {
            try
            {
                if (food.Name == string.Empty)
                {
                    throw new Exception();
                }

                food.Calories = food.Fats * 9 + food.Carbohydrates * 4 + food.Protein * 4 + food.Alcohol * 7;
                _dao.Create(food);
                return(new OperationResult()
                {
                    Success = true
                });
            }
            catch (Exception e)
            {
                return(new OperationResult()
                {
                    Success = false, Exception = e
                });
            }
        }