public bool Contains(Notice notice)
 {
     return(Notices.Contains(notice));
 }
Ejemplo n.º 2
0
    IEnumerator NoticeDay()
    {
        bool       vaildPair    = false;
        ColorPairs selectedPair = new ColorPairs(0, 0);

        while (vaildPair == false)
        {
            int address = (int)Random.Range(0, NoticeColors.Length);
            selectedPair = NoticeColors[address];
            if (UsedPairs.Count != 0)
            {
                foreach (var pair in UsedPairs)
                {
                    if (selectedPair.Color1 == pair.Color1 || selectedPair.Color1 == pair.Color2 || selectedPair.Color2 == pair.Color1 || selectedPair.Color2 == pair.Color2)
                    {
                        vaildPair = false;
                        break;
                    }
                    else
                    {
                        vaildPair = true;
                    }
                }
            }
            else
            {
                vaildPair = true;
            }
            if (vaildPair)
            {
                UsedPairs.Add(selectedPair);
            }
        }

        //=============================================

        Notices notices1 = new Notices(selectedPair.Color1, selectedPair.Color2);

        foreach (var project in projects)
        {
            project.swapData(selectedPair.Color1, selectedPair.Color2);
        }
        notices.Add(notices1);
        notices1.ChangecolorMeaning();
        noticeDay        += 1;
        notices1.NoticeID = notices.Count;

        GameObject Button;

        Button = Instantiate(Noticedetails, new Vector2(2, 2), Quaternion.identity, NoticePanel.transform);
        Button.GetComponent <NoticeDetails>().NoticeInfoChange(notices1.C1, notices1.C2, notices1.NoticeID);
        string tempString = notices1.NoticeMessage;

        //updateNoticeText(notices1.NoticeMessage);
        Events.ChangeNotice(notices1.C1, notices1.C2, tempString);
        Events.noticeScreen();

        //Debug.Log("next notice day is on " + noticeDay.ToString());
        //StartCoroutine(Daytimer());


        yield return(new WaitForSeconds(daySeconds + 1f));
    }
 public bool Remove(Notice notice)
 {
     return(Notices.Remove(notice));
 }
Ejemplo n.º 4
0
 //初始化喇叭及公告
 public void InitNotice()
 {
     notices = new Notices(ENoticeType.e_all);
     (( NoticesAllItem )notices.noticeData).InitData(0);
 }
Ejemplo n.º 5
0
 public void Add(Notices newNotice)
 {
     _context.Add(newNotice);
     _context.SaveChanges();
 }
