/// <summary> /// 初始化 /// </summary> private void DataInit() { pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); string title = Utils.GetQueryStringValue("txtTitle"); //用户控件的取值和赋值 string operatorId = Utils.GetQueryStringValue(this.SellsSelect1.SellsIDClient); string operatorname = Utils.GetQueryStringValue(this.SellsSelect1.SellsNameClient); this.SellsSelect1.SellsID = operatorId; this.SellsSelect1.SellsName = operatorname; EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); IList <EyouSoft.Model.GovStructure.MGovNotice> lst = BLL.GetGovNoticeList(noticeType, this.SiteUserInfo.CompanyId, title, operatorId, operatorname, this.pageSize, this.pageIndex, ref this.recordCount); if (null != lst && lst.Count > 0) { this.RepList.DataSource = lst; this.RepList.DataBind(); if (recordCount <= pageSize) { this.ExporPageInfoSelect1.Visible = false; } else { BindPage(); } } else { this.RepList.Controls.Add(new Label() { Text = "<tr><td colspan='6' align='center'>对不起,没有相关数据!</td></tr>" }); this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 初始化 /// </summary> private void DataInit() { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); IList <EyouSoft.Model.GovStructure.MGovNoticeBrowse> lst = BLL.GetGovNoticeBrowseList(this.SiteUserInfo.CompanyId, Utils.GetQueryStringValue("id"), this.pageSize, this.pageIndex, ref this.recordCount); if (null != lst && lst.Count > 0) { this.RepList.DataSource = lst; this.RepList.DataBind(); if (recordCount <= pageSize) { this.ExporPageInfoSelect1.Visible = false; } else { BindPage(); } } else { this.RepList.Controls.Add(new Label() { Text = "<tr><td colspan='3' align='center'>对不起,没有相关数据!</td></tr>" }); this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 删除操作 /// </summary> /// <param name="id">删除ID</param> /// <returns></returns> private bool DeleteData(string id) { bool b = false; if (!String.IsNullOrEmpty(id)) { EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); b = BLL.DeleteGovNotice(id.Split(',')); } return(b); }
/// <summary> /// 绑定数据源 /// </summary> public void BindSource() { int recordCount = 0; EyouSoft.BLL.GovStructure.BNotice bNotice = new EyouSoft.BLL.GovStructure.BNotice(); IList <EyouSoft.Model.GovStructure.MGovNotice> list = bNotice.GetGovNoticeList(noticeType, CompanyId, ItemType, 10, 0, ref recordCount); if (list != null) { if (list.Count != 0) { this.Repeater1.DataSource = list; this.Repeater1.DataBind(); } } }
/// <summary> /// 保存回复 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { string id = Utils.GetQueryStringValue("id"); string txtReply = Utils.GetFormValue("txtReply"); if (!String.IsNullOrEmpty(id) && !String.IsNullOrEmpty(txtReply)) { EyouSoft.Model.GovStructure.MGovNoticeReply model = new MGovNoticeReply(); model.NoticeId = id; model.OperatorId = SiteUserInfo.UserId; model.OperatorName = SiteUserInfo.Name; model.ReplyInfo = txtReply; model.IssueTime = DateTime.Now; EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); BLL.AddNoticeReply(model); EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this, "回复成功", Request.ServerVariables["SCRIPT_NAME"].ToString() + "?" + Request.QueryString); } else { EyouSoft.Common.Function.MessageBox.ShowAndReturnBack(this, "回复内容不能为空!", 1); } return; }
/// <summary> /// 加载回复列表 /// </summary> /// <param name="NoticeId">交流信息编号</param> private void InitReplyList(string NoticeId) { EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); IList <EyouSoft.Model.GovStructure.MGovNoticeReply> lst = BLL.GetGovNoticeReplyList(NoticeId, this.pageSize, this.pageIndex, ref this.recordCount); if (null != lst && lst.Count > 0) { this.rptReply.DataSource = lst; this.rptReply.DataBind(); if (recordCount <= pageSize) { this.ExporPageInfoSelect1.Visible = false; } else { BindPage(); } } else { this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id) { EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); EyouSoft.Model.GovStructure.MGovNotice Model = BLL.GetGovNoticeModel(id); if (null != Model) { //浏览人数加1 int views = 0; Int32.TryParse(Model.Views.ToString(), out views); Model.Views = views + 1; BLL.UpdateGovNotice(Model); //插入浏览人相关信息 MGovNoticeBrowse viewModel = new MGovNoticeBrowse(); viewModel.IssueTime = DateTime.Now; viewModel.NoticeId = id; viewModel.OperatorId = this.SiteUserInfo.UserId; viewModel.Operator = this.SiteUserInfo.Name; BLL.AddGovNoticeBrowse(viewModel); //通知公告标题标题 this.lbTitle.Text = Model.Title; StringBuilder strSec = new StringBuilder(); if (null != Model.MGovNoticeReceiverList && Model.MGovNoticeReceiverList.Count > 0) { EyouSoft.BLL.ComStructure.BComDepartment secBLL = new EyouSoft.BLL.ComStructure.BComDepartment(); EyouSoft.Model.ComStructure.MComDepartment secModel; foreach (MGovNoticeReceiver m in Model.MGovNoticeReceiverList) { if (m.ItemType == EyouSoft.Model.EnumType.GovStructure.ItemType.指定部门) { if (!string.IsNullOrEmpty(m.ItemId)) { int[] intArry = Utils.GetIntArray(m.ItemId, ","); for (int j = 0; j < intArry.Length; j++) { secModel = secBLL.GetModel(intArry[j], this.SiteUserInfo.CompanyId); if (null != secModel) { strSec.Append(secModel.DepartName + ","); } } } } else { strSec.Append(m.ItemType.ToString() + ","); } } } //发布对象 this.lbObj.Text = strSec.Length > 0 ? strSec.ToString().Substring(0, strSec.Length - 1) : ""; //内容 this.lbContent.Text = Model.Content; IList <EyouSoft.Model.ComStructure.MComAttach> lstFiles = Model.ComAttachList; StringBuilder strFile = new StringBuilder(); if (null != lstFiles && lstFiles.Count > 0) { for (int i = 0; i < lstFiles.Count; i++) { strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a></span>", lstFiles[i].FilePath, lstFiles[i].Name); } this.lbFile.Text = strFile.ToString(); } else { this.lbFile.Text = "无"; } //是否提醒 this.LbAwake.Text = Model.IsRemind == true ? "是" : "否"; //是否发送短信 //this.LbSendmsg.Text = Model.IsMsg == true ? "是" : "否"; //短信内容 //this.LbMsgcontent.Text = Model.MsgContent; this.lbTime.Text = string.Format("{0:yyyy-MM-dd HH:mm}", Model.IssueTime); this.lbSender.Text = Model.Operator; } }