/// <summary> /// 发送消息 /// </summary> private void SendInformation(int jobflowid, string[] list) { PJOAModels.JobFlow model = PJOABLL.JobFlowManager.GetModel(jobflowid); PJOAModels.Information informodel = null; if (model != null) { informodel = new PJOAModels.Information(); informodel.sortid = 5; informodel.associationid = jobflowid; informodel.contents = "审核编号为" + model.cname + "的单据"; informodel.createtime = DateTime.Now; informodel.sendtime = DateTime.Now; informodel.founderid = ((PJOAModels.LoginInfo)Session["login"]).Id; if (PJOABLL.InformationManager.Add(informodel)) { int maxid = PJOABLL.InformationManager.GetMaxId(); PJOAModels.InformationNotice infnotic = null; for (int j = 0; j < list.Length; j++) { infnotic = new PJOAModels.InformationNotice(); infnotic.informationid = maxid; infnotic.recipientid = int.Parse(list[j].ToString()); infnotic.remind = "是"; PJOABLL.InformationNoticeManager.Add(infnotic); } } } }
/// <summary> /// 创建消息,返回消息的id值 /// </summary> public int CreateInfo(string straudit) { PJOAModels.Information model = new PJOAModels.Information(); model.sortid = 1; model.associationid = 1; model.createtime = DateTime.Now; model.sendtime = DateTime.Now; model.founderid = ((PJOAModels.LoginInfo)Session["login"]).Id; model.contents = straudit; PJOABLL.InformationManager.Add(model); int maxid = PJOABLL.InformationManager.GetMaxId(((PJOAModels.LoginInfo)Session["login"]).Id.ToString()); return(maxid); }