public static string REVIEWS_INSERT(Review inReview_) { return string.Format("INSERT INTO rh_reviews VALUES (NULL, '{0}', '{1}', '{2}', '{3}', '{4}', '{5}')", inReview_.ReviewToId, inReview_.ReviewerId, inReview_.HostSessionReviewID, inReview_.Rating, inReview_.ReviewMessage, Utilities.ConvertToSQLBoolean(inReview_.Recommend)); }
public Boolean SubmitReview(Review inReview_) { return _reviewManager.SubmitReview(inReview_); }
private List<Review> ParseReviewsByQuery(string inQuery_) { List<Review> retList; using (MySqlCommand tmpCmd = new MySqlCommand(inQuery_, this._sqlData.SQLConnection)) { using (MySqlDataReader dataReader = tmpCmd.ExecuteReader()) { retList = new List<Review>(); while (dataReader.Read()) { Review tmp = new Review() { Id = dataReader.GetInt64(MySQLConfig.TableConstants.Reviews.COL_REVIEW_ID), ReviewerId = dataReader.GetInt64(MySQLConfig.TableConstants.Reviews.COL_REVIEWER_ID), ReviewToId = dataReader.GetInt64(MySQLConfig.TableConstants.Reviews.COL_REVIEW_TO_ID), Rating = dataReader.GetInt16(MySQLConfig.TableConstants.Reviews.COL_RATING), ReviewMessage = dataReader.GetString(MySQLConfig.TableConstants.Reviews.COL_MESSAGE), Recommend = (dataReader.GetInt16(MySQLConfig.TableConstants.Reviews.COL_RECOMMEND) == 1), HostSessionReviewID = dataReader.GetInt64(MySQLConfig.TableConstants.Reviews.COL_HOST_SESSION_ID) }; retList.Add(tmp); } return retList; } } }
public Boolean SubmitReview(Review inReviewToSubmit_) { return _sqlData.ExecuteNonQuery(Queries.REVIEWS_INSERT(inReviewToSubmit_)); }