本文整理汇总了C#中CY.GetUnreadNotice方法的典型用法代码示例。如果您正苦于以下问题:C# CY.GetUnreadNotice方法的具体用法?C# CY.GetUnreadNotice怎么用?C# CY.GetUnreadNotice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CY
的用法示例。
在下文中一共展示了CY.GetUnreadNotice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Creatjson
private string Creatjson(CY.UME.Core.Business.Account currentAccount, string pageSize, string pageNum)
{
StringBuilder json = new StringBuilder();
try
{
currentAccount.GetUnreadNotice("inforeply");
CY.UME.Core.PagingInfo pageInfo1 = new CY.UME.Core.PagingInfo();
pageInfo1.CurrentPage = 1;
pageInfo1.PageSize = int.MaxValue;
string[] type = { "friend", "groupinvite", "activeInviteFriend" };
List<CY.UME.Core.Business.Notice> NoticeList = CY.UME.Core.Business.Notice.GetNoticeGroupByType(currentAccount, type, false, pageInfo1) as List<CY.UME.Core.Business.Notice>;
int infonum = CY.UME.Core.Business.Notice.GetInfoNoticeCount(currentAccount);
if (infonum != 0)
{
CY.UME.Core.Business.Notice newNotice = new CY.UME.Core.Business.Notice();
newNotice.Id = infonum;
newNotice.Type = "info";
NoticeList.Add(newNotice);
}
CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();
pageInfo.CurrentPage = int.Parse(pageNum);
pageInfo.PageSize = int.Parse(pageSize);
string[] type1 = { "activitesinforeply", "blogreply", "miniblogreply", "picreply", "firstpicreply", "topicreply", "groupinforeply", "activeTopicReply", "relativegroup" };
List<CY.UME.Core.Business.Notice> NoticeList1 = CY.UME.Core.Business.Notice.GetNoticeGroupByType(currentAccount, type1, false, pageInfo) as List<CY.UME.Core.Business.Notice>;
NoticeList.AddRange(NoticeList1);
string[] type2 = { "activeCheckNo" };//审核不通过
List<CY.UME.Core.Business.Notice> NoticeList2 = CY.UME.Core.Business.Notice.GetNoticeGroupByType(currentAccount, type2, false, pageInfo) as List<CY.UME.Core.Business.Notice>;
NoticeList.AddRange(NoticeList2);
string[] type3 = { "activeCheck" };//审核通过
List<CY.UME.Core.Business.Notice> NoticeList3 = CY.UME.Core.Business.Notice.GetNoticeGroupByType(currentAccount, type3, false, pageInfo) as List<CY.UME.Core.Business.Notice>;
NoticeList.AddRange(NoticeList3);
if (NoticeList != null && NoticeList.Count > 0)
{
bool check = false;
json.Append("{success:true,");
if (NoticeList.Count < int.Parse(pageSize))
{
json.Append("toend:true,");
}
else
{
json.Append("toend:false,");
}
json.Append("list:");
json.Append("[");
for (int i = 0; i < NoticeList.Count; i++)
{
switch (NoticeList[i].Type)
{
case "friend":
json.Append("{Count:'" + NoticeList[i].Id + "',Type:'" + NoticeList[i].Type + "'");
break;
case "groupinvite":
json.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'");
break;
case "activeInviteFriend":
json.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'");
break;
case "info":
json.Append("{Count:'" + NoticeList[i].Id + "',Type:'" + NoticeList[i].Type + "'");
break;
//case "inforeply":
// long inforId;
// if (CY.Utility.Common.ParseUtility.TryParseInt64(NoticeList[i].InstanceId, out inforId))
// {
// CY.UME.Core.Business.SpaceComment spacecomm = CY.UME.Core.Business.SpaceComment.Load(inforId);
// CY.UME.Core.Business.SpaceComment spacecomm2 = CY.UME.Core.Business.SpaceComment.Load(spacecomm.ReferedId);
// if (spacecomm2 == null)
// {
// NoticeList[i].DeleteOnSave();
// NoticeList[i].Save();
// continue;
// }
// else
// {
// json.Append("{Count:'" + NoticeList[i].Id + "',InstanceId:'" + NoticeList[i].InstanceId + "',Type:'" + NoticeList[i].Type + "'");
// json.Append(",SpaceComment:'");
// json.Append(CY.Utility.Common.StringUtility.EscapeString(
// CY.Utility.Common.StringUtility.CutString(spacecomm2.Content, 50, "...")));
// json.Append("',SpaceOwerId:'");
// json.Append(spacecomm2.AccountId);
// json.Append("'");
// }
// }
// break;
case "blogreply":
//.........这里部分代码省略.........