Esempio n. 1
0
 public static void UpdateCourseReviewEntity(this UserCourseReviews entity, CourseUserReviewDTO dto)
 {
     entity.ReviewRating = dto.Rating;
     entity.ReviewTitle  = dto.Title.TrimString();
     entity.ReviewText   = dto.Text;
     entity.ReviewDate   = DateTime.Now;
 }
Esempio n. 2
0
        public ActionResult SaveReview(CourseUserReviewDTO token)
        {
            string error;
            var    saved = _widgetCourseServices.SaveCourseReview(token, CurrentUserId, out error);

            return(Json(new JsonResponseToken
            {
                success = saved
                , result = _widgetCourseServices.GetCourseRating(token.CourseId)
                , error = error
            }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
 public static UserCourseReviews Dto2CourseReviewEntity(this CourseUserReviewDTO dto, int userId)
 {
     return(new UserCourseReviews
     {
         CourseId = dto.CourseId
         , UserId = userId
         , ReviewRating = dto.Rating
         , ReviewTitle = dto.Title.TrimString()
         , ReviewText = dto.Text
         , ReviewDate = DateTime.Now
         , Approved = true
     });
 }