当前位置: 首页>>代码示例>>C#>>正文


C# CY.GetUnreadNotice方法代码示例

本文整理汇总了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":
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:101,代码来源:GetReplyTips.ashx.cs


注:本文中的CY.GetUnreadNotice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。