public void SendMsgToUser(int meetCode) { ConferenceManageBFL ebfl = new ConferenceManageBFL(); ConferenceManageModel conferenceManage = new ConferenceManageModel(); conferenceManage = ebfl.GetConferenceManage(meetCode); string strUser = conferenceManage.ChaterMember; string text2 = string.Format("{0} 会议", conferenceManage.Topic); string text3 = string.Format("主办单位: <b>{0}</b>\r\n会议地点: <b>{1}</b>\r\n会议时间:<b>{2}</b>\r\n<a href='../RmsOA/XZ_Conference.aspx?Type=Read&Code={3}'>详细内容</a>\r\n<a href='../RmsOA/XZ_ConferenceWeek.aspx'>本周会议</a>", new object[] { conferenceManage.Dept, conferenceManage.Place, conferenceManage.StartTime, meetCode.ToString() }); DateTime now = DateTime.Now; string code = SystemManageDAO.GetNewSysCode("Notice"); EntityData entity = new EntityData("Standard_Notice"); DataRow newRecord = entity.GetNewRecord(); newRecord["NoticeCode"] = code; newRecord["Title"] = text2; newRecord["SubmitPerson"] = strUser; newRecord["SubmitDate"] = DateTime.Now; newRecord["UpdateDate"] = DateTime.Now; newRecord["UserCode"] = strUser; newRecord["Content"] = text3; newRecord["Type"] = "1"; newRecord["IsAll"] = "0"; newRecord["status"] = "1"; entity.AddNewRecord(newRecord); string strTmp = this.UserListString(meetCode); ArrayList arOperator = new ArrayList(); this.SaveRS(arOperator, StringRule.CutRepeat(strTmp), "", "080104"); this.SaveRS(arOperator, strUser, "", "080102,080103,080104"); if (arOperator.Count > 0) { ResourceRule.SetResourceAccessRange(code, "0801", "", arOperator, false); } RemindDAO.InsertNotice(entity); entity.Dispose(); }
//保存数据 private bool SaveData() { this.htType.Value = Request["DocType"].ToString(); //保存通知 EntityData entityNotice = new EntityData("Standard_Notice"); DataRow drNotice = entityNotice.GetNewRecord(); this.strNoticeCode = SystemManageDAO.GetNewSysCode("Notice"); if (this.txtTitle.Value.Trim() == "") { return(false); } if (this.taContent.Value.Trim() == "") { return(false); } //新加通知类型(测试正确后删除此注释) if (this.up_sPMNameLower == "tianyangoa") { if (this.htType.Value == "1") { if (this.DDLNoticeClass.Value.Trim() == string.Empty) { return(false); } drNotice["NoticeClass"] = this.DDLNoticeClass.Value.Trim(); } } drNotice["NoticeCode"] = this.strNoticeCode; drNotice["Title"] = this.txtTitle.Value.Trim(); //drNotice["EnableDate"] = this.dtbShowDate.Value; drNotice["SubmitPerson"] = base.user.UserCode; drNotice["SubmitDate"] = DateTime.Now; drNotice["UpdateDate"] = DateTime.Now; drNotice["UserCode"] = base.user.UserCode; drNotice["Content"] = this.taContent.Value; if (this.htType.Value != "") { drNotice["Type"] = this.htType.Value; } entityNotice.AddNewRecord(drNotice); // //保存操作用户 //如果未选择通知用户,面向全体用户发布 // string strUser = this.txtUsers.Value.Trim(); // if(strUser.Length>0) // this.SaveUser(strUser); // // 保存分发岗位 // string strDept = this.txtDepts.Value.Trim(); // if(strDept.Length>0) // this.SaveDept(strDept); // 保存资源,保存权限 string strUser = this.txtUsers.Value.Trim(); string strStation = this.txtStations.Value.Trim(); // 没有选择人员则向全体发布 if (strUser.Length < 1 && strStation.Length < 1) { strUser = this.GetAllUser(); drNotice["IsAll"] = "1"; } else { drNotice["IsAll"] = "0"; } drNotice["status"] = "1"; ArrayList arOperator = new ArrayList(); this.SaveRS(arOperator, BLL.StringRule.CutRepeat(strUser), BLL.StringRule.CutRepeat(strStation), "080104"); // 一般通知查看权限 this.SaveRS(arOperator, base.user.UserCode, "", "080102,080103,080104"); // 修改和删除 if (arOperator.Count > 0) { BLL.ResourceRule.SetResourceAccessRange(this.strNoticeCode, "0801", "", arOperator, false); } RemindDAO.InsertNotice(entityNotice); entityNotice.Dispose(); // 保存附件 this.myAttachMentAdd.SaveAttachMent(this.strNoticeCode); this.btDelete.Visible = false; return(true); }