CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/common/mainMenu_Party.aspx.cs

157 lines
7.1 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.common
{
public partial class mainMenu_Party : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
OrganizingLifePic();
ThemePartyDayPic();
}
}
/// <summary>
///
/// </summary>
public string swiperHtml1;
public string swiperHtml2;
#region
/// <summary>
/// 组织生活会图片显示
/// </summary>
public void OrganizingLifePic()
{
swiperHtml1 = " ";
var getP = from x in Funs.DB.Party_OrganizingLife
join y in Funs.DB.AttachFile on x.OrganizingLifeId equals y.ToKeyId
where y.AttachFileId != null && y.AttachUrl != null
orderby x.OrganizingLifeDate descending
select new { x.OrganizingLifeId, x.Theme, x.Year, y.AttachUrl };
var getList = getP.OrderByDescending(x => x.Year).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))
{
swiperHtml1 += @"<div class='swiper-slide' data-id='../Party/OrganizingLifeEdit.aspx?type=see&organizingLifeId=" + item.OrganizingLifeId + @"'>
<div class='title'>" + item.Theme + @"</div>
<img data-src='../" + itemurl + @"' class='swiper-lazy'>
<div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
</div>";
}
}
}
}
else
{
swiperHtml1 += @"<div class='swiper-slide'>
<img data-src='../images/Null2.jpg' class='swiper-lazy'>
<div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
</div>";
}
}
#endregion
#region
/// <summary>
/// 主题党日活动图片显示
/// </summary>
public void ThemePartyDayPic()
{
swiperHtml2 = " ";
var getP = from x in Funs.DB.Party_ThemePartyDay
join y in Funs.DB.AttachFile on x.ThemePartyDayId equals y.ToKeyId
where y.AttachFileId != null && y.AttachUrl != null
orderby x.ConveneDate descending
select new { x.ThemePartyDayId, x.Theme, x.Year, y.AttachUrl };
var getList = getP.OrderByDescending(x => x.Year).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))
{
swiperHtml2 += @"<div class='swiper-slide' data-id='../Party/ThemePartyDayEdit.aspx?type=see&themePartyDayId=" + item.ThemePartyDayId + @"'>
<div class='title'>" + item.Theme + @"</div>
<img data-src='../" + itemurl + @"' class='swiper-lazy'>
<div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
</div>";
}
}
}
}
else
{
swiperHtml2 += @"<div class='swiper-slide'>
<img data-src='../images/Null2.jpg' class='swiper-lazy'>
<div class='swiper-lazy-preloader swiper-lazy-preloader-white'></div>
</div>";
}
}
#endregion
protected string swiper3
{
get
{
var getPartyPioneerDemonstration = (from x in Funs.DB.Party_PartyPioneerDemonstration
orderby x.CompileDate descending
select x).Distinct().Take(20);
string strNoticeHtml = string.Empty;
foreach (var item in getPartyPioneerDemonstration)
{
string url = "../Party/PartyPioneerDemonstrationEdit.aspx?type=see&partyPioneerDemonstrationId=" + item.PartyPioneerDemonstrationId;
string name = BLL.PartyerService.GetNameByPartyId(item.PartyerId);
strNoticeHtml += "<li data-id=\"" + url + "\" notice-id=\"" + item.PartyPioneerDemonstrationId + "\" class=\"c-item swiper-slide\"><div class=\"tit\" title=\"" + name + "\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + name + "</div><div class=\"tit-v\">" + string.Format("{0:yyyy-MM-dd}", item.CompileDate) + "</div></div></div></li>";
}
return "<ul class=\"content-ul swiper-wrapper\">" + strNoticeHtml + "</ul>";
}
}
protected string swiper4
{
get
{
var getPartyPioneerDemonstration = (from x in Funs.DB.Party_PartyHistoryStudy
orderby x.StudyDate descending
select x).Distinct().Take(20);
string strNoticeHtml = string.Empty;
foreach (var item in getPartyPioneerDemonstration)
{
string url = "../Party/PartyHistoryStudyEdit.aspx?type=see&partyHistoryStudyId=" + item.PartyHistoryStudyId;
string name = item.Theme;
strNoticeHtml += "<li data-id=\"" + url + "\" notice-id=\"" + item.PartyHistoryStudyId + "\" class=\"c-item swiper-slide\"><div class=\"tit\" title=\"" + name + "\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + name + "</div><div class=\"tit-v\">" + string.Format("{0:yyyy-MM-dd}", item.StudyDate) + "</div></div></div></li>";
}
return "<ul class=\"content-ul swiper-wrapper\">" + strNoticeHtml + "</ul>";
}
}
protected void imgBtn_Click(object sender, ImageClickEventArgs e)
{
//Model.InformationProject_Notice notice = BLL.NoticeService.GetNoticeById(this.hdNoticeId.Value);
//if (notice != null)
//{
// BLL.APIUserService.getSaveUserRead(BLL.Const.ServerNoticeMenuId, notice.ProjectId, this.CurrUser.UserId, notice.NoticeId);
//}
}
}
}