예제 #1
0
        public void SendGroup(int 類別, string 職稱, string message, string[]  限) //對特定群組發送通知
        {
            foreach (var x in  限)
            {
                var 通知 = new 通知
                {
                    通知類別id = 類別,
                    通知內容   = message,
                    讀取狀態   = "未讀",
                    通知權限   = x.ToString()
                };
                db.通知.Add(通知);
                db.SaveChanges();
            }
            var 通知類別轉換 = db.通知類別.FirstOrDefault(m => m.通知類別id == 類別);

            if (職稱 == "員工")
            {
                Clients.Group("員工").sendlv1(通知類別轉換.通知類別1, message, 限[3]);
                Clients.Group("人事").sendlv2(通知類別轉換.通知類別1, message, 限[2]);
                Clients.Group("主管").sendlv3(通知類別轉換.通知類別1, message, 限[1]);
                Clients.Group("總經理").sendtop(通知類別轉換.通知類別1, message, 限[0]); //sendtop=前端的function(自定義)
            }
            if (職稱 == "人事")
            {
                Clients.Group("人事").sendlv2(通知類別轉換.通知類別1, message, 限[2]);
                Clients.Group("主管").sendlv3(通知類別轉換.通知類別1, message, 限[1]);
                Clients.Group("總經理").snedlvtop(通知類別轉換.通知類別1, message, 限[0]);  //sendtop=前端的function(自定義)
            }
            if (職稱 == "主管")
            {
                Clients.Group("主管").sendtop(通知類別轉換.通知類別1, message, 限[1]);
                Clients.Group("總經理").sendtop(通知類別轉換.通知類別1, message, 限[0]);
            }
        }
예제 #2
0
 public static IEnumerable<通知> 筛选通知(int skip, int limit, 通知.通知所属 通知所属, DateTime 起始日期, DateTime 结束日期, string 关键字 = null)
 {
     var q = new List<IMongoQuery>();
     if (通知所属 != 通知.通知所属.未指定) q.Add(Query.EQ("通知所属", 通知所属));
     if (DateTime.MinValue != 起始日期 && DateTime.MinValue != 结束日期)
         q.Add(Query.And(
             Query.GTE("基本数据.修改时间", 起始日期),
             Query.LTE("基本数据.修改时间", 结束日期)
         ));
     if (string.IsNullOrWhiteSpace(关键字))
         q.Add(Query.Matches("内容主体.标题", 关键字));
     return Mongo.查询<通知>(skip, limit, Query.And(q.ToArray()), includeDisabled: false);
 }
예제 #3
0
        protected override void メッセージを処理する(通知 msg)
        {
            switch (msg)
            {
            case ViewerPlayメッセージ msg2:
                if (DTXMania.AppForm.ビュアーモードである)
                {
                    this.演奏ステージ_ビュアーモード.ViewerPlay(msg2);
                }
                break;

            case ViewerStopメッセージ msg2:
                if (DTXMania.AppForm.ビュアーモードである)
                {
                    this.演奏ステージ_ビュアーモード.ViewerStop(msg2);
                }
                break;
            }

            base.メッセージを処理する(msg);   // 忘れずに
        }
 public ActionResult Part_Procure_TzList_AuditDetail(int? id)
 {
     通知 g = new 通知();
     if (null != id)
     {
         g = 通知管理.查找通知((long)id);
         if (g == null)
         {
             return Content("<script>window.location='/单位用户后台/Procure_TzList';</script>");
         }
     }
     return PartialView("Procure_Part/Part_Procure_TzList_AuditDetail", g);
 }
 public ActionResult Part_Procure_TzDetail(int? id)
 {
     通知 g = new 通知();
     var come = Request.QueryString["come"];
     var comestr = "我的通知列表";
     if (come == "a")
     {
         comestr = "审核通知";
     }
     else if (come == "l")
     {
         comestr = "通知列表";
     }
     if (null != id)
     {
         g = 通知管理.查找通知((long)id);
         if (g == null)
         {
             return Content("<script>window.location='/单位用户后台/Procure_TzList';</script>");
         }
     }
     ViewData["come"] = comestr;
     return PartialView("Procure_Part/Part_Procure_TzDetail", g);
 }
예제 #6
0
 /// <summary>
 /// 设置关键字高亮
 /// </summary>
 /// <param name="dicKeywords">关键字列表</param>
 /// <param name="model">返回的数据模型</param>
 /// <returns></returns>
 private 通知 SetHighlighter(Dictionary<string, string> dicKeywords, 通知 model)
 {
     SimpleHTMLFormatter simpleHTMLFormatter = new PanGu.HighLight.SimpleHTMLFormatter("<font color=\"red\">", "</font>");
     Highlighter highlighter = new PanGu.HighLight.Highlighter(simpleHTMLFormatter, new Segment());
     highlighter.FragmentSize = 50;
     string strTitle = string.Empty;
     string strContent = string.Empty;
     dicKeywords.TryGetValue("title", out strTitle);
     if (!string.IsNullOrEmpty(strTitle))
     {
         string title = highlighter.GetBestFragment(strTitle, model.内容主体.标题);
         if (!string.IsNullOrEmpty(title))
             model.内容主体.标题 = title;
     }
     return model;
 }
예제 #7
0
        public ActionResult Part_SearchByCondition()
        {
            int page = int.Parse(Request.Params["page"]);
            string keyword = Request.Params["keyword"];

            TopDocs serchalllist = SearchIndex("/Lucene.Net/IndexDic/Tongzhi", keyword);

            IList<通知> serchlist = new List<通知>();
            var listcount = serchalllist.totalHits > 1000 ? 1000 : serchalllist.totalHits;
            if (serchalllist != null && listcount > 0)
            {
                int maxpage = Math.Max((listcount + PAGESIZE - 1) / PAGESIZE, 1);

                int length = PAGESIZE;
                if (maxpage == page && listcount % PAGESIZE != 0)
                {
                    length = listcount % PAGESIZE;
                }

                int count = PAGESIZE * ((int)page - 1);
                //IndexSearcher search = new IndexSearcher(IndexDic("/Lucene.Net/IndexDic/Tongzhi"), true);
                IndexSearcher search = new IndexSearcher(new Lucene.Net.Store.SimpleFSDirectory(new System.IO.DirectoryInfo(IndexDic("/Lucene.Net/IndexDic/Tongzhi"))), true);
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("title", keyword);
                for (int i = count; i < count + length; i++)
                {
                    通知 model = new 通知();
                    model.Id = long.Parse(search.Doc(serchalllist.scoreDocs[i].doc).Get("NumId"));
                    model.内容主体.标题 = search.Doc(serchalllist.scoreDocs[i].doc).Get("Title");
                    model.内容主体.发布时间 = Convert.ToDateTime(search.Doc(serchalllist.scoreDocs[i].doc).Get("AddTime"));
                    serchlist.Add(SetHighlighter(dic, model));
                }

                ViewData["currentpage"] = page;
                ViewData["pagecount"] = maxpage;
            }
            ViewData["通知搜索显示列表"] = serchlist;

            return PartialView("Part_Notice/Part_SearchByCondition");
        }
예제 #8
0
 public static bool 更新通知(通知 content,bool flage = true)
 {
     return Mongo.更新(content,flage);
 }
예제 #9
0
 public static bool 添加通知(通知 content)
 {
     return Mongo.添加(content);
 }