public static bool Notify(int flowId, int flowNo, List <int> listWorkerId) { using (MainDataContext dbContext = new MainDataContext()) { try { foreach (int workerId in listWorkerId) { int count = dbContext.F_INST_NOTICE.Count(t => t.FlowID == flowId && t.FlowNo == flowNo && t.WorkerID == workerId); if (count == 0) { F_INST_NOTICE notice = new F_INST_NOTICE(); notice.FlowID = flowId; notice.FlowNo = flowNo; notice.WorkerID = workerId; dbContext.F_INST_NOTICE.InsertOnSubmit(notice); } } dbContext.SubmitChanges(); return(true); } catch { return(false); } } }
/// <summary> /// (收件箱)查看过的邮件改为已读 /// </summary> /// <param name="mailID"></param> /// <returns></returns> public static bool NoticeReadFlag(int flowId, int flowNo, int workerID) { using (MainDataContext dbContext = new MainDataContext()) { F_INST_NOTICE w = dbContext.F_INST_NOTICE.FirstOrDefault(m => m.FlowID == flowId && m.FlowNo == flowNo && m.WorkerID == workerID); w.ReadFlag = true; dbContext.SubmitChanges(); return(true); } }