Ejemplo n.º 1
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of SubscriptionMembers
        /// </summary>
        public static List<SubscriptionMember> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List<SubscriptionMember> arr = new List<SubscriptionMember>();

            SubscriptionMember obj;

            while (dr.Read())
            {
                obj = new SubscriptionMember();
                if (list.IsColumnPresent("SubscriptionMemberID")) { obj._subscriptionMemberID = (int)dr["SubscriptionMemberID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("SubscribeToMemberID")) { obj._subscribeToMemberID = (int)dr["SubscribeToMemberID"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Ejemplo n.º 2
0
    public int SubscribeToMember(string WebMemberID)
    {
        ViewingMember = Member.GetMemberViaWebMemberID(WebMemberID);
        member = (Member)HttpContext.Current.Session["Member"];

        SubscriptionMember subscription = new SubscriptionMember();

        subscription.MemberID = member.MemberID;
        subscription.SubscribeToMemberID = ViewingMember.MemberID;
        subscription.DTCreated = DateTime.Now;
        subscription.SaveWithCheck();

        return 1;
    }