Ejemplo n.º 6
0
        protected override void ShowPage()
        {
            #region 临时帐号发帖
            //int realuserid = -1;
            //bool tempaccountspost = false;
            //string tempusername = DNTRequest.GetString("tempusername");
            //if (!Utils.StrIsNullOrEmpty(tempusername) && tempusername != username)
            //{
            //    realuserid = Users.CheckTempUserInfo(tempusername, DNTRequest.GetString("temppassword"), DNTRequest.GetInt("question", 0), DNTRequest.GetString("answer"));
            //    if (realuserid == -1)
            //    {
            //        AddErrLine("临时帐号登录失败,无法继续发帖。");
            //        return;
            //    }
            //    else
            //    {
            //        userid = realuserid;
            //        username = tempusername;
            //        tempaccountspost = true;
            //    }
            //}
            #endregion

            if (userid > 0)
            {
                userinfo = Users.GetShortUserInfo(userid);
            }

            #region 判断是否是灌水
            AdminGroupInfo admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            if (admininfo != null)
            {
                disablepost = admininfo.Disablepostctrl;
            }

            if (!UserAuthority.CheckPostTimeSpan(usergroupinfo, admininfo, oluserinfo, userinfo, ref msg))
            {
                if (continuereply != "")
                {
                    AddErrLine("<b>回帖成功</b><br />由于" + msg + "后刷新继续");
                }
                else
                {
                    AddErrLine(msg);
                }
                return;
            }
            #endregion

            //获取主题帖信息
            PostInfo postinfo = GetPostAndTopic(admininfo);
            if (IsErr())
            {
                return;
            }

            forum     = Forums.GetForumInfo(forumid);
            smileyoff = 1 - forum.Allowsmilies;
            bbcodeoff = (forum.Allowbbcode == 1 && usergroupinfo.Allowcusbbcode == 1) ? 0 : 1;
            allowimg  = forum.Allowimgcode;
            needaudit = UserAuthority.NeedAudit(forum, useradminid, topic, userid, disablepost, usergroupinfo);
            #region  附件信息绑定
            //得到用户可以上传的文件类型
            string attachmentTypeSelect = Attachments.GetAllowAttachmentType(usergroupinfo, forum);
            attachextensions       = Attachments.GetAttachmentTypeArray(attachmentTypeSelect);
            attachextensionsnosize = Attachments.GetAttachmentTypeString(attachmentTypeSelect);
            //得到今天允许用户上传的附件总大小(字节)
            int MaxTodaySize = (userid > 0 ? MaxTodaySize = Attachments.GetUploadFileSizeByuserid(userid) : 0);
            attachsize = usergroupinfo.Maxsizeperday - MaxTodaySize;//今天可上传得大小
            //是否有上传附件的权限
            canpostattach = UserAuthority.PostAttachAuthority(forum, usergroupinfo, userid, ref msg);

            if (canpostattach && (userinfo != null && userinfo.Uid > 0) && apb != null && config.Enablealbum == 1 &&
                (UserGroups.GetUserGroupInfo(userinfo.Groupid).Maxspacephotosize - apb.GetPhotoSizeByUserid(userid) > 0))
            {
                caninsertalbum = true;
                albumlist      = apb.GetSpaceAlbumByUserId(userid);
            }
            #endregion

            if (!Utils.StrIsNullOrEmpty(forum.Password) && Utils.MD5(forum.Password) != ForumUtils.GetCookie("forum" + forumid + "password"))
            {
                AddErrLine("本版块被管理员设置了密码");
                SetBackLink(base.ShowForumAspxRewrite(forumid, 0));
                return;
            }

            #region 访问和发帖权限校验
            if (!UserAuthority.VisitAuthority(forum, usergroupinfo, userid, ref msg))
            {
                AddErrLine(msg);
                needlogin = true;
                return;
            }
            if (!UserAuthority.PostReply(forum, userid, usergroupinfo, topic))
            {
                AddErrLine(topic.Closed == 1 ? "主题已关闭无法回复" : "您没有发表回复的权限");
                needlogin = (topic.Closed == 1 ? false : true);
                return;
            }

            if (!UserAuthority.CheckPostTimeSpan(usergroupinfo, admininfo, oluserinfo, userinfo, ref msg))
            {
                AddErrLine(msg);
                return;
            }
            #endregion

            // 如果是受灌水限制用户, 则判断是否是灌水
            if (admininfo != null)
            {
                disablepost = admininfo.Disablepostctrl;
            }

            if (forum.Templateid > 0)
            {
                templatepath = Templates.GetTemplateItem(forum.Templateid).Directory;
            }

            AddLinkCss(BaseConfigs.GetForumPath + "templates/" + templatepath + "/editor.css", "css");
            customeditbuttons = Caches.GetCustomEditButtonList();
            //如果是提交...
            if (ispost)
            {
                string backlink = (DNTRequest.GetInt("topicid", -1) > 0 ?
                                   string.Format("postreply.aspx?topicid={0}&restore=1&forumpage=" + forumpageid, topicid) :
                                   string.Format("postreply.aspx?postid={0}&restore=1&forumpage=" + forumpageid, postid));

                if (!DNTRequest.GetString("quote").Equals(""))
                {
                    backlink = string.Format("{0}&quote={1}", backlink, DNTRequest.GetString("quote"));
                }

                SetBackLink(backlink);

                #region 验证提交信息
                //常规项验证
                NormalValidate(admininfo, postmessage, userinfo);

                if (IsErr())
                {
                    return;
                }
                #endregion

                //是否有上传附件的权限
                canpostattach = UserAuthority.PostAttachAuthority(forum, usergroupinfo, userid, ref msg);

                // 产生新帖子
                if (!string.IsNullOrEmpty(DNTRequest.GetFormString("toreplay_user").Trim()))
                {
                    postmessage = DNTRequest.GetFormString("toreplay_user").Trim() + "\n\n" + postmessage;
                }

                postinfo = CreatePostInfo(postmessage);

                //获取被回复帖子的作者uid
                int replyUserid = postid > 0 ? Posts.GetPostInfo(topicid, postid).Posterid : postinfo.Posterid;
                postid = postinfo.Pid;
                if (IsErr())
                {
                    return;
                }

                //添加回复索引
                PKS.Forum.Web.ForumExtension.SaveForumPostToIndex(forum, topic, postinfo);

                #region 当回复成功后,发送通知
                if (postinfo.Pid > 0 && DNTRequest.GetString("postreplynotice") == "on")
                {
                    Notices.SendPostReplyNotice(postinfo, topic, replyUserid);
                }
                #endregion

                //向第三方应用同步数据
                Sync.Reply(postid.ToString(), topic.Tid.ToString(), topic.Title, postinfo.Poster, postinfo.Posterid.ToString(), topic.Fid.ToString(), "");

                //更新主题相关信息
                //UpdateTopicInfo(postmessage);

                #region 处理附件
                //处理附件
                StringBuilder    sb             = new StringBuilder();
                AttachmentInfo[] attachmentinfo = null;
                string           attachId       = DNTRequest.GetFormString("attachid");
                if (!string.IsNullOrEmpty(attachId))
                {
                    attachmentinfo = Attachments.GetNoUsedAttachmentArray(userid, attachId);
                    Attachments.UpdateAttachment(attachmentinfo, topic.Tid, postinfo.Pid, postinfo, ref sb, userid, config, usergroupinfo);
                }

                //加入相册
                if (config.Enablealbum == 1 && apb != null)
                {
                    sb.Append(apb.CreateAttachment(attachmentinfo, usergroupid, userid, username));
                }
                #endregion

                OnlineUsers.UpdateAction(olid, UserAction.PostReply.ActionID, forumid, forum.Name, topicid, topictitle);

                #region 设置提示信息和跳转链接
                //辩论地址
                if (topic.Special == 4)
                {
                    SetUrl(Urls.ShowDebateAspxRewrite(topicid));
                }
                else if (infloat == 0)//此处加是否弹窗提交判断是因为在IE6下弹窗提交会造成gettopicinfo, getpostlist(位于showtopic页面)被提交了两次
                {
                    SetUrl(string.Format("showtopic.aspx?forumpage={0}&topicid={1}&page=end&jump=pid#{2}", forumpageid, topicid, postid));
                }

                if (DNTRequest.GetFormString("continuereply") == "on")
                {
                    SetUrl("postreply.aspx?topicid=" + topicid + "&forumpage=" + forumpageid + "&continuereply=yes");
                }

                if (sb.Length > 0)
                {
                    UpdateUserCredits(Forums.GetValues(forum.Replycredits));
                    SetMetaRefresh(5);
                    SetShowBackLink(true);
                    if (infloat == 1)
                    {
                        AddErrLine(sb.ToString());
                        return;
                    }
                    else
                    {
                        AddMsgLine("<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td colspan=2 align=\"left\"><span class=\"bold\"><nobr>发表回复成功,但图片/附件上传出现问题:</nobr></span><br /></td></tr></table>");
                    }
                }
                else
                {
                    SetMetaRefresh();
                    SetShowBackLink(false);
                    //上面已经进行用户组判断
                    if (postinfo.Invisible == 1)
                    {
                        AddMsgLine(string.Format("发表回复成功, 但需要经过审核才可以显示. {0}<br /><br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, 0) + "\">点击这里返回 {1}</a>)", (DNTRequest.GetFormString("continuereply") == "on" ? "继续回复" : "返回该主题"), forum.Name));
                    }
                    else
                    {
                        UpdateUserCredits(Forums.GetValues(forum.Replycredits));
                        MsgForward("postreply_succeed");
                        AddMsgLine(string.Format("发表回复成功, {0}<br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, 0) + "\">点击这里返回 {1}</a>)<br />", (DNTRequest.GetFormString("continuereply") == "on" ? "继续回复" : "返回该主题"), forum.Name));
                    }
                }
                #endregion

                // 删除主题游客缓存
                if (topic.Replies < (config.Ppp + 10))
                {
                    ForumUtils.DeleteTopicCacheFile(topicid);
                }

                //发送邮件通知
                if (DNTRequest.GetString("emailnotify") == "on" && topic.Posterid != -1 && topic.Posterid != userid)
                {
                    SendNotifyEmail(Users.GetShortUserInfo(topic.Posterid).Email.Trim(), postinfo, Utils.GetRootUrl(BaseConfigs.GetForumPath) + string.Format("showtopic.aspx?topicid={0}&page=end&jump=pid#{1}", topicid, postid));
                }
            }
        }
        public static bool AddNotice(string a, string b, string c)
        {
            bool x = Notices.AddNoticeMdl(a, b, c);

            return(x);
        }
