Esempio n. 1
0
        public int Add(SubscriptionInfo subscription)
        {
            string strSql = "INSERT INTO " + Config.ForumTablePrefix + "SUBSCRIPTIONS " +
                                  "(MEMBER_ID,CAT_ID,TOPIC_ID,FORUM_ID) VALUES (@MemberId,@CatId,@TopicId,@ForumId)";
            List<SqlParameter> parms = new List<SqlParameter>
                {
                    new SqlParameter("@MemberId", SqlDbType.Int) {Value = subscription.MemberId},
                    new SqlParameter("@CatId", SqlDbType.Int) {Value = subscription.CategoryId},
                    new SqlParameter("@TopicId", SqlDbType.Int) {Value = subscription.TopicId},
                    new SqlParameter("@ForumId", SqlDbType.Int) {Value = subscription.ForumId}
                };

            return SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, parms.ToArray());
        }
Esempio n. 2
0
 public static void RemoveCategorySubscription(SubscriptionInfo subscription)
 {
     ISubscription dal = Factory<ISubscription>.Create("Subscription");
     dal.Delete(subscription.Id);
 }