public void CreateCategory(CategoryDM category) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@Category", category.Category) }; dataWriter.Write(parameters, "CreateCategory"); logs.LogError("Event", "A category has been created", "Class:CategoryDAO, Method: CreateCategory"); }
public void CreateUser(UserDM user) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@UserName", user.UserName) , new SqlParameter("@Password", user.Password) , new SqlParameter("@SecLev", user.SecLev) }; dataWriter.Write(parameters, "CreateUser"); logs.LogError("Event", "An User has been added to the database", "Class:UserDAO, Method:AddUser"); }
public void CreateQuote(QuoteDM quote) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@Phrase", quote.Phrase) , new SqlParameter("@Author", quote.Author) , new SqlParameter("@Category", quote.Category) , new SqlParameter("@Rating", quote.Rating) , new SqlParameter("@NumRatings", quote.NumRatings) , new SqlParameter("@RatingScore", quote.RatingScore) }; dataWriter.Write(parameters, "CreateQuote"); logs.LogError("Event", "A quote has been created", "Class:QuoteDAO, Method: CreateQuote"); }
public void EditRatingById(RatingDM rating) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@Id", rating.RateId) , new SqlParameter("@RatingName", rating.Rating) }; dataWriter.Write(parameters, "UpdateRating"); logs.LogError("Event", "An rating has been updated", "Class: RatingDAO, Method: UpdateRating"); }
public void AddPrevRate(PrevRateDM PrevRate) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@QuoteId", PrevRate.QuoteId) , new SqlParameter("@SeqNum", PrevRate.SeqNum) , new SqlParameter("@UserId", PrevRate.UserId) }; dataWriter.Write(parameters, "AddPrevRate"); logs.LogError("Event", "An PrevRate has been added to the database", "Class:PrevRateDAO, Method:AddPrevRate"); }