Exemplo n.º 1
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ContentViews
        /// </summary>
        public static List<ContentView> PopulateContentViewObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ContentView obj;

            while (dr.Read())
            {
                obj = new ContentView();
                if (list.IsColumnPresent("WebMemberID")) { obj.WebMemberID = (string)dr["WebMemberID"]; }
                if (list.IsColumnPresent("PhotoURL")) { obj.PhotoURL = (string)dr["PhotoURL"]; }
                if (list.IsColumnPresent("NickName")) { obj.NickName = (string)dr["NickName"]; }
                if (list.IsColumnPresent("FirstName")) { obj.FirstName = (string)dr["FirstName"]; }
                if (list.IsColumnPresent("LastName")) { obj.LastName = (string)dr["LastName"]; }
                if (list.IsColumnPresent("DTCreated")) { obj.DTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lawrence: added this for the 1st release of social. This method needs to be refactored into data dll.
        /// </summary>
        /// <param name="member"></param>
        /// <param name="ObjectID"></param>
        /// <param name="contentType"></param>
        private static void ContentViewed(Member member, int ObjectID, CommentType contentType)
        {
            if (member != null)
            {
                try
                {
                    DateTime dtNow = DateTime.Now;

                    ContentView contentView = new ContentView();
                    contentView.DTCreated = DateTime.Now;
                    contentView.MemberID = member.MemberID;
                    contentView.ObjectID = ObjectID;
                    contentView.ObjectType = (int)contentType;

                    contentView.SaveWithCheck();
                }
                catch { }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ContentViews
        /// </summary>
        public static List<ContentView> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ContentView obj;

            while (dr.Read())
            {
                obj = new ContentView();
                if (list.IsColumnPresent("ContentViewID")) { obj._contentViewID = (int)dr["ContentViewID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("ObjectID")) { obj._objectID = (int)dr["ObjectID"]; }
                if (list.IsColumnPresent("ObjectType")) { obj._objectType = (int)dr["ObjectType"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }