Пример #1
0
        public static List<FriendTag> PopulateFriendTagWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            FriendTag obj;

            while (dr.Read())
            {
                obj = new FriendTag();

                if (list.IsColumnPresent("MemberID")) { obj.MemberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("WebMemberID")) { obj.WebMemberID = (string)dr["WebMemberID"]; }
                if (list.IsColumnPresent("CountryName")) { obj.CountryName = (string)dr["CountryName"]; }
                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("ProfilePhotoURL")) { obj.ProfilePhotoURL = (string)dr["ProfilePhotoURL"]; }
                if (list.IsColumnPresent("TaggedDT")) { obj.TaggedDT = (DateTime)dr["TaggedDT"]; }
                if (list.IsColumnPresent("CreatedDT")) { obj._createdDT = (DateTime)dr["CreatedDT"]; }

                arr.Add(obj);
            }

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

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

            ChatMessage obj;

            while (dr.Read())
            {
                obj = new ChatMessage();
                if (list.IsColumnPresent("ChatMessageID")) { obj._chatMessageID = (int)dr["ChatMessageID"]; }
                if (list.IsColumnPresent("ChatMessageWebID")) { obj._chatMessageWebID = (string)dr["ChatMessageWebID"]; }
                if (list.IsColumnPresent("MemberIDFrom")) { obj._memberIDFrom = (int)dr["MemberIDFrom"]; }
                if (list.IsColumnPresent("MemberIDTo")) { obj._memberIDTo = (int)dr["MemberIDTo"]; }
                if (list.IsColumnPresent("Message")) { obj._message = (string)dr["Message"]; }
                if (list.IsColumnPresent("Delivered")) { obj._delivered = (bool)dr["Delivered"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }
                if (list.IsColumnPresent("WebMemberIDFrom")) { obj.WebMemberIDFrom = (String)dr["WebMemberIDFrom"]; }

                
                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #3
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;
        }
Пример #4
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of PhotoCollections
        /// </summary>
        public static List <PhotoCollection> PopulatePhotoCollectionWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            PhotoCollection obj;

            while (dr.Read())
            {
                obj = new PhotoCollection();
                obj._photoCollectionID    = (int)dr["PhotoCollectionID"];
                obj._webPhotoCollectionID = (string)dr["WebPhotoCollectionID"];
                obj._memberID             = (int)dr["MemberID"];
                obj._name        = (string)dr["Name"];
                obj._description = (string)dr["Description"];
                obj._dTCreated   = (DateTime)dr["DTCreated"];

                if (list.IsColumnPresent("NumberOfPhotos"))
                {
                    obj.NumberOfPhotos = (int)dr["NumberOfPhotos"];
                }
                if (list.IsColumnPresent("DefaultThumbnailURL"))
                {
                    obj.DefaultThumbnailURL = (string)dr["DefaultThumbnailURL"];
                }

                arr.Add(obj);
            }

            dr.Close();

            return(arr);
        }
Пример #5
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;
        }
Пример #6
0
        public static List <FriendTag> PopulateFriendTagWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            FriendTag obj;

            while (dr.Read())
            {
                obj = new FriendTag();

                if (list.IsColumnPresent("MemberID"))
                {
                    obj.MemberID = (int)dr["MemberID"];
                }
                if (list.IsColumnPresent("WebMemberID"))
                {
                    obj.WebMemberID = (string)dr["WebMemberID"];
                }
                if (list.IsColumnPresent("CountryName"))
                {
                    obj.CountryName = (string)dr["CountryName"];
                }
                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("ProfilePhotoURL"))
                {
                    obj.ProfilePhotoURL = (string)dr["ProfilePhotoURL"];
                }
                if (list.IsColumnPresent("TaggedDT"))
                {
                    obj.TaggedDT = (DateTime)dr["TaggedDT"];
                }
                if (list.IsColumnPresent("CreatedDT"))
                {
                    obj._createdDT = (DateTime)dr["CreatedDT"];
                }

                arr.Add(obj);
            }

            return(arr);
        }
Пример #7
0
        //public static List<BlogComment> GetBlogCommentsByWebBlogEntryID(int BlogEntryID)
        //{
        //    Database db = DatabaseFactory.CreateDatabase();

        //    DbCommand dbCommand = db.GetStoredProcCommand("HG_GetBlogCommentByBlogEntryID");
        //    db.AddInParameter(dbCommand, "BlogEntryID", DbType.Int32, BlogEntryID);

        //    List<BlogComment> arr = null;

        //    // Populate the datareader
        //    using (IDataReader dr = db.ExecuteReader(dbCommand))
        //    {
        //        // Call the PopulateObject method passing the datareader to return the object array
        //        arr = Next2Friends.Data.BlogComment.PopulateBlogCommentWithJoin(dr);
        //        dr.Close();
        //    }

        //    return arr;
        //}

        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of MemberComments
        /// </summary>
        public static List <MemberComment> PopulateMemberCommentWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            MemberComment obj;

            while (dr.Read())
            {
                obj = new MemberComment();
                if (list.IsColumnPresent("MemberCommentID"))
                {
                    obj._memberCommentID = (int)dr["MemberCommentID"];
                }
                if (list.IsColumnPresent("MemberID"))
                {
                    obj._memberID = (int)dr["MemberID"];
                }
                if (list.IsColumnPresent("MemberIDFrom"))
                {
                    obj._memberIDFrom = (int)dr["MemberIDFrom"];
                }
                if (list.IsColumnPresent("Text"))
                {
                    obj._text = (string)dr["Text"];
                }
                if (list.IsColumnPresent("DTCreated"))
                {
                    obj._dTCreated = (DateTime)dr["DTCreated"];
                }

                if (list.IsColumnPresent("WebMemberID"))
                {
                    obj.WebMemberID = (string)dr["WebMemberID"];
                }
                if (list.IsColumnPresent("NickName"))
                {
                    obj.NickName = (string)dr["NickName"];
                }
                if (list.IsColumnPresent("PhotoUrl"))
                {
                    obj.PhotoUrl = (string)dr["PhotoUrl"];
                }


                arr.Add(obj);
            }

            dr.Close();

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

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

            ChatMessage obj;

            while (dr.Read())
            {
                obj = new ChatMessage();
                if (list.IsColumnPresent("ChatMessageID"))
                {
                    obj._chatMessageID = (int)dr["ChatMessageID"];
                }
                if (list.IsColumnPresent("ChatMessageWebID"))
                {
                    obj._chatMessageWebID = (string)dr["ChatMessageWebID"];
                }
                if (list.IsColumnPresent("MemberIDFrom"))
                {
                    obj._memberIDFrom = (int)dr["MemberIDFrom"];
                }
                if (list.IsColumnPresent("MemberIDTo"))
                {
                    obj._memberIDTo = (int)dr["MemberIDTo"];
                }
                if (list.IsColumnPresent("Message"))
                {
                    obj._message = (string)dr["Message"];
                }
                if (list.IsColumnPresent("Delivered"))
                {
                    obj._delivered = (bool)dr["Delivered"];
                }
                if (list.IsColumnPresent("DTCreated"))
                {
                    obj._dTCreated = (DateTime)dr["DTCreated"];
                }
                if (list.IsColumnPresent("WebMemberIDFrom"))
                {
                    obj.WebMemberIDFrom = (String)dr["WebMemberIDFrom"];
                }


                arr.Add(obj);
            }

            dr.Close();

            return(arr);
        }
