66 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Web;
 | |
| using System.Web.UI;
 | |
| using System.Web.UI.WebControls;
 | |
| using BLL;
 | |
| 
 | |
| namespace FineUIPro.Web
 | |
| {
 | |
|     public partial class mainMenu_PHTGL : PageBase
 | |
|     {
 | |
|         protected void Page_Load(object sender, EventArgs e)
 | |
|         {
 | |
| 
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 
 | |
|         /// </summary>
 | |
|         public string swiperHtml;
 | |
| 
 | |
|         #region 项目图片
 | |
|         /// <summary>
 | |
|         /// 项目图片显示
 | |
|         /// </summary>
 | |
|         public void ProjectPic()
 | |
|         {
 | |
|             swiperHtml = " ";
 | |
|             var getP = from x in Funs.DB.InformationProject_Picture
 | |
|                        join y in Funs.DB.AttachFile on x.PictureId equals y.ToKeyId
 | |
|                        where y.AttachFileId != null && y.AttachUrl != null
 | |
|                        select new { x.ProjectId, x.UploadDate, y.AttachUrl };
 | |
|             if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
 | |
|             {
 | |
|                 getP = getP.Where(x => x.ProjectId == this.CurrUser.LoginProjectId);
 | |
|             }
 | |
|             var getList = getP.OrderByDescending(x => x.UploadDate).Take(5).ToList();
 | |
|             if (getList.Count() > 0)
 | |
|             {
 | |
|                 foreach (var item in getList)
 | |
|                 {
 | |
|                     var geturl = Funs.GetStrListByStr(item.AttachUrl, ',');
 | |
|                     foreach (var itemurl in geturl)
 | |
|                     {
 | |
|                         if (!string.IsNullOrEmpty(itemurl))
 | |
|                         {
 | |
|                             swiperHtml += @"<div class='swiper-slide'>                                                                  
 | |
|                             <img data-src='../" + itemurl + @"' class='swiper-lazy'>
 | |
|                             <div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
 | |
|                             </div>";
 | |
|                         }
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 swiperHtml += @"<div class='swiper-slide'>                                                                  
 | |
|                             <img data-src='../images/Test_Null.jpg' class='swiper-lazy'>
 | |
|                             <div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
 | |
|                             </div>";
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
|     }
 | |
| } |