public IResult AddDetail(WeeklyPlanDetailDto weeklyPlanDetailDto)
        {
            _weeklyPlanDetailDal.Add(new WeeklyPlanDetail
            {
                WeeklyPlanId = weeklyPlanDetailDto.WeeklyPlanId,
                Description  = weeklyPlanDetailDto.Description
            });

            return(new SuccessResult(Messages.WeeklyPlanDetailAdded));
        }
        public IResult UpdateDetail(WeeklyPlanDetailDto weeklyPlanDetailDto)
        {
            var planDetail = _weeklyPlanDetailDal.Get(w => w.Id == weeklyPlanDetailDto.Id && w.WeeklyPlanId == weeklyPlanDetailDto.WeeklyPlanId);

            planDetail.Description = weeklyPlanDetailDto.Description;

            _weeklyPlanDetailDal.Update(planDetail);

            return(new SuccessResult(Messages.WeeklyPlanDetailUpdated));
        }
        public IActionResult UpdateDetail(WeeklyPlanDetailDto weeklyPlanDto)
        {
            var isOver = _weeklyPlanService.IsOver(weeklyPlanDto.WeeklyPlanId);

            if (!isOver.Success)
            {
                return(BadRequest(isOver.Message));
            }

            var result = _weeklyPlanService.UpdateDetail(weeklyPlanDto);

            if (result.Success)
            {
                return(Ok(result.Message));
            }

            return(BadRequest(result.Message));
        }