Пример #9
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of AskAFriend. This function should be used internally only.
        /// </summary>
        public static List <AskAFriend> PopulateAskAFriendWithJoin(IDataReader dr)
        {
            List <AskAFriend> arr  = new List <AskAFriend>();
            ColumnFieldList   list = new ColumnFieldList(dr);

            AskAFriend AAF;

            while (dr.Read())
            {
                AAF = new AskAFriend();
                AAF._askAFriendID    = (int)dr["AskAFriendID"];
                AAF._memberID        = (int)dr["MemberID"];
                AAF._webAskAFriendID = (string)dr["WebAskAFriendID"];
                AAF._numberOfPhotos  = (int)dr["NumberOfPhotos"];
                AAF._question        = (string)dr["Question"];
                AAF._responseType    = (int)dr["ResponseType"];
                AAF._duration        = (int)dr["Duration"];
                AAF._responseA       = (string)dr["ResponseA"];
                AAF._responseB       = (string)dr["ResponseB"];
                AAF._rejectScore     = (int)dr["RejectScore"];
                AAF._isPrivate       = (bool)dr["IsPrivate"];
                AAF._totalVotes      = (int)dr["TotalVotes"];
                AAF._active          = (bool)dr["Active"];
                AAF._wentLiveDT      = (DateTime)dr["WentLiveDT"];
                AAF._submittedDT     = (DateTime)dr["SubmittedDT"];

                AAF.DefaultImage = new ResourceFile();

                AAF.DefaultImage.ResourceFileID    = (int)dr["ResourceFileID"];
                AAF.DefaultImage.WebResourceFileID = (string)dr["WebResourceFileID"];
                AAF.DefaultImage.ResourceType      = (int)dr["ResourceType"];
                AAF.DefaultImage.StorageLocation   = (int)dr["StorageLocation"];
                AAF.DefaultImage.Server            = (int)dr["Server"];
                AAF.DefaultImage.Path      = (string)dr["Path"];
                AAF.DefaultImage.FileName  = (string)dr["FileName"];
                AAF.DefaultImage.CreatedDT = (DateTime)dr["CreatedDT"];

                AAF.Member = new Member();
                if (list.IsColumnPresent("Nickname"))
                {
                    AAF.Member.NickName = (string)dr["Nickname"];
                }

                arr.Add(AAF);
            }

            dr.Close();

            return(arr);
        }
Пример #10
0
        /// <summary>
        /// Get an InviteClick by WebID
        /// </summary>
        /// <param name="WebInviteClickID">The WebID associated to the Click</param>
        /// <returns>A Single InviteClick object</returns>
        public static InviteClick GetInviteClickByWebInviteClickID(string WebInviteClickID)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetInviteClickByInviteClickID");

            db.AddInParameter(dbCommand, "WebInviteClickID", DbType.String, WebInviteClickID);

            InviteClick inviteClick = null;

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    inviteClick = new InviteClick();

                    if (list.IsColumnPresent("InviteClickID"))
                    {
                        inviteClick._inviteClickID = (int)dr["InviteClickID"];
                    }
                    if (list.IsColumnPresent("WebInviteClickID"))
                    {
                        inviteClick._webInviteClickID = (string)dr["WebInviteClickID"];
                    }
                    if (list.IsColumnPresent("ForwardURL"))
                    {
                        inviteClick._forwardURL = (string)dr["ForwardURL"];
                    }
                    if (list.IsColumnPresent("ContactImportID"))
                    {
                        inviteClick._contactImportID = (int)dr["ContactImportID"];
                    }
                }
                else
                {
                    throw new ArgumentException(String.Format(Properties.Resources.Argument_InvalidWebInviteClickID, WebInviteClickID));
                }

                dr.Close();
            }

            return(inviteClick);
        }
Пример #11
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);
        }
Пример #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        public static AjaxComment[] PopulateAjaxComment(IDataReader dr)
        {
            List <AjaxComment> commentArr = new List <AjaxComment>();
            AjaxComment        ajaxComment;

            ColumnFieldList list = new ColumnFieldList(dr);

            while (dr.Read())
            {
                ajaxComment = new AjaxComment();

                ajaxComment.WebMemberID    = (string)dr["WebMemberID"];
                ajaxComment.NickName       = (string)dr["NickName"];
                ajaxComment.PhotoUrl       = ParallelServer.Get((string)dr["PhotoUrl"]) + "user/" + (string)dr["PhotoUrl"];
                ajaxComment.Text           = (string)dr["Text"];
                ajaxComment.SentFromMobile = ((int)dr["SentFromMobile"]) == 1 ? true : false;
                ajaxComment.DateTimePosted = TimeDistance.TimeAgo((DateTime)dr["DTCreated"]);
                ajaxComment.DTCreated      = (DateTime)dr["DTCreated"];

                if (list.IsColumnPresent("WebCommentID"))
                {
                    ajaxComment.WebCommentID = (string)dr["WebCommentID"];
                }
                if (list.IsColumnPresent("Path"))
                {
                    ajaxComment.Path  = (string)dr["Path"];
                    ajaxComment.Depth = GetDepth(ajaxComment.Path);
                }
                if (list.IsColumnPresent("IsDeleted"))
                {
                    ajaxComment.IsDeleted = (bool)dr["IsDeleted"];
                }

                commentArr.Add(ajaxComment);
            }

            return(commentArr.ToArray());
        }
