public bool DeleteReview(Review review) { if (databasehandler.DeleteReview(review.ID)) return true; else return false; }
// Methodes public bool AddReview(Review review) { if (databasehandler.AddReview(review)) return true; else return false; }
public bool DeleteReview(Review review) { if (reviewhandler.DeleteReview(review)) { return true; }else { return false; } }
public bool AddReview(Review review) { throw new NotImplementedException(); }
/// <summary> /// Adds a review to the database /// </summary> /// <param name="newreview"></param> /// <returns></returns> public bool AddReview(Review newreview) { try { Connect(); cmd = new OracleCommand(); cmd.Connection = con; cmd.CommandText = "Insert into TREVIEW(BEOORDELING, OPMERKINGEN, VRIJWILLIGERID, HULPVRAAGID) VALUES (:NewRating, :NewComments, :NewVolunteer, :NewQuestion)"; cmd.Parameters.Add("NewRating", newreview.Rating); cmd.Parameters.Add("NewComments", newreview.Comments); cmd.Parameters.Add("NewVolunteer", newreview.VolunteerID); cmd.Parameters.Add("NewQuestion", newreview.QuestionID); cmd.ExecuteNonQuery(); return true; } catch (Exception ex) { MessageBox.Show(ex.Message); return false; } finally { Disconnect(); } }