Пример #1
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ChatOnlines
        /// </summary>
        public static List<ChatOnline> PopulateObjectWithJoinCustom(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ChatOnline obj;

            while (dr.Read())
            {
                obj = new ChatOnline();
                if (list.IsColumnPresent("ChatOnlineID")) { obj._chatOnlineID = (int)dr["ChatOnlineID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("LastCommDt")) { obj._lastCommDt = (DateTime)dr["LastCommDt"]; }
                if (list.IsColumnPresent("Status")) { obj._status = (int)dr["Status"]; }

                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("Email")) { obj.Email = (string)dr["Email"]; }
                if (list.IsColumnPresent("WebMemberID")) { obj.WebMemberID = (string)dr["WebMemberID"]; }
                if (list.IsColumnPresent("AvatorUrl")) { obj.AvatorUrl = (string)dr["AvatorUrl"]; }
                if (list.IsColumnPresent("CustomMessage")) { obj.CustomMessage = (string)dr["CustomMessage"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #2
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ChatOnlines
        /// </summary>
        public static List<ChatOnline> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ChatOnline obj;

            while (dr.Read())
            {
                obj = new ChatOnline();
                if (list.IsColumnPresent("ChatOnlineID")) { obj._chatOnlineID = (int)dr["ChatOnlineID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("LastCommDt")) { obj._lastCommDt = (DateTime)dr["LastCommDt"]; }
                if (list.IsColumnPresent("Status")) { obj._status = (int)dr["Status"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #3
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ChatOnlines
        /// </summary>
        public static List <ChatOnline> PopulateObjectWithJoinCustom(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ChatOnline obj;

            while (dr.Read())
            {
                obj = new ChatOnline();
                if (list.IsColumnPresent("ChatOnlineID"))
                {
                    obj._chatOnlineID = (int)dr["ChatOnlineID"];
                }
                if (list.IsColumnPresent("MemberID"))
                {
                    obj._memberID = (int)dr["MemberID"];
                }
                if (list.IsColumnPresent("LastCommDt"))
                {
                    obj._lastCommDt = (DateTime)dr["LastCommDt"];
                }
                if (list.IsColumnPresent("Status"))
                {
                    obj._status = (int)dr["Status"];
                }

                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("Email"))
                {
                    obj.Email = (string)dr["Email"];
                }
                if (list.IsColumnPresent("WebMemberID"))
                {
                    obj.WebMemberID = (string)dr["WebMemberID"];
                }
                if (list.IsColumnPresent("AvatorUrl"))
                {
                    obj.AvatorUrl = (string)dr["AvatorUrl"];
                }
                if (list.IsColumnPresent("CustomMessage"))
                {
                    obj.CustomMessage = (string)dr["CustomMessage"];
                }

                arr.Add(obj);
            }

            dr.Close();

            return(arr);
        }