Esempio n. 1
0
        public WebNSpot(int NspotID)
        {
            NSpot nspot = new NSpot(NspotID);

            this.Name        = nspot.Name;
            this.Description = nspot.Description;
            this.BeginTime   = nspot.StartDateTime;
            this.EndTime     = nspot.EndDateTime;

            Videos       = GetAllNSpotMemberAndVideoByNSpotID(NspotID);
            Photos       = GetNSpotPhotoByNSpotID(NspotID);
            NSpotMembers = GetNSpotMemberByNSpotID(NspotID);
        }
Esempio n. 2
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of NSpots
        /// </summary>
        public static List<NSpot> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            NSpot obj;

            while (dr.Read())
            {
                obj = new NSpot();
                if (list.IsColumnPresent("NSpotID")) { obj._nSpotID = (int)dr["NSpotID"]; }
                if (list.IsColumnPresent("WebNSpotID")) { obj._webNSpotID = (string)dr["WebNSpotID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("PhotoResourceFileID")) { obj._photoResourceFileID = (int)dr["PhotoResourceFileID"]; }
                if (list.IsColumnPresent("ThumbnailResourceFileID")) { obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"]; }
                if (list.IsColumnPresent("Name")) { obj._name = (string)dr["Name"]; }
                if (list.IsColumnPresent("Description")) { obj._description = (string)dr["Description"]; }
                if (list.IsColumnPresent("TotalVoteScore")) { obj._totalVoteScore = (int)dr["TotalVoteScore"]; }
                if (list.IsColumnPresent("NumberOfViews")) { obj._numberOfViews = (int)dr["NumberOfViews"]; }
                if (list.IsColumnPresent("NumberOfComments")) { obj._numberOfComments = (int)dr["NumberOfComments"]; }
                if (list.IsColumnPresent("NumberOfMembers")) { obj._numberOfMembers = (int)dr["NumberOfMembers"]; }
                if (list.IsColumnPresent("NumberOfPhotos")) { obj._numberOfPhotos = (int)dr["NumberOfPhotos"]; }
                if (list.IsColumnPresent("NumberOfVideos")) { obj._numberOfVideos = (int)dr["NumberOfVideos"]; }
                if (list.IsColumnPresent("AskBeforeJoining")) { obj._askBeforeJoining = (bool)dr["AskBeforeJoining"]; }
                if (list.IsColumnPresent("StartDateTime")) { obj._startDateTime = (DateTime)dr["StartDateTime"]; }
                if (list.IsColumnPresent("EndDateTime")) { obj._endDateTime = (DateTime)dr["EndDateTime"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Esempio n. 3
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of NSpots
        /// </summary>
        public static List<NSpot> PopulateObjectWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

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

            NSpot obj;

            while (dr.Read())
            {
                obj = new NSpot();
                if (list.IsColumnPresent("NSpotID")) { obj._nSpotID = (int)dr["NSpotID"]; }
                if (list.IsColumnPresent("WebNSpotID")) { obj._webNSpotID = (string)dr["WebNSpotID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("PhotoResourceFileID")) { obj._photoResourceFileID = (int)dr["PhotoResourceFileID"]; }
                if (list.IsColumnPresent("ThumbnailResourceFileID")) { obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"]; }
                if (list.IsColumnPresent("Name")) { obj._name = (string)dr["Name"]; }
                if (list.IsColumnPresent("Description")) { obj._description = (string)dr["Description"]; }
                if (list.IsColumnPresent("TotalVoteScore")) { obj._totalVoteScore = (int)dr["TotalVoteScore"]; }
                if (list.IsColumnPresent("NumberOfViews")) { obj._numberOfViews = (int)dr["NumberOfViews"]; }
                if (list.IsColumnPresent("NumberOfComments")) { obj._numberOfComments = (int)dr["NumberOfComments"]; }
                if (list.IsColumnPresent("NumberOfMembers")) { obj._numberOfMembers = (int)dr["NumberOfMembers"]; }
                if (list.IsColumnPresent("NumberOfPhotos")) { obj._numberOfPhotos = (int)dr["NumberOfPhotos"]; }
                if (list.IsColumnPresent("NumberOfVideos")) { obj._numberOfVideos = (int)dr["NumberOfVideos"]; }
                if (list.IsColumnPresent("AskBeforeJoining")) { obj._askBeforeJoining = (bool)dr["AskBeforeJoining"]; }
                if (list.IsColumnPresent("StartDateTime")) { obj._startDateTime = (DateTime)dr["StartDateTime"]; }
                if (list.IsColumnPresent("EndDateTime")) { obj._endDateTime = (DateTime)dr["EndDateTime"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }

                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("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;
        }
Esempio n. 4
0
        public static NSpot ProcessNSpotPhoto(Member member, NSpot nSpot, Image image)
        {
            Database      db          = DatabaseFactory.CreateDatabase();
            DbConnection  conn        = db.CreateConnection();
            DbTransaction Transaction = null;

            try
            {
                conn.Open();
                Transaction = conn.BeginTransaction();

                string GlobalWebID = UniqueID.NewWebID();
                string FileName    = GlobalWebID + @".jpg";

                // create the large photo
                // just store the large image.. dont make a resource record
                System.Drawing.Image MainImage = Photo.Resize480x480(image);
                string Savepath = member.NickName + @"\" + "nslrge" + @"\" + FileName;
                Photo.SaveToDisk(MainImage, Savepath);

                //create the medium
                ResourceFile PhotoResourceFile = new ResourceFile();
                PhotoResourceFile.CreatedDT         = DateTime.Now;
                PhotoResourceFile.WebResourceFileID = GlobalWebID;
                PhotoResourceFile.ResourceType      = (int)ResourceFileType.NspotPhoto;
                PhotoResourceFile.Path     = member.NickName + "/" + "nsmed" + "/";
                PhotoResourceFile.FileName = FileName;
                PhotoResourceFile.Save(db);
                System.Drawing.Image MediumImage = Photo.Resize190x130(MainImage);
                Photo.SaveToDisk(MediumImage, PhotoResourceFile.SavePath);

                //create the thumbnail
                ResourceFile ThumbnailResourceFile = new ResourceFile();
                ThumbnailResourceFile.CreatedDT         = DateTime.Now;
                ThumbnailResourceFile.WebResourceFileID = GlobalWebID;
                ThumbnailResourceFile.ResourceType      = (int)ResourceFileType.NspotThumbnail;
                ThumbnailResourceFile.Path     = member.NickName + "/" + "nsthmb" + "/";
                ThumbnailResourceFile.FileName = FileName;
                ThumbnailResourceFile.Save(db);
                System.Drawing.Image ThumbnailImage = Photo.ResizeTo124x91(MediumImage);
                Photo.SaveToDisk(ThumbnailImage, ThumbnailResourceFile.SavePath);

                // attached the resource ids to the photos
                nSpot.ThumbnailResourceFileID = ThumbnailResourceFile.ResourceFileID;
                nSpot.PhotoResourceFileID     = PhotoResourceFile.ResourceFileID;

                nSpot.Save(db);

                Transaction.Commit();
            }
            catch (Exception ex)
            {
                Transaction.Rollback();
                throw ex;
            }
            finally
            {
                conn.Close();
            }

            return(nSpot);
        }
Esempio n. 5
0
        /// <summary>
        /// overload using a byte array
        /// </summary>
        /// <param name="member"></param>
        /// <param name="PhotoCollectionID"></param>
        /// <param name="byteImage"></param>
        public static NSpot ProcessNSpotPhoto(Member member, NSpot nSpot, byte[] byteImage)
        {
            Image image = ByteArrayToImage(byteImage);

            return(ProcessNSpotPhoto(member, nSpot, image));
        }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(NSpotPage));

        member = (Member)Session["Member"];

        // set the default forwarding if the member is not logged in
        LoginUrl = @"signup.aspx?u=" + Request.Url.AbsoluteUri;
        SubscribeLink = LoginUrl;
        SendMessageLink = LoginUrl;
        BlockMemberLink = LoginUrl;
        AddToFriendsLink = LoginUrl;
        DefaultVoteUpLink = LoginUrl;
        DefaultVoteDownLink = LoginUrl;
        AddFavouritesLink = LoginUrl;

        string strWebNSpotID = Request.Params["n"];
        // load the members photo
        string strMemberPhoto = Request.Params["np"];

        if (strWebNSpotID != null)
        {
            ViewingNSpot = NSpot.GetNSpotByNSpotWebIDWithJoin(strWebNSpotID);
            PhotoURL = ViewingNSpot.PhotoResourceFile.FullyQualifiedURL;
            ProfileDefaultPageType = NSDefaultPageType.NSpot;
            DefaultNumberOfViews = (++ViewingNSpot.NumberOfViews).ToString();
            ViewingNSpot.Save();

            PermaLink = WebRoot + "nspot.aspx?m=" + strWebNSpotID;

            GenerateNSpotMemberLister();
        }
      

        if (strMemberPhoto != null)
        {
            ResourceFile PhotoRes = new ResourceFile(ViewingNSpot.PhotoResourceFileID);
            LoadLargeNSpotPhoto = true;
            LargePhotoURL = @"user/" + ViewingNSpot.Member.NickName + "/nslrge/" + PhotoRes.FileName;
        }

        if (member != null)
        {
            IsLoggedIn = true;

            if (ViewingNSpot.MemberID == member.MemberID)
            {
                IsMyPage = true;
            }
        }

        GeneratePageComments();
        //CreateEmbeddedLinks();
    }
Esempio n. 7
0
        public static NSpot ProcessNSpotPhoto(Member member, NSpot nSpot, Image image)
        {
            Database db = DatabaseFactory.CreateDatabase();
            DbConnection conn = db.CreateConnection();
            DbTransaction Transaction = null;

            try
            {
                conn.Open();
                Transaction = conn.BeginTransaction();

                string GlobalWebID = UniqueID.NewWebID();
                string FileName = GlobalWebID + @".jpg";

                // create the large photo
                // just store the large image.. dont make a resource record
                System.Drawing.Image MainImage = Photo.Resize480x480(image);
                string Savepath = member.NickName + @"\" + "nslrge" + @"\" + FileName;
                Photo.SaveToDisk(MainImage, Savepath);

                //create the medium
                ResourceFile PhotoResourceFile = new ResourceFile();
                PhotoResourceFile.CreatedDT = DateTime.Now;
                PhotoResourceFile.WebResourceFileID = GlobalWebID;
                PhotoResourceFile.ResourceType = (int)ResourceFileType.NspotPhoto;
                PhotoResourceFile.Path = member.NickName + "/" + "nsmed" + "/";
                PhotoResourceFile.FileName = FileName;
                PhotoResourceFile.Save(db);
                System.Drawing.Image MediumImage = Photo.Resize190x130(MainImage);
                Photo.SaveToDisk(MediumImage, PhotoResourceFile.SavePath);

                //create the thumbnail
                ResourceFile ThumbnailResourceFile = new ResourceFile();
                ThumbnailResourceFile.CreatedDT = DateTime.Now;
                ThumbnailResourceFile.WebResourceFileID = GlobalWebID;
                ThumbnailResourceFile.ResourceType = (int)ResourceFileType.NspotThumbnail;
                ThumbnailResourceFile.Path = member.NickName + "/" + "nsthmb" + "/";
                ThumbnailResourceFile.FileName = FileName;
                ThumbnailResourceFile.Save(db);
                System.Drawing.Image ThumbnailImage = Photo.ResizeTo124x91(MediumImage);
                Photo.SaveToDisk(ThumbnailImage, ThumbnailResourceFile.SavePath);

                // attached the resource ids to the photos
                nSpot.ThumbnailResourceFileID = ThumbnailResourceFile.ResourceFileID;
                nSpot.PhotoResourceFileID = PhotoResourceFile.ResourceFileID;

                nSpot.Save(db);

                Transaction.Commit();

            }
            catch (Exception ex)
            {
                Transaction.Rollback();
                throw ex;
            }
            finally
            {
                conn.Close();
            }

            return nSpot;
        }
Esempio n. 8
0
        /// <summary>
        /// overload using a byte array
        /// </summary>
        /// <param name="member"></param>
        /// <param name="PhotoCollectionID"></param>
        /// <param name="byteImage"></param>
        public static NSpot ProcessNSpotPhoto(Member member, NSpot nSpot, byte[] byteImage)
        {
            Image image = ByteArrayToImage(byteImage);

            return ProcessNSpotPhoto(member, nSpot, image);
        }