Esempio n. 1
0
 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");
 }
Esempio n. 2
0
 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");
 }
Esempio n. 3
0
 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");
 }
Esempio n. 4
0
 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");
 }
Esempio n. 5
0
 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");
 }