Example #1
0
        //Generate Events
        public static string GetFiles(string folderName, string MainFolder, string Group)
        {
            string htmlString = "";

            List <PeraImage> images = CMSActivieies.GetPeraImage(MainFolder);

            //System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(HttpContext.Current.Server.MapPath(folderName));
            //to retrieve aspx files alone
            //System.IO.FileInfo[] fileEntries = di.GetFiles("*.jpg");
            //string[] fileEntries = Directory.GetFiles(Server.MapPath("images/PhotaGallery"));

            DBKOMPDataContext db  = new DBKOMPDataContext();
            PeraImage         obj = new PeraImage();

            obj.Directory = MainFolder;

            foreach (PeraImage fileName in images)
            {
                //htmlString = htmlString + "<div style='margin-left:5px;width:210px;height:210px;float:left'>";

                htmlString = htmlString + "<div style='margin-left:5px;width:180px;height:90px;margin-top:6px'>";
                htmlString = htmlString + "<div style='width:200px;height:90px;overflow:hidden;'  class='BoxPicBG'>";
                htmlString = htmlString + "<div style='margin:0 auto;width:180px;height:90px;overflow:hidden;vertical-align:middle;display:table-cell;' ><a rel='" + Group + "' style='outline: none;' class='fancy' title='" + fileName.Detail + "' href='images/" + MainFolder + "/" + fileName.FileName + "'>";
                htmlString = htmlString + " <img src='images/" + MainFolder + "/thumbs/thumbs_" + fileName.FileName + "' style='border:none;width:180px;height:auto;margin:0 auto' />";
                htmlString = htmlString + " </a></div> </div>";
                htmlString = htmlString + "<p style='margin-left:0px;display:none' >" + fileName.Detail + "</p> </div>";
            }
            return(htmlString);
        }
Example #2
0
        //Generate Events
        public static string GetFilesOnEventPage(string folderName, string MainFolder, string Group)
        {
            string htmlString = "";

            List <PeraImage> images = CMSActivieies.GetPeraImageOnEvent(MainFolder);

            //System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(HttpContext.Current.Server.MapPath(folderName));
            //to retrieve aspx files alone
            //System.IO.FileInfo[] fileEntries = di.GetFiles("*.jpg");
            //string[] fileEntries = Directory.GetFiles(Server.MapPath("images/PhotaGallery"));

            DBKOMPDataContext db  = new DBKOMPDataContext();
            PeraImage         obj = new PeraImage();

            obj.Directory = MainFolder;

            int    indx        = 1;
            string floatCss    = "float:left";
            string clearCss    = string.Empty;
            string EventName   = string.Empty;
            string CenterImage = string.Empty;

            foreach (PeraImage fileName in images)
            {
                if (indx == 1)
                {
                    EventName   = (from w in db.PhotoDirectories where w.FolderName == fileName.Directory select w).First().AlbumName;
                    CenterImage = "<img src='images/" + MainFolder + "/" + fileName.FileName + "' style='position:absolute;border:none;width:auto;height:380px;margin:0 auto' />";
                }

                //floatCss = indx%2==0?"float:left":"";
                clearCss = indx % 2 == 0?"<div style='clear:both'></div>":"";
                indx++;
                //htmlString = htmlString + "<div style='margin-left:5px;width:210px;height:210px;float:left'>";

                htmlString = htmlString + "<div style='margin-left:8px;width:90px;height:90px;margin-top:8px;" + floatCss + "'>";
                htmlString = htmlString + "<div style='width:90px;height:90px;overflow:hidden;'  class='BoxPicBG'>";
                //TODO : un commne blow an comment belwo next
                htmlString = htmlString + "<div style='margin:0 auto;width:90px;height:90px;overflow:hidden;vertical-align:middle;display:table-cell;' ><a rel='" + Group + "' style='outline: none;' class='fancy' title='" + fileName.Detail + "' href='images/" + MainFolder + "/" + fileName.FileName + "'>";
                //htmlString = htmlString + "<div style='margin:0 auto;width:90px;height:90px;overflow:hidden;vertical-align:middle;display:table-cell;' ><a rel='" + Group + "' style='outline: none;' class='fancy' title='" + fileName.Detail + "' href='Events.aspx?id=" + fileName.Id + "'>";
                htmlString = htmlString + " <img src='images/" + MainFolder + "/thumbs/thumbs_" + fileName.FileName + "' style='border:none;width:90px;height:90px;margin:0 auto' />";
                htmlString = htmlString + " </a></div> </div>";
                //htmlString = htmlString + "<p style='margin-left:0px;display:none' >" + fileName.Detail + "</p>
                htmlString = htmlString + "</div>";
                htmlString = htmlString + clearCss;
            }

            return(htmlString + "^" + EventName + "^" + CenterImage);
        }
Example #3
0
        public static string GetFilesForTitle(string folderName, string MainFolder, string Group)
        {
            string htmlString = "";

            List <PeraImage> images = CMSActivieies.GetPeraImage(MainFolder);

            //System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(HttpContext.Current.Server.MapPath(folderName));
            //to retrieve aspx files alone
            //System.IO.FileInfo[] fileEntries = di.GetFiles("*.jpg");
            //string[] fileEntries = Directory.GetFiles(Server.MapPath("images/PhotaGallery"));
            foreach (PeraImage fileName in images)
            {
                htmlString = htmlString + "<div id='" + fileName.FileName + "' ><a rel='" + Group + "' class='aaa' title='" + fileName.FileName + "' href='" + folderName + "/" + fileName.FileName + "'>" +
                             "<img id='img" + fileName.FileName + "' src='" + folderName + "/" + fileName.FileName + "' width='40' height='30' /></a><textarea id='txt" + fileName.FileName + "' cols='25' rows='2'>" + fileName.Detail + "</textarea></div>";
            }
            return(htmlString);
        }