/// <summary> /// 绑定年级 /// </summary> public void bind(bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<Grade> graderList = Grade.GetAllGrade(pagingInfo); if (graderList.Count > 0) { if (isTrue) AspNetPager1.RecordCount = Grade.GetGradesCount(); AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = graderList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
private void Bind(Core.Business.Album albums, String Sort, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; System.Data.DataTable albumTB = CY.UME.Core.Business.Album.GetAll(albums, Sort, pagingInfo); if (albumTB.Rows.Count >= 1) { if (isTrue) AspNetPager1.RecordCount = CY.UME.Core.Business.Album.GetAlbumCount(albums);//绑定总条数 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = albumTB; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
/// <summary> /// 绑定学校 /// </summary> public void bind(int proID, string Name, bool isTrue) { if (isTrue) AspNetPager1.RecordCount = University.GetUniversitysCount(proID, Name);//绑定总条数 CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<University> universityList = University.GetUniversityByProIdAndName(pagingInfo, proID, Name); if (universityList.Count > 0) { //绑定学校 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = universityList; Repeater1.DataBind(); } else { AspNetPager1.Visible = false; Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); } }
/// <summary> /// 根据日志主题、内容关键字、开始时间和结束时间查询 /// </summary> /// <param name="Subject">主题 "" 表示所有</param> /// <param name="Key">内容关键字 "" 表示所有</param> /// <param name="BeginTime">发布日期开始时间 "" 表示所有</param> /// <param name="EndTime">发布日期结束时间 "" 表示所有</param> /// <returns></returns> public void bind(string Subject, string Key, string BeginTime, string EndTime, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.Blog> blogList = CY.UME.Core.Business.Blog.GetAllBlogsBySubjectKeyDate(pagingInfo, Subject, Key, BeginTime, EndTime);//查询 List<Blogplus> blogplus = new List<Blogplus>(); for (int i = 0; i < blogList.Count; i++) { Blogplus tempblogplus = new Blogplus(); tempblogplus.Id = blogList[i].Id; tempblogplus.AccountId = blogList[i].AccountId; tempblogplus.AccountName = blogList[i].AccountName; tempblogplus.Subject = blogList[i].Subject; tempblogplus.TypeId = blogList[i].TypeId; tempblogplus.ViewNum = blogList[i].ViewNum; tempblogplus.ReplyNum = blogList[i].ReplyNum; tempblogplus.TraceNum = blogList[i].TraceNum; tempblogplus.DateCreated = blogList[i].DateCreated; tempblogplus.NoReply = blogList[i].NoReply; tempblogplus.ViewSet = blogList[i].ViewSet; tempblogplus.Password = blogList[i].Password; tempblogplus.BlogContent = blogList[i].BlogContent; tempblogplus.IP = blogList[i].IP; tempblogplus.Tag = blogList[i].Tag; if (CY.UME.Core.Business.Recommend.IsRecommend(blogList[i].Id.ToString(), "blog")) { tempblogplus.Oper = "decommend"; } else { tempblogplus.Oper = "recommend"; } blogplus.Add(tempblogplus); } if (blogplus.Count >= 1) { if (isTrue) AspNetPager1.RecordCount = CY.UME.Core.Business.Blog.GetBlogsCount(Subject, Key, BeginTime, EndTime);//绑定总条数 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = blogplus; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
/// <summary> /// 绑定图片 /// </summary> /// <param name="AlbumName">相册名称</param> /// <param name="PictureName">图片名称</param> /// <param name="beginTime">开始时间</param> /// <param name="endTime">结束时间</param> public void bind(string AccountName, string AlbumName, string PictureName, string beginTime, string endTime, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.Picture> pictureList = CY.UME.Core.Business.Picture.GetPicturesByWhere(AccountName, pagingInfo, AlbumName, PictureName, beginTime, endTime); List<Pictureplus> pictuerplus = Getpicpluslist(pictureList); if (pictuerplus.Count >= 1) { if (isTrue) AspNetPager1.RecordCount = CY.UME.Core.Business.Picture.GetPicturesCount(AccountName, AlbumName, PictureName, beginTime, endTime);//绑定总条数 //绑定图片信息 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = pictuerplus; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void BindData(CY.UME.Core.Business.Group group) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 20; if (group != null) { topicList = CY.UME.Core.Business.Topic.GetGroupTopicesByDateCreated(group.Id.ToString(), pageInfo); } int count = group.GetGroupTopicesNum(); DDLGroup.SelectedValue = group.Id.ToString(); authorname.Value = ""; minviewnum.Value = ""; maxviewnum.Value = ""; minreplynum.Value = ""; maxreplynum.Value = ""; title.Value = ""; isRecommend.SelectedIndex = 0; tm_HiddenPageSize.Value = "20"; tm_HiddenRecordCount.Value = count.ToString(); tm_HiddenSiteUrl.Value = SiteUrl; }
/// <summary> /// 绑定学院信息 /// </summary> /// <param name="CurrentPage"></param> /// <param name="PageSize"></param> /// <param name="proId">0表示所有</param> /// <param name="Name">""表示所有</param> public void bind(string uniId, string Name, bool isTrue) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pageInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<College> collegeList = College.GetTopCollegeByUniIdAndName(Convert.ToInt32(uniId), Name, pageInfo); if (collegeList.Count > 0) { if (isTrue) AspNetPager1.RecordCount = College.GetCollegesCount(Convert.ToInt32(uniId), hfName.Value);//绑定总条数 //绑定所有学院信息 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = collegeList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void BindData(CY.UME.Core.Business.Activities active) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 15; CY.UME.Core.Business.Album album = new CY.UME.Core.Business.Album(); if (active != null) { album = active.GetActiveAlbum(); picList = album.GetPictures(pageInfo); } int count = album.GetPictureCount(); minPubDate.Value = ""; maxPubDate.Value = ""; picname.Value = ""; authorName.Value = ""; gpm_HiddenPageSize.Value = "15"; gpm_HiddenRecordCount.Value = count.ToString(); gpm_HiddenSiteUrl.Value = SiteUrl; }
/// <summary> /// 绑定专业 /// </summary> public void bind(int ColId, string Name, string Des, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<Major> majorlist = Major.GetMojorByCollegeIdAndName(pagingInfo, ColId, Name); if (majorlist.Count > 0) { if (isTrue) AspNetPager1.RecordCount = Major.GetMajorsCount(ColId, Name);//绑定总条数 //绑定专业 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = majorlist; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { try { Id = 0; if (Request.QueryString["uid"] != null) { Id = long.Parse(Request.QueryString["uid"].ToString()); } else if (Session["user"] != null) { Id = long.Parse(Session["user"].ToString()); } else { Response.Redirect("../Login.aspx"); return; } CY.UME.Core.Business.Account currentacc = CY.UME.Core.Business.Account.Load(Id); int type = -2; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = 6 }; accgroups = currentacc.GetGroupsByType(pageInfo, type) as List<CY.UME.Core.Business.Group>; TotalGroupCount = CY.UME.Core.Business.Group.GetGroupsCountByType(type, currentacc, null); } catch { return; } }
protected void BindData(CY.UME.Core.Business.Activities active) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 20; if (active != null) { topicList = CY.UME.Core.Business.Topic.GetActiveTopicesByDateCreated(active.Id.ToString(), pageInfo); } int count = active.GetActiveTopicesNum(); authorname.Value = ""; minviewnum.Value = ""; maxviewnum.Value = ""; minreplynum.Value = ""; maxreplynum.Value = ""; title.Value = ""; tm_HiddenPageSize.Value = "20"; tm_HiddenRecordCount.Value = count.ToString(); tm_HiddenSiteUrl.Value = SiteUrl; }
private void bind(string Name, string UniversityId, string CollegeId, string TypeId, string Sort, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<Core.Business.Resources> ResourcesTypeList = Core.Business.Resources.GetAllResources(Name, "", 0, UniversityId, CollegeId, TypeId, Sort, pagingInfo); if (ResourcesTypeList.Count > 0) { if (isTrue) AspNetPager1.RecordCount = Core.Business.Resources.GetResourcesCount(Name, "", 0, UniversityId, CollegeId, TypeId);//绑定总条数 //绑定专业 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = ResourcesTypeList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void BindData(CY.UME.Core.Business.Group group) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 15; CY.UME.Core.Business.Album album =new CY.UME.Core.Business.Album(); if (group != null) { album = group.GetGroupAlbum(); picList = album.GetPictures(pageInfo); } int count = album.GetPictureCount(); DDLGroup.SelectedValue = group.Id.ToString(); minPubDate.Value = ""; maxPubDate.Value = ""; picname.Value = ""; authorName.Value = ""; gpm_HiddenPageSize.Value = "15"; gpm_HiddenRecordCount.Value = count.ToString(); gpm_HiddenSiteUrl.Value = SiteUrl; }
private void BindInfo() { Core.PagingInfo paginfo = new CY.UME.Core.PagingInfo{CurrentPage=1,PageSize=20}; List<CY.UME.Core.Business.Activities> list = CY.UME.Core.Business.Activities.GetAllCheck(paginfo).ToList(); List<Activeplus> activeplus = new List<Activeplus>(); for (int i = 0; i < list.Count; i++) { Activeplus tempactiveplus = new Activeplus(); tempactiveplus.Id = list[i].Id; tempactiveplus.Name = list[i].Name; tempactiveplus.Organizer = list[i].Organizer; tempactiveplus.StartTime = list[i].StartTime; tempactiveplus.EndTime = list[i].EndTime; tempactiveplus.Sponsor = list[i].Sponsor; tempactiveplus.Pic = list[i].Pic; tempactiveplus.Overview = list[i].Overview; tempactiveplus.Slogans = list[i].Slogans; tempactiveplus.Type = list[i].Type; tempactiveplus.Address = list[i].Address; tempactiveplus.IsCheck = list[i].IsCheck; if (CY.UME.Core.Business.Recommend.IsRecommend(list[i].Id.ToString(), "active")) { tempactiveplus.Oper = "decommend"; } else { tempactiveplus.Oper = "recommend"; } activeplus.Add(tempactiveplus); } gvActive.DataSource = activeplus; gvActive.DataBind(); }
private void bind(string Name, bool isTrue) { Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.ResourcesType> ResourcesTypeList = Core.Business.ResourcesType.GetAllResourcesType(Name, pagingInfo); if (ResourcesTypeList.Count > 0) { if (isTrue) AspNetPager1.RecordCount = Core.Business.ResourcesType.GetResourcesCount(Name);//绑定总条数 //绑定群组 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = ResourcesTypeList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (active == null) { return; } CY.UME.Core.Business.Account account=CY.UME.Core.Business.Account.Load(active.Sponsor); if(account!=null) { SponsorName = account.Name; } CY.UME.Core.Business.Album album = active.GetActiveAlbum(); //获取活动首页图片 CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 3; picList = active.SearchActivePicture("", "1", "", CY.UME.Core.Global.MinDateTime, DateTime.MaxValue, pageInfo); int count = picList.Count; if (count < 3) { picList.AddRange(active.SearchActivePicture("", "0", "", CY.UME.Core.Global.MinDateTime, DateTime.MaxValue, new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = (3 - count) })); } } }
private void Bind(String IsEnable, String IsEnd, String Sort, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.InstantlyKilling> pictureList = CY.UME.Core.Business.InstantlyKilling.GetAllInstantlyKilling(IsEnable, IsEnd, Sort, pagingInfo); if (pictureList.Count >= 1) { if (isTrue) AspNetPager1.RecordCount = CY.UME.Core.Business.InstantlyKilling.GetIKCount(IsEnable, IsEnd);//绑定总条数 //绑定图片信息 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = pictureList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PageSize == 0) { this.PageSize = 12; } if (Account == null) { return; } int friendCount = CY.UME.Core.Business.Friendship.GetFriendshipCount(Account); int followerCount = CY.UME.Core.Business.AccountFollower.GetNumberByAccount(Account); TotalFriendCount = friendCount + followerCount; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = PageSize; Friends = CY.UME.Core.Business.Friendship.GetAllFriendshipByOder((int)Account.Id, pageInfo, String.Empty, PageSize) as List<CY.UME.Core.Business.Account>; if (friendCount < PageSize) { pageInfo.PageSize = PageSize - friendCount; List<CY.UME.Core.Business.Account> Followers = CY.UME.Core.Business.Account.GetFollowerAccountByCurrentAccount((int)Account.Id, pageInfo, String.Empty) as List<CY.UME.Core.Business.Account>; Friends.AddRange(Followers); } } }
/// <summary> /// 绑定反馈信息 /// </summary> /// <param name="KindId"></param> /// <param name="BeginTime"></param> /// <param name="EndTime"></param> /// <param name="isTrue"></param> public void bind(int KindId, string BeginTime, string EndTime, bool isTrue) { if (isTrue) AspNetPager1.RecordCount = CY.UME.Core.Business.FeedBack.GetFeedBacksCount(KindId, BeginTime, EndTime);//绑定总条数 CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.FeedBack> feedBackList = CY.UME.Core.Business.FeedBack.GetAllFeedBack(pagingInfo, KindId, BeginTime, EndTime); if (feedBackList.Count > 0) { AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = feedBackList; Repeater1.DataBind(); } else { AspNetPager1.Visible = false; Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); } }
// private void bind(String AccountName, String IsReaded, String Content, String Type, String StartTime, String EndTime, bool isTrue) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<Core.Business.Notice> NoticeList = Core.Business.Notice.GetAllNotice(AccountName, IsReaded, Content, Type, CY.Utility.Common.ConvertUtility.ConvertToDateTime(StartTime), CY.Utility.Common.ConvertUtility.ConvertToDateTime(EndTime), pagingInfo); if (NoticeList.Count >= 1) { if (isTrue) AspNetPager1.RecordCount = Core.Business.Notice.GetNoticeCount(AccountName, IsReaded, Content, Type, CY.Utility.Common.ConvertUtility.ConvertToDateTime(StartTime), CY.Utility.Common.ConvertUtility.ConvertToDateTime(EndTime)); AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = NoticeList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
/// <summary> /// 绑定班级 /// </summary> public void bind(string majorId, string gradeId, string Name, bool isTrue) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pageInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<ClassInfo> classInfoList = ClassInfo.GetClassInfoByMIdAndGIdAndName(Convert.ToInt32(majorId), Convert.ToInt32(gradeId), Name, pageInfo); if (classInfoList.Count > 0) { if (isTrue) AspNetPager1.RecordCount = ClassInfo.GetClassInfosCount(Convert.ToInt32(majorId), Convert.ToInt32(gradeId), Name); //读取所有班级信息 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = classInfoList; Repeater1.DataBind(); } else { Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); AspNetPager1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { long currentId = CurrentAccount.Id; string[] typeArray = { "activeInviteFriend" }; int pageSize = 10; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.PageSize = pageSize; pageInfo.CurrentPage = 1; IList<CY.UME.Core.Business.Notice> noticeList = CY.UME.Core.Business.Notice.GetNoticeByTypeAndDate(CurrentAccount, typeArray, false, pageInfo); List<CY.UME.Core.Business.Activities> activeListTemp = new List<CY.UME.Core.Business.Activities>(); int i = 0; foreach (CY.UME.Core.Business.Notice notice in noticeList) { int activeId = 0; if (!int.TryParse(notice.InstanceId, out activeId)) { continue; } CY.UME.Core.Business.Activities act = CY.UME.Core.Business.Activities.Load(activeId); if (act == null) { continue; } CY.UME.Core.Business.Account account = CY.UME.Core.Business.Account.Load(notice.AuthorId); if (account == null) { continue; } SenterArray[i * 2] = account.Id.ToString(); SenterArray[i * 2 + 1] = account.Name; activeListTemp.Add(act); i++; } //activeList = activeListTemp; int TotalRequestNum = CurrentAccount.GetUnHandledActiveRequest().Count;//获取活动请求数 LblGroupRequest_Num.Text = TotalRequestNum.ToString(); personalState.SpaceAccount = CurrentAccount; personalState.CurrentAccount = CurrentAccount; gr_HiddenPageSize.Value = pageSize.ToString(); gr_HiddenTotalRecords.Value = TotalRequestNum.ToString(); gr_HiddenAccountId.Value = currentId.ToString(); gr_HiddenSiteUrl.Value = SiteUrl; SetTitle("活动邀请"); } }
private string HandlerData(HttpContext context) { string rejson = ""; CY.UME.Core.Business.Account currentAccount; currentAccount = CY.UME.Core.Global.GetCurrentAccount(); if (currentAccount == null) { rejson = "{success:false,msg:'登录超时,请重新登录'}"; return rejson; } try { string Type = context.Request.Params["type"]; string InstanceId = context.Request.Params["instance"]; if (Type != null && InstanceId != null) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = int.MaxValue; List<CY.UME.Core.Business.Notice> NoticeList = new List<CY.UME.Core.Business.Notice>(); if (Type == "alltype" && InstanceId == "allInstance") { string[] type = { "info", "friend", "groupinvite", "activeInviteFriend", "inforeply", "blogreply", "miniblogreply", "picreply", "firstpicreply", "topicreply", "groupinforeply", "activitesinforeply", "activeTopicReply", "activeCheck", "activeCheckNo" }; NoticeList = CY.UME.Core.Business.Notice.GetNoticeByTypeAndDate(currentAccount, type, false, pageInfo) as List<CY.UME.Core.Business.Notice>; } else if ((Type == "friend" || Type == "groupinvite" || Type == "activeInviteFriend")) { string[] type = { Type }; NoticeList = CY.UME.Core.Business.Notice.GetNoticeByTypeAndDate(currentAccount, type, false, pageInfo) as List<CY.UME.Core.Business.Notice>; } else if (Type == "info") { string[] type = { "info", "inforeply" }; NoticeList = CY.UME.Core.Business.Notice.GetNoticeByTypeAndDate(currentAccount, type, false, pageInfo) as List<CY.UME.Core.Business.Notice>; } else { NoticeList = CY.UME.Core.Business.Notice.GetNoticeByTypeAndInstanceId(currentAccount, false, Type, InstanceId, pageInfo) as List<CY.UME.Core.Business.Notice>; } if (NoticeList != null && NoticeList.Count != 0) { for (int i = 0; i < NoticeList.Count; i++) { NoticeList[i].IsReaded = true; NoticeList[i].Save(); } } } rejson = "{sucess:true}"; } catch { rejson = "{success: false}"; } return rejson; }
protected void Page_Load(object sender, EventArgs e) { SetTitle("我的群组话题"); long spaceId = 0; loadType = HF_LoadType.Value; if (Request.QueryString["uid"] == null) { SpaceAccount = CurrentAccount; } else if (long.TryParse(Request.QueryString["uid"].ToString(), out spaceId)) { SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); } else { SpaceAccount = CurrentAccount; } if (SpaceAccount == null) { //转到404页面 Response.Redirect(SiteUrl + "/Login"); return; } if (!IsPostBack) { myGroupCount = CY.UME.Core.Business.Group.GetGroupsCountByType(-2, SpaceAccount, null); if (myGroupCount < 1) { string url = SiteUrl + "/Group/GroupList.aspx?type=-2"; Response.Redirect(url); return; } //绑定我的群组 BindMyGroup(SpaceAccount); if (Request.QueryString["type"] != null) { loadType = Request.QueryString["type"].ToString(); if (Request.QueryString["i"] != null) { HF_Select_Index.Value = Request.QueryString["i"].ToString(); } } CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = pageSize; recordCount = CY.UME.Core.Business.Topic.GetTopicCountByGroupsWhereAccountIn(CurrentAccount.Id); HF_TotalRecords.Value = recordCount.ToString(); HF_SiteUrl.Value = SiteUrl; HF_PageSize.Value = pageSize.ToString(); HF_CurrentAccount_Id.Value = SpaceAccount.Id.ToString(); BindGroupTopics(loadType, pageInfo, SpaceAccount.Id.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int pageSize =10; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = pageSize }; groupList = CY.UME.Core.Business.Group.GetCommendGroupByPageInfo(CurrentAccount.Id, pageInfo); } }
private void bind(string accountName, string Contents, string beginTime, string endTime, bool isTrue) { Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = AspNetPager1.CurrentPageIndex; pagingInfo.PageSize = AspNetPager1.PageSize = SetCurrentPageSize.CurrentPageSize; IList<CY.UME.Core.Business.Wishing> wishingList = CY.UME.Core.Business.Wishing.GetAllWishes(accountName, Contents, beginTime, endTime, pagingInfo); List<Wishplus> wishplus = new List<Wishplus>(); for (int i = 0; i < wishingList.Count; i++) { Wishplus tempwishplus = new Wishplus(); tempwishplus.Id = wishingList[i].Id; tempwishplus.Content = wishingList[i].Content; tempwishplus.DateCreated = wishingList[i].DateCreated; tempwishplus.AccountId = wishingList[i].AccountId; tempwishplus.WallColor = wishingList[i].WallColor; tempwishplus.FontColor = wishingList[i].FontColor; tempwishplus.IsTop = wishingList[i].IsTop; tempwishplus.EndDate = wishingList[i].EndDate; tempwishplus.ReplyNum = wishingList[i].ReplyNum; if (CY.UME.Core.Business.Recommend.IsRecommend(wishingList[i].Id.ToString(), "wish")) { tempwishplus.Oper = "decommend"; } else { tempwishplus.Oper = "recommend"; } wishplus.Add(tempwishplus); } if (wishplus.Count > 0) { if (isTrue) AspNetPager1.RecordCount = Wishing.GetWishingCount(accountName, Contents, beginTime, endTime); //绑定学校 AspNetPager1.Visible = true; Repeater2.Visible = false; Repeater1.Visible = true; Repeater1.DataSourceID = ""; Repeater1.DataSource = wishplus; Repeater1.DataBind(); } else { AspNetPager1.Visible = false; Repeater1.Visible = false; Repeater2.Visible = true; Repeater2.DataSourceID = ""; Repeater2.DataSource = BindNoData("暂无数据"); Repeater2.DataBind(); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; int pageNum = 0, pageSize = 0, type = -2; //CY.UME.Core.Business.Account currentAccount; if (context.Request.QueryString["pageNum"] == null || context.Request.QueryString["pageSize"] == null || context.Request.QueryString["type"] == null) { context.Response.Write("success:false,msg:'参数错误'"); return; } if (!int.TryParse(context.Request.QueryString["pageNum"].ToString(), out pageNum) || !int.TryParse(context.Request.QueryString["pageSize"].ToString(), out pageSize) || !int.TryParse(context.Request.QueryString["type"].ToString(), out type)) { context.Response.Write("success:false,msg:'参数错误'"); return; } try { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo { CurrentPage = pageNum, PageSize = pageSize }; CY.UME.Core.Business.Group groupTemp = new CY.UME.Core.Business.Group(); System.Collections.Generic.IList<CY.UME.Core.Business.Group> groupList = groupTemp.GetGroupsByAccountIdAndType(null, type, pageInfo, "Id", "DESC", null); StringBuilder sb = new StringBuilder(); sb.Append("{success:true,MyGroups:["); foreach (CY.UME.Core.Business.Group group in groupList) { sb.Append("{"); sb.Append("Id:" + group.Id); sb.Append(",Name:'" + CY.Utility.Common.StringUtility.EscapeString(group.Name) + "'"); sb.Append(",TypeName:'" + group.GetGroupNameByType() + "'"); sb.Append(",MemberNum:" + group.MemberNum); sb.Append(",TopicesNum:" + group.GetGroupTopicesNum()); sb.Append(",TopicesReplyNum:" + group.GetGroupTopicReplyCount()); sb.Append("},"); } if (groupList.Count > 0) { sb.Remove(sb.Length - 1, 1); } sb.Append("]}"); context.Response.Write(sb.ToString()); } catch { context.Response.Write("success:false,msg:'系统忙,请稍后再试'"); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["blogId"] == null) { throw new Exception("参数错误"); } else { long blogId = 0; if (long.TryParse(Request.QueryString["blogId"].ToString(), out blogId)) { blog = CY.UME.Core.Business.Blog.Load(blogId); //获取博客信息 if (blog == null) { throw new Exception("访问页面不存在"); } //if (!blog.CheckViewPermission(CurrentAccount)) //{ // throw new Exception("您无权访问该页面"); //} long spaceId = blog.AccountId; SpaceAccount = CY.UME.Core.Business.Account.Load(spaceId); blogComments = CY.UME.Core.Business.BlogComment.GetAllBlogCommentsByBlogId(blog); //获取博客评论信息 CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo(); pagingInfo.CurrentPage = 1; pagingInfo.PageSize = 10; IList<CY.UME.Core.Business.Blog> Blogs = CY.UME.Core.Business.Blog.GetTopBlogsByAccountId(SpaceAccount, pagingInfo, blog.ViewSet); blogBriefList.Blogs = Blogs; blogBriefList.spaceAccount = SpaceAccount; //增加博客阅读数 if (CurrentAccount != null && blog.AccountId != (CurrentAccount == null ? SpaceAccount.Id : base.CurrentAccount.Id)) { CY.UME.Core.Business.Blog.AddBlogViewNum(blog.Id); } SetTitle(blog.Subject); HF_AccountId.Value = spaceId.ToString(); HF_BlogId.Value = blogId.ToString(); blog_HiddenTotalRecords.Value = Blogs.Count.ToString(); blog_HiddenReplyTotalRecords.Value = blogComments.Count.ToString(); } else { throw new Exception("参数错误"); } UserInfo1.SpaceAccount = SpaceAccount; } }
protected void Page_Load(object sender, EventArgs e) { int type = -2; if (Request.QueryString["type"] != null) { int.TryParse(Request.QueryString["type"], out type); } int pageSize = 16, recordCount = 0; CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = pageSize }; groupList = CurrentAccount.GetGroupsByType(pageInfo, type); recordCount = CY.UME.Core.Business.Group.GetGroupsCountByType(type, CurrentAccount, null); if (recordCount > pageSize) { IsDisPaged = true; } newestTopices.PageSize = 10; newestTopices.Group = null; newestTopices.Type = type; newestTopices.IsMyGroup = true; groupNavigation1.groupId = 0; if (type == 0) { groupNavigation1.IsShowAddGroupBtn = false; IsClass = true; } else { groupNavigation1.IsShowAddGroupBtn = true; } groupNavigation1.IsShowAddTopicBtn = false; groupNavigation1.IsShowAddImgBtn = false; groupNavigation1.IsShowNav = false; mg_HiddenPageSize.Value = pageSize.ToString(); mg_HiddenSiteUrl.Value = SiteUrl; mg_HiddenTotalRecords.Value = recordCount.ToString(); mg_HiddenType.Value = type.ToString(); if (type == 0) { SetTitle("我的班级"); groupType1.Visible = false; } else { SetTitle("我的群组"); } }
/// <summary> /// 有相同兴趣的人,同学校同年级的人,群组 /// </summary> private void Bind(string Type, long id) { CY.UME.Core.PagingInfo pagingInfo = new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = pageSize }; switch (Type) { case "0": hdType.Value = "0"; List<CY.UME.Core.Business.Account> acAllList = CY.UME.Core.Business.Account.GetAllAccount(pagingInfo).ToList(); count = CY.UME.Core.Business.Account.GetAllAccount()-1; LblSearchNum.Text = "共" + count.ToString() + "个搜索结果"; LitTitle.Text = "新同学"; SetTitle("更多新同学"); break; case "1": hdType.Value = "1"; List<CY.UME.Core.Business.Account> acExtendList = CY.UME.Core.Business.Account.GetAccountSameInterestByCurrentUserId(id, pagingInfo).ToList(); count = CY.UME.Core.Business.Account.GetCountSameInterestByCurrentUserId(id, 1); LblSearchNum.Text = "共" + count.ToString() + "个搜索结果"; LitTitle.Text = "感兴趣的人"; SetTitle("更多感兴趣的同学"); break; case "2": hdType.Value = "2"; List<CY.UME.Core.Business.Account> acExtendList2 = CY.UME.Core.Business.Account.GetStudentByCurrentUserId(id, pagingInfo).ToList(); count = CY.UME.Core.Business.Account.GetStudentByCurrentUserId(id, new CY.UME.Core.PagingInfo { CurrentPage = 1, PageSize = int.MaxValue }).ToList().Count; //count = CY.UME.Core.Business.Account.GetCountSameInterestByCurrentUserId(id, 2); LblSearchNum.Text = "共" + count.ToString() + "个搜索结果"; LitTitle.Text = "可能认识的人"; SetTitle("更多你可能认识的同学"); break; case "3": hdType.Value = "3"; CY.UME.Core.Business.AccountExtend ac = CY.UME.Core.Business.AccountExtend.Load(id); if (ac != null) { List<CY.UME.Core.Business.Group> groupList = CY.UME.Core.Business.Group.GetCommendGroup(ac).ToList(); count = groupList.Count; LblSearchNum.Text = "共" + count.ToString() + "个搜索结果"; LitTitle.Text = "感兴趣群组"; } SetTitle("更多你感兴趣的群组"); break; } }