Ejemplo n.º 8
0
 public void Add(Task notice)
 {
     Notices.Add(notice);
 }
Ejemplo n.º 9
0
 public void IndexOf(Task notice)
 {
     Notices.IndexOf(notice);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 根据交易日志的状态发送相应通知
        /// </summary>
        /// <param name="__goodstradelog">交易日志信息</param>
        /// <returns>是否发送成功</returns>
        public static bool SendNotice(Goodstradeloginfo goodsTradeLog)
        {
            string noticeContent = "这是由论坛系统自动发送的通知短消息.<BR />";
            bool   isSendNotice  = false;
            int    noticeUid     = 0;
            int    posterId      = 0;
            string poster        = "";
            string pageName      = goodsTradeLog.Offline == 1 ? "offlinetrade.aspx" : "onlinetrade.aspx";

            switch ((TradeStatusEnum)goodsTradeLog.Status)
            {
            case TradeStatusEnum.UnStart:
            {
                noticeContent = string.Format("买家 {0} 购买您的商品 {1}. 但交易尚未生效, 等待您的确认, 请<a href =\"" + pageName + "?goodstradelogid={2}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Buyer,
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Id);
                isSendNotice = true;
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                break;
            }

            case TradeStatusEnum.WAIT_SELLER_SEND_GOODS:
            {
                noticeContent = string.Format("买家 {0} 购买您的商品 {1}. 买家已付款, 等待您发货, 请<a href =\"" + pageName + "?goodstradelogid={2}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Buyer,
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Id);
                isSendNotice = true;
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                break;
            }

            case TradeStatusEnum.WAIT_BUYER_CONFIRM_GOODS:
            {
                noticeContent = string.Format("您购买的商品 {0} . 卖家 {1} 已发货, 等待您的确认, 请<a href =\"" + pageName + "?goodstradelogid={2}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Seller,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Buyerid;
                posterId     = goodsTradeLog.Sellerid;
                poster       = goodsTradeLog.Seller;
                isSendNotice = true;
                break;
            }

            case TradeStatusEnum.WAIT_SELLER_AGREE:
            {
                noticeContent = string.Format("买家 {0} 等待你同意退款, 请<a href =\"" + pageName + "?goodstradelogid={1}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Buyer,
                                              goodsTradeLog.Id);
                isSendNotice = true;
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                break;
            }

            case TradeStatusEnum.SELLER_REFUSE_BUYER:
            {
                noticeContent = string.Format("卖家 {0} 拒绝您的条件, 等待您修改条件, 请<a href =\"" + pageName + "?goodstradelogid={1}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Seller,
                                              goodsTradeLog.Id);
                isSendNotice = true;
                noticeUid    = goodsTradeLog.Buyerid;
                posterId     = goodsTradeLog.Sellerid;
                poster       = goodsTradeLog.Seller;
                break;
            }

            case TradeStatusEnum.WAIT_BUYER_RETURN_GOODS:
            {
                noticeContent = string.Format("卖家 {0} 同意退款, 等待您退货, 请<a href =\"" + pageName + "?goodstradelogid={1}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Seller,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Buyerid;
                posterId     = goodsTradeLog.Sellerid;
                poster       = goodsTradeLog.Seller;
                isSendNotice = true;
                break;
            }

            case TradeStatusEnum.WAIT_SELLER_CONFIRM_GOODS:
            {
                noticeContent = string.Format("买家 {0} 已退货, 等待您收货, 请<a href =\"" + pageName + "?goodstradelogid={1}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Buyer,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                isSendNotice = true;
                break;
            }

            case TradeStatusEnum.TRADE_FINISHED:
            {
                noticeContent = string.Format("商品 {0} 已交易成功, 请<a href =\"goodsrate.aspx?goodstradelogid={1}\">点击这里</a>给对方评分.",
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                isSendNotice = true;
                break;
            }

            case TradeStatusEnum.TRADE_CLOSED:
            {
                noticeContent = string.Format("商品 {0} 交易失败, 卖家取消交易, 请<a href =\"goodsrate.aspx?goodstradelogid={1}\">点击这里</a>查看详情.",
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Sellerid;
                posterId     = goodsTradeLog.Buyerid;
                poster       = goodsTradeLog.Buyername;
                isSendNotice = true;
                break;
            }

            case TradeStatusEnum.REFUND_SUCCESS:
            {
                noticeContent = string.Format("商品 {0} 已退款成功, 请<a href =\"goodsrate.aspx?goodstradelogid={1}\">点击这里</a>给对方评分.",
                                              goodsTradeLog.Subject,
                                              goodsTradeLog.Id);
                noticeUid    = goodsTradeLog.Buyerid;
                posterId     = goodsTradeLog.Sellerid;
                poster       = goodsTradeLog.Seller;
                isSendNotice = true;
                break;
            }
            }

            //发送通知
            if (isSendNotice)
            {
                NoticeInfo noticeInfo = new NoticeInfo();
                //商品交易通知
                noticeInfo.Note         = Utils.HtmlEncode(noticeContent);
                noticeInfo.Uid          = noticeUid;
                noticeInfo.Type         = NoticeType.GoodsTradeNotice;
                noticeInfo.New          = 1;
                noticeInfo.Posterid     = posterId;
                noticeInfo.Poster       = poster;
                noticeInfo.Postdatetime = Utils.GetDateTime();

                Notices.CreateNoticeInfo(noticeInfo);
            }
            return(true);
        }