Ejemplo n.º 1
0
 public static void AddStoreFaq(StoreFaq storeFaq)
 {
     SQLDataAccess.ExecuteNonQuery(
         "INSERT INTO [Module].[StoreFaq] ([ParentID],[Rate],[Faq],[FaqerEmail],[FaqerName],[DateAdded],[Moderated]) VALUES (@ParentID,@Rate,@Faq,@FaqerEmail,@FaqerName,GETDATE(),@Moderated)",
         CommandType.Text,
         new SqlParameter("@ParentID", storeFaq.ParentId == 0 ? DBNull.Value : (object)storeFaq.ParentId),
         new SqlParameter("@Rate", storeFaq.Rate),
         new SqlParameter("@Faq", storeFaq.Faq),
         new SqlParameter("@FaqerEmail", storeFaq.FaqerEmail),
         new SqlParameter("@FaqerName", storeFaq.FaqerName),
         new SqlParameter("@Moderated", storeFaq.Moderated));
 }
Ejemplo n.º 2
0
 public static void UpdateStoreFaq(StoreFaq storeFaq)
 {
     SQLDataAccess.ExecuteNonQuery(
         "UPDATE [Module].[StoreFaq] SET [ParentID]=@ParentID,[Rate]=@Rate,[Faq]=@Faq,[FaqerEmail]=@FaqerEmail,[FaqerName]=@FaqerName, [Moderated]=@Moderated, [DateAdded]=@DateAdded WHERE [ID]=@ID",
         CommandType.Text,
         new SqlParameter("@ID", storeFaq.Id),
         new SqlParameter("@ParentID", storeFaq.ParentId == 0 ? DBNull.Value : (object)storeFaq.ParentId),
         new SqlParameter("@Rate", storeFaq.Rate),
         new SqlParameter("@Faq", storeFaq.Faq),
         new SqlParameter("@FaqerEmail", storeFaq.FaqerEmail),
         new SqlParameter("@FaqerName", storeFaq.FaqerName),
         new SqlParameter("@Moderated", storeFaq.Moderated),
         new SqlParameter("@DateAdded", storeFaq.DateAdded));
 }