protected void PageInit(string id) { EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); EyouSoft.Model.GovStructure.MGovDocuments model = BLL.GetGovFilePersonnelModel(id); if (model != null) { this.lbTitle.Text = model.Title; this.lbCompany.Text = model.Company; this.lbFontSize.Text = model.FontSize; IList <EyouSoft.Model.ComStructure.MComAttach> lstFile = model.ComAttachList; StringBuilder strFile = new StringBuilder(); 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></span>", lstFile[i].FilePath, lstFile[i].Name); } } this.lbFiles.Text = strFile.ToString(); if (model.GovDocumentsApproveList != null && model.GovDocumentsApproveList.Count > 0) { this.rpt_approve.DataSource = model.GovDocumentsApproveList; this.rpt_approve.DataBind(); if (model.GovDocumentsApproveList.Where(item => (item.ApproveID) == this.SiteUserInfo.UserId).ToList().Count > 0) { this.ph_Flies.Visible = true; } else { this.ph_Flies.Visible = false; } } } }
/// <summary> /// 页面加载 /// </summary> protected void PageInit() { string fontSize = Utils.GetQueryStringValue("fontSize"); string company = Utils.GetQueryStringValue("fbdw"); string title = Utils.GetQueryStringValue("txttitle"); EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); IList <EyouSoft.Model.GovStructure.MGovDocuments> DocList = BLL.GetGovDocumentsList(this.SiteUserInfo.CompanyId, fontSize, company, title, PageSize, PageIndex, ref RecordCount); if (DocList != null && DocList.Count > 0) { this.rptFileList.DataSource = DocList; this.rptFileList.DataBind(); if (RecordCount <= PageSize) { this.ExporPageInfoSelect1.Visible = false; } else { BindPage(); } } else { this.rptFileList.Controls.Add(new Label() { Text = "<tr><td colspan='12' align='center'>对不起,暂无数据!</td></tr>" }); this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 删除 /// </summary> /// <param name="id">编号</param> /// <returns></returns> protected bool DeleteData(string id) { bool b = false; if (id != null && id != string.Empty) { string[] ids = id.Split(','); EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); b = BLL.DeleteGovDocuments(ids); } return(b); }
/// <summary> /// 审批 /// </summary> protected void PageApprove() { string msg = ""; bool result = false; //表单取值 string id = Utils.GetQueryStringValue("id"); string appid = Utils.GetQueryStringValue("appid"); string appName = Utils.GetQueryStringValue("appname"); string appTime = Utils.GetQueryStringValue("apptime"); string appView = Utils.GetQueryStringValue("appview"); //验证 if (string.IsNullOrEmpty(appTime)) { msg += "-请输入审批时间!<br/>"; } if (string.IsNullOrEmpty(appView)) { msg += "-请输入审批意见!<br/>"; } if (!string.IsNullOrEmpty(msg)) { Response.Clear(); Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); } //实体赋值 EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); EyouSoft.Model.GovStructure.MGovDocumentsApprove model = new EyouSoft.Model.GovStructure.MGovDocumentsApprove(); model.DocumentsId = id; model.ApproveID = appid; model.ApproveState = ApprovalStatus.审核通过; model.ApproveTime = Utils.GetDateTimeNullable(appTime); model.ApprovalViews = appView; model.ApproveName = appName; //提交保存 result = BLL.UpdateGovDocumentsApprove(model); msg = result ? "审批通过!" : "审批失败!"; Response.Clear(); Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id) { #region 用户控件初始化 this.SingleFileUpload1.CompanyID = this.SiteUserInfo.CompanyId; #endregion if (!string.IsNullOrEmpty(id)) { EyouSoft.Model.GovStructure.MGovDocuments model = new EyouSoft.Model.GovStructure.MGovDocuments(); EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); model = BLL.GetGovFilePersonnelModel(id); if (model != null) { this.hidKeyId.Value = model.DocumentsId; this.txtfileSize.Text = model.FontSize; this.txtcompany.Text = model.Company; this.txttitle.Text = model.Title; //审批或传阅 this.shenpi.Checked = model.FileType == FileType.审批; this.chuanyue.Checked = model.FileType == FileType.阅; //经办人 this.HrSelect1.HrSelectID = model.AttnId; this.HrSelect1.HrSelectName = model.AttnName; //审批人 this.SellsSelect1.SellsID = GetSells(model.GovDocumentsApproveList, 1); this.SellsSelect1.SellsName = GetSells(model.GovDocumentsApproveList, 2); 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();//附件 if (!this.SiteUserInfo.IsHandleElse && this.SiteUserInfo.UserId != model.OperatorID) { this.ph_Save.Visible = false; } } } }
/// <summary> /// 页面保存 /// </summary> protected void PageSave(string doType) { #region 表单取值 string documentid = Utils.GetFormValue(hidKeyId.UniqueID); string fontsize = Utils.GetFormValue(txtfileSize.UniqueID); string company = Utils.GetFormValue(txtcompany.UniqueID); string title = Utils.GetFormValue(txttitle.UniqueID); string attnid = Utils.GetFormValue(HrSelect1.HrSelectIDClient); string attnname = Utils.GetFormValue(HrSelect1.HrSelectNameClient); string approveid = Utils.GetFormValue(SellsSelect1.SellsIDClient); string approvename = Utils.GetFormValue(SellsSelect1.SellsNameClient); string isPass = Utils.GetFormValue("isPass"); #endregion #region 表单验证 string msg = ""; bool result = false; if (string.IsNullOrEmpty(fontsize)) { msg += "-请输入文件字号!"; } if (string.IsNullOrEmpty(company)) { msg += "-请输入文件发布单位!"; } if (string.IsNullOrEmpty(title)) { msg += "-请输入文件标题!"; } if (string.IsNullOrEmpty(approveid) || string.IsNullOrEmpty(approvename)) { msg += "-请选择审批或者传阅人!"; } if (string.IsNullOrEmpty(attnid) || string.IsNullOrEmpty(attnname)) { msg += "-请选择经办人!"; } if (!string.IsNullOrEmpty(msg)) { Response.Clear(); Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); } #endregion #region 实体赋值 EyouSoft.Model.GovStructure.MGovDocuments model = new EyouSoft.Model.GovStructure.MGovDocuments(); model.AttnId = attnid; model.AttnName = attnname; model.Company = company; model.CompanyId = this.SiteUserInfo.CompanyId; model.DocumentsId = documentid; model.FileType = isPass == "shenpi" ? FileType.审批 : FileType.阅; model.FontSize = fontsize; model.GovDocumentsApproveList = GetList(approveid, approvename); model.IssueTime = DateTime.Now; model.OperatorID = this.SiteUserInfo.UserId; model.Title = title; model.ComAttachList = NewGetAttach(); #endregion #region 保存提交 EyouSoft.BLL.GovStructure.BDocuments BLL = new EyouSoft.BLL.GovStructure.BDocuments(); if (doType == "add") { result = BLL.AddGovDocuments(model); msg = result ? "添加成功!" : "添加失败!"; } else { result = BLL.UpdateGovDocuments(model, AttachItemType.文件管理); msg = result ? "修改成功!" : "修改失败!"; } Response.Clear(); Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); #endregion }