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; }
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)); }
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 }); }