Пример #13
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of FeaturedMembers
        /// </summary>
        public static List<FeaturedMember> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            FeaturedMember obj;

            while (dr.Read())
            {
                obj = new FeaturedMember();
                if (list.IsColumnPresent("FeaturedMemberID")) { obj._featuredMemberID = (int)dr["FeaturedMemberID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("Position")) { obj._position = (int)dr["Position"]; }
                if (list.IsColumnPresent("IsDisplayed")) { obj._isDisplayed = (bool)dr["IsDisplayed"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #14
0
        /// <summary>
        /// Instanciates a EmailMessage object from the database via the EmailMessageID
        /// </summary>
        public EmailMessage(int EmailMessageID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetEmailMessageByEmailMessageID");
            db.AddInParameter(dbCommand, "EmailMessageID", DbType.Int32, EmailMessageID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("EmailMessageID")) { this._emailMessageID = (int)dr["EmailMessageID"]; }
                    if (list.IsColumnPresent("WebEmailMessageID")) { this._webEmailMessageID = (string)dr["WebEmailMessageID"]; }
                    if (list.IsColumnPresent("ResourceFileID")) { this._resourceFileID = (int)dr["ResourceFileID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("EmailAddress")) { this._emailAddress = (string)dr["EmailAddress"]; }
                    if (list.IsColumnPresent("Text")) { this._text = (string)dr["Text"]; }
                    if (list.IsColumnPresent("IsRead")) { this._isRead = (bool)dr["IsRead"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no EmailMessage in the database with the ID " + EmailMessageID);
                }

                dr.Close();
            }
        }
Пример #15
0
        /// <summary>
        /// Instanciates a DeviceBlock object from the database via the DeviceBlockID
        /// </summary>
        public DeviceBlock(int DeviceBlockID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetDeviceBlockByDeviceBlockID");
            db.AddInParameter(dbCommand, "DeviceBlockID", DbType.Int32, DeviceBlockID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("DeviceBlockID")) { this._deviceBlockID = (int)dr["DeviceBlockID"]; }
                    if (list.IsColumnPresent("DeviceTagID")) { this._deviceTagID = (string)dr["DeviceTagID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("BlockingMemberID")) { this._blockingMemberID = (int)dr["BlockingMemberID"]; }
                    if (list.IsColumnPresent("MACAddress")) { this._mACAddress = (string)dr["MACAddress"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no DeviceBlock in the database with the ID " + DeviceBlockID);
                }

                dr.Close();
            }
        }
Пример #16
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of Dashboards
        /// </summary>
        public static List<Dashboard> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            Dashboard obj;

            while (dr.Read())
            {
                obj = new Dashboard();
                if (list.IsColumnPresent("DashboardID")) { obj._dashboardID = (int)dr["DashboardID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("Inbox")) { obj._inbox = (int)dr["Inbox"]; }
                if (list.IsColumnPresent("ProfileComment")) { obj._profileComment = (int)dr["ProfileComment"]; }
                if (list.IsColumnPresent("FriendRequest")) { obj._friendRequest = (int)dr["FriendRequest"]; }
                if (list.IsColumnPresent("FriendRequestAccept")) { obj._friendRequestAccept = (int)dr["FriendRequestAccept"]; }
                if (list.IsColumnPresent("FriendRequestOutstanding")) { obj._friendRequestOutstanding = (int)dr["FriendRequestOutstanding"]; }
                if (list.IsColumnPresent("NetworkNewVideo")) { obj._networkNewVideo = (int)dr["NetworkNewVideo"]; }
                if (list.IsColumnPresent("NetworkNewGallery")) { obj._networkNewGallery = (int)dr["NetworkNewGallery"]; }
                if (list.IsColumnPresent("NetworkUpdatedProfile")) { obj._networkUpdatedProfile = (int)dr["NetworkUpdatedProfile"]; }
                if (list.IsColumnPresent("NetworkFavourite")) { obj._networkFavourite = (int)dr["NetworkFavourite"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #17
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;
        }
Пример #18
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of Photos
        /// </summary>
        public static List <Photo> PopulatePhotoWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            Photo obj;

            while (dr.Read())
            {
                obj                          = new Photo();
                obj._photoID                 = (int)dr["PhotoID"];
                obj._webPhotoID              = (string)dr["WebPhotoID"];
                obj._photoCollectionID       = (int)dr["PhotoCollectionID"];
                obj._memberID                = (int)dr["MemberID"];
                obj._photoResourceFileID     = (int)dr["PhotoResourceFileID"];
                obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"];
                obj._width                   = (int)dr["Width"];
                obj._height                  = (int)dr["Height"];
                obj._totalVoteScore          = (int)dr["TotalVoteScore"];
                obj._numberOfViews           = (int)dr["NumberOfViews"];
                obj._numberOfComments        = (int)dr["NumberOfComments"];
                obj._active                  = (bool)dr["Active"];
                obj._takenDT                 = (DateTime)dr["TakenDT"];
                obj._createdDT               = (DateTime)dr["CreatedDT"];

                if (list.IsColumnPresent("Caption"))
                {
                    obj.Caption = (string)dr["Caption"];
                }
                if (list.IsColumnPresent("Title"))
                {
                    obj.Title = (string)dr["Title"];
                }

                if (list.IsColumnPresent("PhotoCollectionName"))
                {
                    obj.PhotoCollectionName = (string)dr["PhotoCollectionName"];
                }
                if (list.IsColumnPresent("PhotoCollectionDescription"))
                {
                    obj.PhotoCollectionDescription = (string)dr["PhotoCollectionDescription"];
                }
                if (list.IsColumnPresent("PhotoCollectionWebPhotoCollectionID"))
                {
                    obj.WebPhotoCollectionID = (string)dr["PhotoCollectionWebPhotoCollectionID"];
                }

                obj.PhotoResourceFile = new ResourceFile();
                if (list.IsColumnPresent("PhotoResourceFileResourceFileID"))
                {
                    obj.PhotoResourceFile.ResourceFileID = (int)dr["PhotoResourceFileResourceFileID"];
                }
                if (list.IsColumnPresent("PhotoResourceFileWebResourceFileID"))
                {
                    obj.PhotoResourceFile.WebResourceFileID = (string)dr["PhotoResourceFileWebResourceFileID"];
                }
                if (list.IsColumnPresent("PhotoResourceFileResourceType"))
                {
                    obj.PhotoResourceFile.ResourceType = (int)dr["PhotoResourceFileResourceType"];
                }
                if (list.IsColumnPresent("PhotoResourceFileStorageLocation"))
                {
                    obj.PhotoResourceFile.StorageLocation = (int)dr["PhotoResourceFileStorageLocation"];
                }
                if (list.IsColumnPresent("PhotoResourceFileServer"))
                {
                    obj.PhotoResourceFile.Server = (int)dr["PhotoResourceFileServer"];
                }
                if (list.IsColumnPresent("PhotoResourceFilePath"))
                {
                    obj.PhotoResourceFile.Path = (string)dr["PhotoResourceFilePath"];
                }
                if (list.IsColumnPresent("PhotoResourceFileFileName"))
                {
                    obj.PhotoResourceFile.FileName = (string)dr["PhotoResourceFileFileName"];
                }
                if (list.IsColumnPresent("PhotoResourceFileCreatedDT"))
                {
                    obj.PhotoResourceFile.CreatedDT = (DateTime)dr["PhotoResourceFileCreatedDT"];
                }

                obj.ThumbnailResourceFile = new ResourceFile();
                if (list.IsColumnPresent("ThumbnailResourceFileResourceFileID"))
                {
                    obj.ThumbnailResourceFile.ResourceFileID = (int)dr["ThumbnailResourceFileResourceFileID"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileWebResourceFileID"))
                {
                    obj.ThumbnailResourceFile.WebResourceFileID = (string)dr["ThumbnailResourceFileWebResourceFileID"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileResourceType"))
                {
                    obj.ThumbnailResourceFile.ResourceType = (int)dr["ThumbnailResourceFileResourceType"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileStorageLocation"))
                {
                    obj.ThumbnailResourceFile.StorageLocation = (int)dr["ThumbnailResourceFileStorageLocation"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileServer"))
                {
                    obj.ThumbnailResourceFile.Server = (int)dr["ThumbnailResourceFileServer"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFilePath"))
                {
                    obj.ThumbnailResourceFile.Path = (string)dr["ThumbnailResourceFilePath"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileFileName"))
                {
                    obj.ThumbnailResourceFile.FileName = (string)dr["ThumbnailResourceFileFileName"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileCreatedDT"))
                {
                    obj.ThumbnailResourceFile.CreatedDT = (DateTime)dr["ThumbnailResourceFileCreatedDT"];
                }

                obj.Member = new Member();
                if (list.IsColumnPresent("MemberMemberID"))
                {
                    obj.Member.MemberID = (int)dr["MemberMemberID"];
                }
                if (list.IsColumnPresent("MemberWebMemberID"))
                {
                    obj.Member.WebMemberID = (string)dr["MemberWebMemberID"];
                }
                if (list.IsColumnPresent("MemberAdminStatusID"))
                {
                    obj.Member.AdminStatusID = (int)dr["MemberAdminStatusID"];
                }
                if (list.IsColumnPresent("MemberNickName"))
                {
                    obj.Member.NickName = (string)dr["MemberNickName"];
                }
                if (list.IsColumnPresent("MemberChannelID"))
                {
                    obj.Member.ChannelID = (int)dr["MemberChannelID"];
                }
                if (list.IsColumnPresent("MemberPassword"))
                {
                    obj.Member.Password = (string)dr["MemberPassword"];
                }
                if (list.IsColumnPresent("MemberEmail"))
                {
                    obj.Member.Email = (string)dr["MemberEmail"];
                }
                if (list.IsColumnPresent("MemberGender"))
                {
                    obj.Member.Gender = (int)dr["MemberGender"];
                }
                if (list.IsColumnPresent("MemberFirstName"))
                {
                    obj.Member.FirstName = (string)dr["MemberFirstName"];
                }
                if (list.IsColumnPresent("MemberLastName"))
                {
                    obj.Member.LastName = (string)dr["MemberLastName"];
                }
                if (list.IsColumnPresent("MemberProfilePhotoResourceFileID"))
                {
                    obj.Member.ProfilePhotoResourceFileID = (int)dr["MemberProfilePhotoResourceFileID"];
                }
                if (list.IsColumnPresent("MemberDOB"))
                {
                    obj.Member.DOB = (DateTime)dr["MemberDOB"];
                }
                if (list.IsColumnPresent("MemberISOCountry"))
                {
                    obj.Member.ISOCountry = (string)dr["MemberISOCountry"];
                }
                if (list.IsColumnPresent("MemberZipPostcode"))
                {
                    obj.Member.ZipPostcode = (string)dr["MemberZipPostcode"];
                }
                if (list.IsColumnPresent("MemberCreatedDT"))
                {
                    obj.Member.CreatedDT = (DateTime)dr["MemberCreatedDT"];
                }


                arr.Add(obj);
            }

            dr.Close();

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

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

            Comment obj;

            while (dr.Read())
            {
                obj = new Comment();
                if (list.IsColumnPresent("CommentID"))
                {
                    obj._commentID = (int)dr["CommentID"];
                }
                if (list.IsColumnPresent("WebCommentID"))
                {
                    obj._webCommentID = (string)dr["WebCommentID"];
                }
                if (list.IsColumnPresent("ObjectID"))
                {
                    obj._objectID = (int)dr["ObjectID"];
                }
                if (list.IsColumnPresent("MemberIDFrom"))
                {
                    obj._memberIDFrom = (int)dr["MemberIDFrom"];
                }
                if (list.IsColumnPresent("InReplyToCommentID"))
                {
                    obj._inReplyToCommentID = (int)dr["InReplyToCommentID"];
                }
                if (list.IsColumnPresent("Text"))
                {
                    obj._text = (string)dr["Text"];
                }
                if (list.IsColumnPresent("IsDeleted"))
                {
                    obj._isDeleted = (bool)dr["IsDeleted"];
                }
                if (list.IsColumnPresent("Path"))
                {
                    obj._path = (string)dr["Path"];
                }
                if (list.IsColumnPresent("CommentType"))
                {
                    obj._commentType = (int)dr["CommentType"];
                }
                if (list.IsColumnPresent("DTCreated"))
                {
                    obj._dTCreated = (DateTime)dr["DTCreated"];
                }
                if (list.IsColumnPresent("ThreadNo"))
                {
                    obj._threadNo = (int)dr["ThreadNo"];
                }
                if (list.IsColumnPresent("WebMemberID"))
                {
                    obj.WebMemberID = (string)dr["WebMemberID"];
                }
                if (list.IsColumnPresent("NickName"))
                {
                    obj.NickName = (string)dr["NickName"];
                }
                if (list.IsColumnPresent("PhotoUrl"))
                {
                    obj.PhotoUrl = (string)dr["PhotoUrl"];
                }


                arr.Add(obj);
            }

            dr.Close();

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

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

            LiveBroadcast obj;

            while (dr.Read())
            {
                obj = new LiveBroadcast();
                if (list.IsColumnPresent("LiveBroadcastID"))
                {
                    obj._liveBroadcastID = (int)dr["LiveBroadcastID"];
                }
                if (list.IsColumnPresent("WebLiveBroadcastID"))
                {
                    obj._webLiveBroadcastID = (string)dr["WebLiveBroadcastID"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileID"))
                {
                    obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"];
                }
                if (list.IsColumnPresent("MemberID"))
                {
                    obj._memberID = (int)dr["MemberID"];
                }
                if (list.IsColumnPresent("BroadcastSource"))
                {
                    obj._broadcastSource = (int)dr["BroadcastSource"];
                }
                if (list.IsColumnPresent("Title"))
                {
                    obj._title = (string)dr["Title"];
                }
                if (list.IsColumnPresent("Description"))
                {
                    obj._description = (string)dr["Description"];
                }
                if (list.IsColumnPresent("DTStart"))
                {
                    obj._dTStart = (DateTime)dr["DTStart"];
                }
                if (list.IsColumnPresent("DTEnd"))
                {
                    obj._dTEnd = (DateTime)dr["DTEnd"];
                }
                if (list.IsColumnPresent("Duration"))
                {
                    obj._duration = (int)dr["Duration"];
                }
                if (list.IsColumnPresent("LiveNow"))
                {
                    obj._liveNow = (bool)dr["LiveNow"];
                }

                if (list.IsColumnPresent("ThumbnailURL"))
                {
                    obj.ThumbnailURL = (string)dr["ThumbnailURL"];
                }

                obj.Member = new Member();
                if (list.IsColumnPresent("Nickname"))
                {
                    obj.Member.NickName = (string)dr["Nickname"];
                }
                if (list.IsColumnPresent("ISOCountry"))
                {
                    obj.Member.ISOCountry = (string)dr["ISOCountry"];
                }



                arr.Add(obj);
            }

            dr.Close();

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

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

            Member obj;

            while (dr.Read())
            {
                obj                = new Member();
                obj._memberID      = (int)dr["MemberID"];
                obj._webMemberID   = (string)dr["WebMemberID"];
                obj._adminStatusID = (int)dr["AdminStatusID"];
                obj._nickName      = (string)dr["NickName"];
                obj._channelID     = (int)dr["ChannelID"];
                obj._password      = (string)dr["Password"];
                obj._email         = (string)dr["Email"];
                obj._gender        = (int)dr["Gender"];
                obj._firstName     = (string)dr["FirstName"];
                obj._lastName      = (string)dr["LastName"];
                obj._profilePhotoResourceFileID = (int)dr["ProfilePhotoResourceFileID"];
                obj._dOB        = (DateTime)dr["DOB"];
                obj._iSOCountry = (string)dr["ISOCountry"];
                if (list.IsColumnPresent("ISOCode"))
                {
                    obj.ISOCode = (string)dr["ISOCode"];
                }
                obj._zipPostcode = (string)dr["ZipPostcode"];
                obj._createdDT   = (DateTime)dr["CreatedDT"];

                //obj._accountType = (int)dr["AccountType"];
                if (list.IsColumnPresent("AccountType"))
                {
                    obj._accountType = (int)dr["AccountType"];
                }

                if (list.IsColumnPresent("DTOnline"))
                {
                    obj.LastOnline = (DateTime)dr["DTOnline"];
                }
                if (list.IsColumnPresent("IsFriend"))
                {
                    obj.IsFriend = (bool)dr["IsFriend"];
                }

                obj.DefaultPhoto = new ResourceFile();
                if (list.IsColumnPresent("DefaultPhotoResourceFileID"))
                {
                    obj.DefaultPhoto.ResourceFileID = (int)dr["DefaultPhotoResourceFileID"];
                }
                if (list.IsColumnPresent("DefaultPhotoWebResourceFileID"))
                {
                    obj.DefaultPhoto.WebResourceFileID = (string)dr["DefaultPhotoWebResourceFileID"];
                }
                if (list.IsColumnPresent("DefaultPhotoResourceType"))
                {
                    obj.DefaultPhoto.ResourceType = (int)dr["DefaultPhotoResourceType"];
                }
                if (list.IsColumnPresent("DefaultPhotoStorageLocation"))
                {
                    obj.DefaultPhoto.StorageLocation = (int)dr["DefaultPhotoStorageLocation"];
                }
                if (list.IsColumnPresent("DefaultPhotoServer"))
                {
                    obj.DefaultPhoto.Server = (int)dr["DefaultPhotoServer"];
                }
                if (list.IsColumnPresent("DefaultPhotoPath"))
                {
                    obj.DefaultPhoto.Path = (string)dr["DefaultPhotoPath"];
                }
                if (list.IsColumnPresent("DefaultPhotoFileName"))
                {
                    obj.DefaultPhoto.FileName = (string)dr["DefaultPhotoFileName"];
                }
                if (list.IsColumnPresent("DefaultPhotoCreatedDT"))
                {
                    obj.DefaultPhoto.CreatedDT = (DateTime)dr["DefaultPhotoCreatedDT"];
                }


                if (list.IsColumnPresent("DeviceID"))
                {
                    obj.device = new List <Device>();
                    obj.device.Add(new Device());
                }
                if (list.IsColumnPresent("DeviceID"))
                {
                    obj.device[0].DeviceID = (int)dr["DeviceID"];
                }
                if (list.IsColumnPresent("DeviceTagID"))
                {
                    obj.device[0].DeviceTagID = (string)dr["DeviceTagID"];
                }
                if (list.IsColumnPresent("DeviceMemberID"))
                {
                    obj.device[0].MemberID = (int)dr["DeviceMemberID"];
                }
                if (list.IsColumnPresent("DevicePrivateEncryptionKey"))
                {
                    obj.device[0].PrivateEncryptionKey = (string)dr["DevicePrivateEncryptionKey"];
                }
                if (list.IsColumnPresent("DeviceCreatedDT"))
                {
                    obj.device[0].CreatedDT = (DateTime)dr["DeviceCreatedDT"];
                }

                arr.Add(obj);
            }

            dr.Close();

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

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

            ContentInvite obj;

            while (dr.Read())
            {
                obj = new ContentInvite();
                if (list.IsColumnPresent("ContentInviteID")) { obj._contentInviteID = (int)dr["ContentInviteID"]; }
                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("EmailAddress")) { obj._emailAddress = (string)dr["EmailAddress"]; }
                if (list.IsColumnPresent("Link")) { obj._link = (string)dr["Link"]; }
                if (list.IsColumnPresent("CustomMessage")) { obj._customMessage = (string)dr["CustomMessage"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            EmailMessage obj;

            while (dr.Read())
            {
                obj = new EmailMessage();
                if (list.IsColumnPresent("EmailMessageID")) { obj._emailMessageID = (int)dr["EmailMessageID"]; }
                if (list.IsColumnPresent("WebEmailMessageID")) { obj._webEmailMessageID = (string)dr["WebEmailMessageID"]; }
                if (list.IsColumnPresent("ResourceFileID")) { obj._resourceFileID = (int)dr["ResourceFileID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("EmailAddress")) { obj._emailAddress = (string)dr["EmailAddress"]; }
                if (list.IsColumnPresent("Text")) { obj._text = (string)dr["Text"]; }
                if (list.IsColumnPresent("IsRead")) { obj._isRead = (bool)dr["IsRead"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #24
0
        /// <summary>
        /// Instanciates a ContentView object from the database via the ContentViewID
        /// </summary>
        public ContentView(int ContentViewID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetContentViewByContentViewID");
            db.AddInParameter(dbCommand, "ContentViewID", DbType.Int32, ContentViewID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

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

                }
                else
                {
                    throw new Exception("There is no ContentView in the database with the ID " + ContentViewID);
                }

                dr.Close();
            }
        }
Пример #25
0
        /// <summary>
        /// Instanciates a EmailReferral object from the database via the EmailReferralID
        /// </summary>
        public EmailReferral(int EmailReferralID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetEmailReferralByEmailReferralID");
            db.AddInParameter(dbCommand, "EmailReferralID", DbType.Int32, EmailReferralID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("EmailReferralID")) { this._emailReferralID = (int)dr["EmailReferralID"]; }
                    if (list.IsColumnPresent("NewMemberID")) { this._newMemberID = (int)dr["NewMemberID"]; }
                    if (list.IsColumnPresent("Email")) { this._email = (string)dr["Email"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no EmailReferral in the database with the ID " + EmailReferralID);
                }

                dr.Close();
            }
        }
Пример #26
0
        /// <summary>
        /// Instanciates a Dashboard object from the database via the DashboardID
        /// </summary>
        public Dashboard(int DashboardID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetDashboardByDashboardID");
            db.AddInParameter(dbCommand, "DashboardID", DbType.Int32, DashboardID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("DashboardID")) { this._dashboardID = (int)dr["DashboardID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("Inbox")) { this._inbox = (int)dr["Inbox"]; }
                    if (list.IsColumnPresent("ProfileComment")) { this._profileComment = (int)dr["ProfileComment"]; }
                    if (list.IsColumnPresent("FriendRequest")) { this._friendRequest = (int)dr["FriendRequest"]; }
                    if (list.IsColumnPresent("FriendRequestAccept")) { this._friendRequestAccept = (int)dr["FriendRequestAccept"]; }
                    if (list.IsColumnPresent("FriendRequestOutstanding")) { this._friendRequestOutstanding = (int)dr["FriendRequestOutstanding"]; }
                    if (list.IsColumnPresent("NetworkNewVideo")) { this._networkNewVideo = (int)dr["NetworkNewVideo"]; }
                    if (list.IsColumnPresent("NetworkNewGallery")) { this._networkNewGallery = (int)dr["NetworkNewGallery"]; }
                    if (list.IsColumnPresent("NetworkUpdatedProfile")) { this._networkUpdatedProfile = (int)dr["NetworkUpdatedProfile"]; }
                    if (list.IsColumnPresent("NetworkFavourite")) { this._networkFavourite = (int)dr["NetworkFavourite"]; }

                }
                else
                {
                    throw new Exception("There is no Dashboard in the database with the ID " + DashboardID);
                }

                dr.Close();
            }
        }
Пример #27
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of EmailReferrals
        /// </summary>
        public static List<EmailReferral> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            EmailReferral obj;

            while (dr.Read())
            {
                obj = new EmailReferral();
                if (list.IsColumnPresent("EmailReferralID")) { obj._emailReferralID = (int)dr["EmailReferralID"]; }
                if (list.IsColumnPresent("NewMemberID")) { obj._newMemberID = (int)dr["NewMemberID"]; }
                if (list.IsColumnPresent("Email")) { obj._email = (string)dr["Email"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            Device obj;

            while (dr.Read())
            {
                obj = new Device();
                if (list.IsColumnPresent("DeviceID")) { obj._deviceID = (int)dr["DeviceID"]; }
                if (list.IsColumnPresent("DeviceTagID")) { obj._deviceTagID = (string)dr["DeviceTagID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("PrivateEncryptionKey")) { obj._privateEncryptionKey = (string)dr["PrivateEncryptionKey"]; }
                if (list.IsColumnPresent("CreatedDT")) { obj._createdDT = (DateTime)dr["CreatedDT"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            AdminStatus obj;

            while (dr.Read())
            {
                obj = new AdminStatus();
                if (list.IsColumnPresent("AdminStatusID")) { obj._adminStatusID = (int)dr["AdminStatusID"]; }
                if (list.IsColumnPresent("Description")) { obj._description = (string)dr["Description"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            DeviceBlock obj;

            while (dr.Read())
            {
                obj = new DeviceBlock();
                if (list.IsColumnPresent("DeviceBlockID")) { obj._deviceBlockID = (int)dr["DeviceBlockID"]; }
                if (list.IsColumnPresent("DeviceTagID")) { obj._deviceTagID = (string)dr["DeviceTagID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("BlockingMemberID")) { obj._blockingMemberID = (int)dr["BlockingMemberID"]; }
                if (list.IsColumnPresent("MACAddress")) { obj._mACAddress = (string)dr["MACAddress"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            FeaturedChannel obj;

            while (dr.Read())
            {
                obj = new FeaturedChannel();
                if (list.IsColumnPresent("FeaturedChannelID")) { obj._featuredChannelID = (int)dr["FeaturedChannelID"]; }
                if (list.IsColumnPresent("Position")) { obj._position = (int)dr["Position"]; }
                if (list.IsColumnPresent("ChannelID")) { obj._channelID = (int)dr["ChannelID"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            EmailMessage obj;

            while (dr.Read())
            {
                obj = new EmailMessage();
                if (list.IsColumnPresent("EmailMessageID")) { obj._emailMessageID = (int)dr["EmailMessageID"]; }
                if (list.IsColumnPresent("WebEmailMessageID")) { obj._webEmailMessageID = (string)dr["WebEmailMessageID"]; }
                if (list.IsColumnPresent("ResourceFileID")) { obj._resourceFileID = (int)dr["ResourceFileID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("EmailAddress")) { obj._emailAddress = (string)dr["EmailAddress"]; }
                if (list.IsColumnPresent("Text")) { obj._text = (string)dr["Text"]; }
                if (list.IsColumnPresent("IsRead")) { obj._isRead = (bool)dr["IsRead"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                obj.VideoMessage = new ResourceFile();
                if (list.IsColumnPresent("VideoMessageResourceFileID")) { obj.VideoMessage.ResourceFileID = (int)dr["VideoMessageResourceFileID"]; }
                if (list.IsColumnPresent("VideoMessageWebResourceFileID")) { obj.VideoMessage.WebResourceFileID = (string)dr["VideoMessageWebResourceFileID"]; }
                if (list.IsColumnPresent("VideoMessageResourceType")) { obj.VideoMessage.ResourceType = (int)dr["VideoMessageResourceType"]; }
                if (list.IsColumnPresent("VideoMessageStorageLocation")) { obj.VideoMessage.StorageLocation = (int)dr["VideoMessageStorageLocation"]; }
                if (list.IsColumnPresent("VideoMessageServer")) { obj.VideoMessage.Server = (int)dr["VideoMessageServer"]; }
                if (list.IsColumnPresent("VideoMessagePath")) { obj.VideoMessage.Path = (string)dr["VideoMessagePath"]; }
                if (list.IsColumnPresent("VideoMessageFileName")) { obj.VideoMessage.FileName = (string)dr["VideoMessageFileName"]; }
                if (list.IsColumnPresent("VideoMessageCreatedDT")) { obj.VideoMessage.CreatedDT = (DateTime)dr["VideoMessageCreatedDT"]; }

                obj.Member = new Member();
                if (list.IsColumnPresent("MemberMemberID")) { obj.Member.MemberID = (int)dr["MemberMemberID"]; }
                if (list.IsColumnPresent("MemberWebMemberID")) { obj.Member.WebMemberID = (string)dr["MemberWebMemberID"]; }
                if (list.IsColumnPresent("MemberAdminStatusID")) { obj.Member.AdminStatusID = (int)dr["MemberAdminStatusID"]; }
                if (list.IsColumnPresent("MemberNickName")) { obj.Member.NickName = (string)dr["MemberNickName"]; }
                if (list.IsColumnPresent("MemberChannelID")) { obj.Member.ChannelID = (int)dr["MemberChannelID"]; }
                if (list.IsColumnPresent("MemberPassword")) { obj.Member.Password = (string)dr["MemberPassword"]; }
                if (list.IsColumnPresent("MemberEmail")) { obj.Member.Email = (string)dr["MemberEmail"]; }
                if (list.IsColumnPresent("MemberGender")) { obj.Member.Gender = (int)dr["MemberGender"]; }
                if (list.IsColumnPresent("MemberFirstName")) { obj.Member.FirstName = (string)dr["MemberFirstName"]; }
                if (list.IsColumnPresent("MemberLastName")) { obj.Member.LastName = (string)dr["MemberLastName"]; }
                if (list.IsColumnPresent("MemberProfilePhotoResourceFileID")) { obj.Member.ProfilePhotoResourceFileID = (int)dr["MemberProfilePhotoResourceFileID"]; }
                if (list.IsColumnPresent("MemberDOB")) { obj.Member.DOB = (DateTime)dr["MemberDOB"]; }
                if (list.IsColumnPresent("MemberISOCountry")) { obj.Member.ISOCountry = (string)dr["MemberISOCountry"]; }
                if (list.IsColumnPresent("MemberAccountType")) { obj.Member.AccountType = (int)dr["MemberAccountType"]; }
                if (list.IsColumnPresent("MemberZipPostcode")) { obj.Member.ZipPostcode = (string)dr["MemberZipPostcode"]; }
                if (list.IsColumnPresent("MemberPhoneNumber")) { obj.Member.PhoneNumber = (string)dr["MemberPhoneNumber"]; }
                if (list.IsColumnPresent("MemberMobilePhoneID")) { obj.Member.MobilePhoneID = (int)dr["MemberMobilePhoneID"]; }
                if (list.IsColumnPresent("MemberIPLocationID")) { obj.Member.IPLocationID = (int)dr["MemberIPLocationID"]; }
                if (list.IsColumnPresent("MemberCreatedDT")) { obj.Member.CreatedDT = (DateTime)dr["MemberCreatedDT"]; }


                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #33
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);
        }
Пример #34
0
        /// <summary>
        /// Instanciates a AdminStatus object from the database via the AdminStatusID
        /// </summary>
        public AdminStatus(int AdminStatusID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetAdminStatusByAdminStatusID");
            db.AddInParameter(dbCommand, "AdminStatusID", DbType.Int32, AdminStatusID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("AdminStatusID")) { this._adminStatusID = (int)dr["AdminStatusID"]; }
                    if (list.IsColumnPresent("Description")) { this._description = (string)dr["Description"]; }

                }
                else
                {
                    throw new Exception("There is no AdminStatus in the database with the ID " + AdminStatusID);
                }

                dr.Close();
            }
        }
Пример #35
0
        public static List <FeedItem> PopulateObjectWithJoin(IDataReader dr, List <FeedItem> FeedItems)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            FeedItem feedItem;

            while (dr.Read())
            {
                feedItem = new FeedItem();

                feedItem.Friend1FullName = string.Empty;
                feedItem.Friend2FullName = string.Empty;

                if (list.IsColumnPresent("FeedItemType"))
                {
                    feedItem.FeedItemType = (FeedItemType)dr["FeedItemType"];
                }
                if (list.IsColumnPresent("Url"))
                {
                    feedItem.MainWebID = (string)dr["Url"];
                }
                if (list.IsColumnPresent("Thumbnail"))
                {
                    feedItem.Thumbnail = "http://www.next2friends.com/user/" + (string)dr["Thumbnail"];
                }
                if (list.IsColumnPresent("AskAFriendQuestion"))
                {
                    feedItem.AskAFriendQuestion = (string)dr["AskAFriendQuestion"];
                }
                if (list.IsColumnPresent("Text"))
                {
                    feedItem.Text = (string)dr["Text"];
                }
                if (list.IsColumnPresent("Title"))
                {
                    feedItem.Title = (string)dr["Title"];
                }
                if (list.IsColumnPresent("FriendNickname1"))
                {
                    feedItem.FriendNickname1 = (string)dr["FriendNickname1"];
                }
                if (list.IsColumnPresent("FriendNickname2"))
                {
                    feedItem.FriendNickname2 = (string)dr["FriendNickname2"];
                }
                if (list.IsColumnPresent("FriendWebMemberID1"))
                {
                    feedItem.FriendWebMemberID1 = (string)dr["FriendWebMemberID1"];
                }
                if (list.IsColumnPresent("FriendWebMemberID2"))
                {
                    feedItem.FriendWebMemberID2 = (string)dr["FriendWebMemberID2"];
                }
                if (list.IsColumnPresent("WebPhotoCollectionID"))
                {
                    feedItem.WebPhotoCollectionID = (string)dr["WebPhotoCollectionID"];
                }
                if (list.IsColumnPresent("WebPhotoID"))
                {
                    feedItem.WebPhotoID = (string)dr["WebPhotoID"];
                }
                if (list.IsColumnPresent("DateTime"))
                {
                    feedItem.DateTime = (DateTime)dr["DateTime"];
                }
                if (list.IsColumnPresent("Friend1FullName"))
                {
                    feedItem.Friend1FullName = (string)dr["Friend1FullName"];
                }
                if (list.IsColumnPresent("Friend2FullName"))
                {
                    feedItem.Friend2FullName = (string)dr["Friend2FullName"];
                }

                FeedItems.Add(feedItem);
            }

            return(FeedItems);
        }
Пример #36
0
        /// <summary>
        /// Instanciates a Abuse object from the database via the AbuseID
        /// </summary>
        public Abuse(int AbuseID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetAbuseByAbuseID");
            db.AddInParameter(dbCommand, "AbuseID", DbType.Int32, AbuseID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("AbuseID")) { this._abuseID = (int)dr["AbuseID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("ResourceFileID")) { this._resourceFileID = (string)dr["ResourceFileID"]; }
                    if (list.IsColumnPresent("URL")) { this._uRL = (string)dr["URL"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no Abuse in the database with the ID " + AbuseID);
                }

                dr.Close();
            }
        }
Пример #37
0
        /// <summary>
        /// Instanciates a Comment object from the database via the CommentID
        /// </summary>
        public Comment(int CommentID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetCommentByCommentID");
            db.AddInParameter(dbCommand, "CommentID", DbType.Int32, CommentID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("CommentID")) { this._commentID = (int)dr["CommentID"]; }
                    if (list.IsColumnPresent("WebCommentID")) { this._webCommentID = (string)dr["WebCommentID"]; }
                    if (list.IsColumnPresent("ObjectID")) { this._objectID = (int)dr["ObjectID"]; }
                    if (list.IsColumnPresent("MemberIDFrom")) { this._memberIDFrom = (int)dr["MemberIDFrom"]; }
                    if (list.IsColumnPresent("InReplyToCommentID")) { this._inReplyToCommentID = (int)dr["InReplyToCommentID"]; }
                    if (list.IsColumnPresent("Text")) { this._text = (string)dr["Text"]; }
                    if (list.IsColumnPresent("IsDeleted")) { this._isDeleted = (bool)dr["IsDeleted"]; }
                    if (list.IsColumnPresent("Path")) { this._path = (string)dr["Path"]; }
                    if (list.IsColumnPresent("CommentType")) { this._commentType = (int)dr["CommentType"]; }
                    if (list.IsColumnPresent("ThreadNo")) { this._threadNo = (int)dr["ThreadNo"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }
                    if (list.IsColumnPresent("SentFromMobile")) { this._sentFromMobile = (int)dr["SentFromMobile"]; }

                }
                else
                {
                    throw new Exception("There is no Comment in the database with the ID " + CommentID);
                }

                dr.Close();
            }
        }
Пример #38
0
        /// <summary>
        /// Instanciates a FavouriteGroup object from the database via the FavouriteGroupID
        /// </summary>
        public FavouriteGroup(int FavouriteGroupID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetFavouriteGroupByFavouriteGroupID");
            db.AddInParameter(dbCommand, "FavouriteGroupID", DbType.Int32, FavouriteGroupID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("FavouriteGroupID")) { this._favouriteGroupID = (int)dr["FavouriteGroupID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("TheFavouriteGroupID")) { this._theFavouriteGroupID = (int)dr["TheFavouriteGroupID"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no FavouriteGroup in the database with the ID " + FavouriteGroupID);
                }

                dr.Close();
            }
        }
Пример #39
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of Comments
        /// </summary>
        public static List<Comment> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            Comment obj;

            while (dr.Read())
            {
                obj = new Comment();
                if (list.IsColumnPresent("CommentID")) { obj._commentID = (int)dr["CommentID"]; }
                if (list.IsColumnPresent("WebCommentID")) { obj._webCommentID = (string)dr["WebCommentID"]; }
                if (list.IsColumnPresent("ObjectID")) { obj._objectID = (int)dr["ObjectID"]; }
                if (list.IsColumnPresent("MemberIDFrom")) { obj._memberIDFrom = (int)dr["MemberIDFrom"]; }
                if (list.IsColumnPresent("InReplyToCommentID")) { obj._inReplyToCommentID = (int)dr["InReplyToCommentID"]; }
                if (list.IsColumnPresent("Text")) { obj._text = (string)dr["Text"]; }
                if (list.IsColumnPresent("IsDeleted")) { obj._isDeleted = (bool)dr["IsDeleted"]; }
                if (list.IsColumnPresent("Path")) { obj._path = (string)dr["Path"]; }
                if (list.IsColumnPresent("CommentType")) { obj._commentType = (int)dr["CommentType"]; }
                if (list.IsColumnPresent("ThreadNo")) { obj._threadNo = (int)dr["ThreadNo"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }
                if (list.IsColumnPresent("SentFromMobile")) { obj._sentFromMobile = (int)dr["SentFromMobile"]; }

                arr.Add(obj);
            }

            dr.Close();

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

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

            FavouriteMember obj;

            while (dr.Read())
            {
                obj = new FavouriteMember();
                if (list.IsColumnPresent("FavouriteMemberID")) { obj._favouriteMemberID = (int)dr["FavouriteMemberID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("TheFavouriteMemberID")) { obj._theFavouriteMemberID = (int)dr["TheFavouriteMemberID"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #41
0
        /// <summary>
        /// Instanciates a ContactImport object from the database via the ContactImportID
        /// </summary>
        public ContactImport(int ContactImportID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetContactImportByContactImportID");
            db.AddInParameter(dbCommand, "ContactImportID", DbType.Int32, ContactImportID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("ContactImportID")) { this._contactImportID = (int)dr["ContactImportID"]; }
                    if (list.IsColumnPresent("ImporterMemberID")) { this._importerMemberID = (int)dr["ImporterMemberID"]; }
                    if (list.IsColumnPresent("Email")) { this._email = (string)dr["Email"]; }
                    if (list.IsColumnPresent("Name")) { this._name = (string)dr["Name"]; }
                    if (list.IsColumnPresent("InviteState")) { this._inviteState = (int)dr["InviteState"]; }
                    if (list.IsColumnPresent("FriendState")) { this._friendState = (int)dr["FriendState"]; }
                    if (list.IsColumnPresent("OpenedEmailInvite")) { this._openedEmailInvite = (bool)dr["OpenedEmailInvite"]; }
                    if (list.IsColumnPresent("ClickedEmailInvite")) { this._clickedEmailInvite = (bool)dr["ClickedEmailInvite"]; }
                    if (list.IsColumnPresent("JoinedFromInvite")) { this._joinedFromInvite = (bool)dr["JoinedFromInvite"]; }
                    if (list.IsColumnPresent("BecameMemberID")) { this._becameMemberID = (int)dr["BecameMemberID"]; }
                    if (list.IsColumnPresent("ImportToken")) { this._importToken = (string)dr["ImportToken"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no ContactImport in the database with the ID " + ContactImportID);
                }

                dr.Close();
            }
        }
Пример #42
0
        /// <summary>
        /// Instanciates a FeaturedMember object from the database via the FeaturedMemberID
        /// </summary>
        public FeaturedMember(int FeaturedMemberID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetFeaturedMemberByFeaturedMemberID");
            db.AddInParameter(dbCommand, "FeaturedMemberID", DbType.Int32, FeaturedMemberID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("FeaturedMemberID")) { this._featuredMemberID = (int)dr["FeaturedMemberID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("Position")) { this._position = (int)dr["Position"]; }
                    if (list.IsColumnPresent("IsDisplayed")) { this._isDisplayed = (bool)dr["IsDisplayed"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no FeaturedMember in the database with the ID " + FeaturedMemberID);
                }

                dr.Close();
            }
        }
Пример #43
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of ContactImports
        /// </summary>
        public static List<ContactImport> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            ContactImport obj;

            while (dr.Read())
            {
                obj = new ContactImport();
                if (list.IsColumnPresent("ContactImportID")) { obj._contactImportID = (int)dr["ContactImportID"]; }
                if (list.IsColumnPresent("ImporterMemberID")) { obj._importerMemberID = (int)dr["ImporterMemberID"]; }
                if (list.IsColumnPresent("Email")) { obj._email = (string)dr["Email"]; }
                if (list.IsColumnPresent("Name")) { obj._name = (string)dr["Name"]; }
                if (list.IsColumnPresent("InviteState")) { obj._inviteState = (int)dr["InviteState"]; }
                if (list.IsColumnPresent("FriendState")) { obj._friendState = (int)dr["FriendState"]; }
                if (list.IsColumnPresent("OpenedEmailInvite")) { obj._openedEmailInvite = (bool)dr["OpenedEmailInvite"]; }
                if (list.IsColumnPresent("ClickedEmailInvite")) { obj._clickedEmailInvite = (bool)dr["ClickedEmailInvite"]; }
                if (list.IsColumnPresent("JoinedFromInvite")) { obj._joinedFromInvite = (bool)dr["JoinedFromInvite"]; }
                if (list.IsColumnPresent("BecameMemberID")) { obj._becameMemberID = (int)dr["BecameMemberID"]; }
                if (list.IsColumnPresent("ImportToken")) { obj._importToken = (string)dr["ImportToken"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Пример #44
0
        /// <summary>
        /// Instanciates a Feedback object from the database via the FeedbackID
        /// </summary>
        public Feedback(int FeedbackID)
        {
            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("AG_GetFeedbackByFeedbackID");
            db.AddInParameter(dbCommand, "FeedbackID", DbType.Int32, FeedbackID);

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                ColumnFieldList list = new ColumnFieldList(dr);

                if (dr.Read())
                {
                    if (list.IsColumnPresent("FeedbackID")) { this._feedbackID = (int)dr["FeedbackID"]; }
                    if (list.IsColumnPresent("MemberID")) { this._memberID = (int)dr["MemberID"]; }
                    if (list.IsColumnPresent("Name")) { this._name = (string)dr["Name"]; }
                    if (list.IsColumnPresent("EmailAddress")) { this._emailAddress = (string)dr["EmailAddress"]; }
                    if (list.IsColumnPresent("Text")) { this._text = (string)dr["Text"]; }
                    if (list.IsColumnPresent("DTCreated")) { this._dTCreated = (DateTime)dr["DTCreated"]; }

                }
                else
                {
                    throw new Exception("There is no Feedback in the database with the ID " + FeedbackID);
                }

                dr.Close();
            }
        }
Пример #45
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of FriendRequests
        /// </summary>
        public static List <FriendRequest> PopulateFriendRequestWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            FriendRequest obj;

            while (dr.Read())
            {
                obj = new FriendRequest();
                obj._friendRequestID    = (int)dr["FriendRequestID"];
                obj._webFriendRequestID = (string)dr["WebFriendRequestID"];
                obj._memberID           = (int)dr["MemberID"];
                obj._origin             = (int)dr["Origin"];
                obj._friendMemberID     = (int)dr["FriendMemberID"];
                obj._status             = (int)dr["Status"];
                obj._dTCreated          = (DateTime)dr["DTCreated"];

                obj.FriendMember = new Member();
                if (list.IsColumnPresent("FriendMemberMemberID"))
                {
                    obj.FriendMember.MemberID = (int)dr["FriendMemberMemberID"];
                }
                if (list.IsColumnPresent("FriendMemberWebMemberID"))
                {
                    obj.FriendMember.WebMemberID = (string)dr["FriendMemberWebMemberID"];
                }
                if (list.IsColumnPresent("FriendMemberAdminStatusID"))
                {
                    obj.FriendMember.AdminStatusID = (int)dr["FriendMemberAdminStatusID"];
                }
                if (list.IsColumnPresent("FriendMemberNickName"))
                {
                    obj.FriendMember.NickName = (string)dr["FriendMemberNickName"];
                }
                if (list.IsColumnPresent("FriendMemberChannelID"))
                {
                    obj.FriendMember.ChannelID = (int)dr["FriendMemberChannelID"];
                }
                if (list.IsColumnPresent("FriendMemberPassword"))
                {
                    obj.FriendMember.Password = (string)dr["FriendMemberPassword"];
                }
                if (list.IsColumnPresent("FriendMemberEmail"))
                {
                    obj.FriendMember.Email = (string)dr["FriendMemberEmail"];
                }
                if (list.IsColumnPresent("FriendMemberGender"))
                {
                    obj.FriendMember.Gender = (int)dr["FriendMemberGender"];
                }
                if (list.IsColumnPresent("FriendMemberFirstName"))
                {
                    obj.FriendMember.FirstName = (string)dr["FriendMemberFirstName"];
                }
                if (list.IsColumnPresent("FriendMemberLastName"))
                {
                    obj.FriendMember.LastName = (string)dr["FriendMemberLastName"];
                }
                if (list.IsColumnPresent("FriendMemberProfilePhotoResourceFileID"))
                {
                    obj.FriendMember.ProfilePhotoResourceFileID = (int)dr["FriendMemberProfilePhotoResourceFileID"];
                }
                if (list.IsColumnPresent("FriendMemberDOB"))
                {
                    obj.FriendMember.DOB = (DateTime)dr["FriendMemberDOB"];
                }
                if (list.IsColumnPresent("FriendMemberISOCountry"))
                {
                    obj.FriendMember.ISOCountry = (string)dr["FriendMemberISOCountry"];
                }
                if (list.IsColumnPresent("FriendMemberZipPostcode"))
                {
                    obj.FriendMember.ZipPostcode = (string)dr["FriendMemberZipPostcode"];
                }
                if (list.IsColumnPresent("FriendMemberCreatedDT"))
                {
                    obj.FriendMember.CreatedDT = (DateTime)dr["FriendMemberCreatedDT"];
                }
                if (list.IsColumnPresent("FriendMemberLastOnline"))
                {
                    obj.FriendMember.LastOnline = (DateTime)dr["FriendMemberLastOnline"];
                }

                if (list.IsColumnPresent("PhotoURL"))
                {
                    obj.PhotoURL = (string)dr["PhotoURL"];
                }


                arr.Add(obj);
            }

            return(arr);
        }