예제 #1
0
파일: RoadsManager.cs 프로젝트: Jos1k/Roads
        /// <summary>
        /// Creates the feedback.
        /// </summary>
        /// <param name="feedbacksData">The feedbacks data.</param>
        public void CreateFeedback(RouteNodeWithFeedbacksData feedbacksData)
        {
            var feedbackItemRepository = new FeedbackItemRepository();
            var routeRepository = new RoutesRepository();

            RouteNode routeNode = routeRepository.GetRouteNode(
                feedbacksData.OriginCityNodeId, feedbacksData.DestinationCityNodeId);

            int feedbackId = feedbackItemRepository.AddNewFeedback(routeNode.RouteNodeId, feedbacksData.UserId,
                    feedbacksData.SubmitTime);

            feedbacksData.FeedbackValues.ForEach(feedbackValue => feedbackItemRepository.AddNewFeedbackValue(new FeedbackValueData()
            {
                FeedbackId = feedbackId,
                Value = feedbackValue.Value,
                FeedbackItemId = feedbackValue.FeedbackItemId
            }));
        }
예제 #2
0
파일: RoadsService.cs 프로젝트: Jos1k/Roads
 /// <summary>
 /// Creates the feedback.
 /// </summary>
 /// <param name="feedbacksData">The feedbacks data.</param>
 public void CreateFeedback(RouteNodeWithFeedbacksData feedbacksData)
 {
     try
     {
         new RoadsManager().CreateFeedback(feedbacksData);
     }
     catch (Exception ex)
     {
         //TODO ADD tracking
     }
 }