/// <summary> /// 获取附件链接 默认取集合里的第一个附件 /// </summary> /// <param name="id">公告编号</param> /// <returns></returns> protected string GetUrl(string id) { StringBuilder sb = new StringBuilder(); if (!string.IsNullOrEmpty(id)) { EyouSoft.BLL.GovStructure.BNotice bll = new EyouSoft.BLL.GovStructure.BNotice(); EyouSoft.Model.ComStructure.MComAttach attachModel = new EyouSoft.Model.ComStructure.MComAttach(); EyouSoft.Model.GovStructure.MGovNotice noticeModel = new EyouSoft.Model.GovStructure.MGovNotice(); noticeModel = bll.GetGovNoticeModel(id); if (noticeModel != null) { if (noticeModel.ComAttachList != null && noticeModel.ComAttachList.Count > 0) { attachModel = noticeModel.ComAttachList.First(); sb.AppendFormat("<a target=\"_blank\" title=\"附件\" href=\"/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}\" ><img src=\"/Images/fujian.gif\" /></a>", attachModel.FilePath, attachModel.Name); return(sb.ToString()); } } } return(string.Empty); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id) { #region 初始化用户控件 this.SelectSection1.ParentIframeID = Utils.GetQueryStringValue("iframeId"); this.SelectSection1.SModel = "2"; this.SelectSection1.SetTitle = "指定部门"; this.SingleFileUpload1.CompanyID = this.SiteUserInfo.CompanyId; #endregion if (!string.IsNullOrEmpty(id)) { EyouSoft.BLL.GovStructure.BNotice BLL = new EyouSoft.BLL.GovStructure.BNotice(); MGovNotice Model = BLL.GetGovNoticeModel(id); if (null != Model) { #region 普通赋值 //标题 this.txtTitle.Text = Model.Title; this.hidNotiecID.Value = Model.NoticeId; //内容 this.txtContent.Text = Model.Content; //消息内容 //this.msgContent.Text = Model.MsgContent; //发布人 this.lbSender.Text = Model.Operator; //发布时间 this.lbTime.Text = string.Format("{0:yyyy-MM-dd HH:mm}", Model.IssueTime); #region 发布对象 IList <MGovNoticeReceiver> lst = Model.MGovNoticeReceiverList; if (lst != null && lst.Count > 0) { string sectionID = ""; foreach (MGovNoticeReceiver item in lst) { switch (item.ItemType) { case EyouSoft.Model.EnumType.GovStructure.ItemType.指定部门: PointDept.Checked = true; sectionID += item.ItemId.Trim() + ","; break; default: break; } } sectionID = sectionID.Length > 0 ? sectionID.Substring(0, sectionID.Length - 1) : ""; this.SelectSection1.SectionID = sectionID; this.SelectSection1.SectionName = GetDeptName(sectionID); } #endregion #endregion #region 附件处理 //附件 StringBuilder strFile = new StringBuilder(); IList <EyouSoft.Model.ComStructure.MComAttach> lstFile = Model.ComAttachList; if (null != lstFile && lstFile.Count > 0) { for (int i = 0; i < lstFile.Count; i++) { strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a><a href=\"javascript:void(0)\" onclick=\"PageJsData.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", lstFile[i].FilePath, lstFile[i].Name); } } this.lbFiles.Text = strFile.ToString();//附件 #endregion #region 权限判断 //权限判断 if (!this.SiteUserInfo.IsHandleElse && Model.OperatorId != this.SiteUserInfo.UserId) { this.ph_Save.Visible = false; } #endregion } } else { this.lbSender.Text = this.SiteUserInfo.Name; this.lbTime.Text = string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now); } }