Coolite实现类型于QQ的消息提醒功能

该博客介绍了一种使用Coolite库来实现类似QQ的消息提醒功能的方法。通过检查用户角色,针对不同部门显示不同的消息通知,例如针对财务室显示未审批的收款信息,针对设计部合同岗显示已审批的收款信息。提醒采用滚动字幕的方式,并配置了通知的显示样式和动画效果。
摘要由CSDN通过智能技术生成
/// <summary>
    /// QQ消息提醒  
    /// </summary>
    public void ShowLikeQQ()
    {
        string userid = new DOE.Bll.EntityHelper.DesignTask_Audit().GetUserIDForAlias(HttpContext.Current.User.Identity.Name);
        if (CheckUserRole(userid, "财务室"))
        {
            DataTable dt = new DOE.Bll.ContractInfo.GatherService().ReturnMessage("未审批");
            int count = dt.Rows.Count;
            if (count < 1)
            {
                return;
            }
            ScriptManager1.RegisterIcon(Icon.AwardStarBronze1);
            string stub = "<br /><br /><br /><marquee direction='up' height='30' scrolldelay='250' ><font color='red'style='font-weight:bolder'>     有" + count + "条新收款信息,请注意审核!<br/></font></marquee>";
            Ext.Notification.Show(new Notification.Config
            {
                Title = "最新公告",
                HideDelay = 8000,
                Icon = Icon.AwardStarBronze1,
                Height = 160,
                Width = 250,
                Draggable = false,
                AlignCfg = new Notification.AlignConfig
                {
                    ElementAnchor = AnchorPoint.BottomRight,
                    TargetAnchor = AnchorPoint.BottomRight,
                    OffsetX = -0,
                    OffsetY = -0
                },
                AutoHide = false,
                ShowPin = false,
                CloseVisible = true,
                BodyStyle = "padding:5px",
                ShowFx = new SlideIn { Anchor = AnchorPoint.BottomRight, Options = new Fx.Config { Easing = Easing.BackOut } },
                HideFx = new SlideOut { Anchor = AnchorPoint.BottomRight },
                Html = stub
            });

        }
        else if (CheckUserRole(userid, "设计部合同岗"))
        {
            DataTable dt = new DOE.Bll.ContractInfo.GatherService().ReturnMessage("已审批");
            int count = dt.Rows.Count;
            if (count < 1)
            {
                return;
            }
            ScriptManager1.RegisterIcon(Icon.AwardStarBronze1);
            string stub = "<br /><br /><br /><marquee direction='up' height='30' scrolldelay='250' ><font color='red'style='font-weight:bolder'>     最近有" + count + "条审核的收款信息!<br/></font></marquee>";
            Ext.Notification.Show(new Notification.Config
            {
                Title = "最新消息",
                HideDelay = 8000,
                Icon = Icon.AwardStarBronze1,
                Height = 160,
                Width = 250,
                Draggable = false,
                AlignCfg = new Notification.AlignConfig
                {
                    ElementAnchor = AnchorPoint.BottomRight,
                    TargetAnchor = AnchorPoint.BottomRight,
                    OffsetX = -0,
                    OffsetY = -0
                },
                AutoHide = false,
                ShowPin = false,
                CloseVisible = true,
                BodyStyle = "padding:5px",
                ShowFx = new SlideIn { Anchor = AnchorPoint.BottomRight, Options = new Fx.Config { Easing = Easing.BackOut } },
                HideFx = new SlideOut { Anchor = AnchorPoint.BottomRight },
                Html = stub
            });

        }
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值