示例#1
0
        /// <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
 /// <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
     }
 }