Exemple #1
0
    public string GenerateGalleries()
    {
        StringBuilder sbHTMLList = new StringBuilder();

        photoCollections = PhotoCollection.GetAllPhotoCollectionWithEmptyByMemberID(member.MemberID);

        for (int i = 0; i < photoCollections.Count; i++)
        {
            StringBuilder sbHTMLItem = new StringBuilder();

            object[] parameters = new object[6];

            parameters[0] = photoCollections[i].WebPhotoCollectionID;
            parameters[1] = photoCollections[i].ShortName.Replace("'", "&#39;");
            parameters[2] = photoCollections[i].ShortDescription.Replace("'", "&#39;");
            parameters[3] = photoCollections[i].NumberOfPhotos;
            parameters[4] = photoCollections[i].Description.Replace("'", "&#39;");
            parameters[5] = i;

            string HTMLItem = @"<div class='category_item clearfix'>
					        <p class='cat_name'>
						        <a href='/MyPhotoGallery.aspx?pc={0}' id='lblName{0}'><strong>{1}</strong></a> ({3})
					        </p>
					        <p class='description' id='lblDescription{0}'>
						        {2}
					        </p>
					        <p class='actions'>
						        <a href='#TB_inline?height=180&width=350&inlineId=divConfirmDelete{5}&modal=true' class='thickbox'>Delete</a>
                                <a href='#' class='edit'>Edit</a>
					        </p>
					        <div class='edit_cat_item clearfix' style='display: none;' id='edit{0}'>
						        <p class='cat_name'>
							        <label>Gallery Name</label><br />
							        <input name='' maxlength='40' id='txtName{0}' type='text' class='form_txt' value='{1}' />
						        </p>
						        <p class='description'>
							        <label>Description</label><br />
							        <textarea name='' id='txtDescription{0}' class='form_txt'>{4}</textarea>
						        </p>
						        <p class='actions'>
							        <input name='' type='button' value='Save' class='form_btn' onclick='ajaxEditGallery(""{0}"",txtName{0},txtDescription{0})' />
						        </p>
					        </div>
				        </div><div id='divConfirmDelete{5}' style='display:none;'><div style='padding-bottom:15px;background-color:#FFFFFF;padding-left: 15px;padding-right: 5px;'><p></p><p>Are you sure you want to delete <strong>{1}</strong>?</p><p>Deleting this Gallery will also delete all your photos belonging to it</p><p></p><p style='text-align:right;padding-right: 25px'><input type='button' value='No thanks' class='form_btn2' onclick='javascript:tb_remove();'> <input type='button' class='form_btn2' value='Yes delete' onclick='window.location.href=""/MyPhotoGallery.aspx?d={0}""'></p></div></div>"                ;

            sbHTMLItem.AppendFormat(HTMLItem, parameters);
            sbHTMLList.Append(sbHTMLItem.ToString());
        }

        //</div><div id='divConfirmDelete{5}'><div style='display:none;padding-left: 35px;padding-right: 35px;'><p></p><p>Are you sure you want to delete <strong>{1}</strong>?</p><p>Deleting this Gallery will also delete all your photos belonging to it</p><p></p><p style='text-align:right;padding-right: 25px'><input type='button' value='No thanks' class='form_btn2' onclick='javascript:tb_remove();'> <input type='button' class='form_btn2' value='Yes delete' onclick='window.location.href=""/MyPhotoGallery.aspx?d={0}""'></p></div></div>";
        MyGalleriesHTML = sbHTMLList.ToString();

        return(sbHTMLList.ToString());
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Member member = (Member)Session["Member"];

        RememberMeLogin();

        EncWebMemberID = RijndaelEncryption.Encrypt(member.WebMemberID);

        List <PhotoCollection> Gallerys = PhotoCollection.GetAllPhotoCollectionWithEmptyByMemberID(member.MemberID);

        for (int i = 0; i < Gallerys.Count; i++)
        {
            Params += "<PARAM name=\"galleryName::" + i + "\" value=\"" + Gallerys[i].Name.Replace("'", "") + "\" />";
            Params += "<PARAM name=\"galleryID::" + i + "\" value=\"" + Gallerys[i].WebPhotoCollectionID + "\" />";
        }

        string DefaultGalleryID = Request.Params["DefaultGalleryID"];

        if (DefaultGalleryID != null)
        {
            Params += "<PARAM name=\"DefaultGalleryID\" value=\"" + DefaultGalleryID + "\" />";
        }
    }