Exemple #1
0
        public ActionResult <ProductInPlanActionDto> CreateProductInPlanAction(CreateProductInPlanAction newAction)
        {
            var action = _mapper.Map <ProductInPlanAction>(newAction);

            _repository.AddProductInPlanAction(action);
            return(Ok());
        }
Exemple #2
0
        private CreateProductInPlanAction CreateAction(ActionType type, int planId, int dailyPlanId, ProductInDietPlan product, string username)
        {
            var action = new CreateProductInPlanAction
            {
                Username        = username,
                ProductId       = product.Product.ProductNo,
                ProductName     = product.Product.ProductName,
                DailyDietPlanId = dailyPlanId,
                DietPlanId      = planId,
                Action          = type,
                Created         = DateTime.UtcNow
            };

            return(action);
        }