/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { T_FileList_BLL fileListBLL = new T_FileList_BLL(); T_WorkFlowDoResult_BLL doResultBLL = new T_WorkFlowDoResult_BLL(); string[] FileListIDS = DNTRequest.GetQueryString("FileListIDS").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); string[] MustSubmitFlags = DNTRequest.GetQueryString("mustSubmitFlags").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (var i = 0; i < FileListIDS.Length; i++) { T_FileList_MDL fileListMDL = fileListBLL.GetModel(ConvertEx.ToInt(FileListIDS[i])); if (fileListMDL != null && !fileListMDL.IsFolder) { T_WorkFlowDoResult_MDL doResultMDL = new T_WorkFlowDoResult_MDL(); doResultMDL.FileListID = ConvertEx.ToInt(FileListIDS[i]); doResultMDL.SingleProjectID = DNTRequest.GetQueryInt("SingleProjectID", 0); doResultMDL.WorkFlowID = DNTRequest.GetQueryInt("workFlowID", 0); doResultMDL.DoUserID = Common.ConvertEx.ToInt(Common.Session.GetSessionInt("UserID")); doResultMDL.DoDateTime = System.DateTime.Now; doResultMDL.DoResult = ddlDoResult.SelectedValue; doResultMDL.DoRemark = DoRemark.Text.Trim(); doResultBLL.Add(doResultMDL); fileListMDL.Remark = DoRemark.Text.Trim(); fileListMDL.MustSubmitFlag = ConvertEx.ToBool(MustSubmitFlags[i]); fileListBLL.Update(fileListMDL); FileAccept(FileListIDS[i], ConvertEx.ToBool(ddlDoResult.SelectedValue)); } } Common.MessageBox.CloseLayerOpenWeb(this.Page); }
public void ExctFileList(string strFileListID, string strTitle, string strPsz, string strPsdd, string strPssj, string strOrderIndex) { try { int FileListId = ConvertEx.ToInt(strFileListID); if (FileListId > 0) { T_FileList_MDL model = fileListBLL.GetModel(FileListId); if (!model.IsFolder) { model.Title = strTitle; model.psz = strPsz; if (strPssj != "") { model.pssj = ConvertEx.ToDate(strPssj); } model.psdd = strPsdd; model.OrderIndex = ConvertEx.ToInt(strOrderIndex); model.CreateDate = System.DateTime.Now;//文件登记时间 fileListBLL.Update(model); T_Other_BLL otherBLL = new T_Other_BLL(); otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0"); } } } catch (Exception ex) { LogUtil.Debug(this, "文件登记归档目录保存操作", ex); } }
protected void Page_Load(object sender, EventArgs e) { MyAddInit(); if (!String.IsNullOrEmpty(ID)) { if (DNTRequest.GetQueryString("fileType") == "PDF") //查看单个PDF { T_EFile_MDL Emodel = efileBLL.GetModel(ConvertEx.ToInt(ID)); if (Emodel != null) { T_FileList_MDL model = fileBLL.GetModel(ConvertEx.ToInt(Emodel.FileListID)); if (model != null) { string LastPath = model.RootPath.Substring(0, model.RootPath.Length - 1); int iPos1 = LastPath.LastIndexOf('\\'); LastPath = LastPath.Substring(iPos1 + 1); string mHttpUrl = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + LastPath; mEFilePath = mHttpUrl + "/" + model.SingleProjectID + "/PDF/" + Emodel.PDFFilePath; if (Convert.ToString(Emodel.PDFFilePath).Trim().Length == 0) { MessageBox.ShowAndCloseWin(this, "没有文件,无法查看!"); } } } } else //查看文件所有的PDF { T_FileList_MDL model = fileBLL.GetModel(ConvertEx.ToInt(ID)); if (model != null) { if (model.RootPath.Length > 0) { mEFilePath = FormatPdfSrc(model.RootPath, model.SingleProjectID.ToString(), model.PDFFilePath); int outSideRelatedDtCount = 0; //附件PDF数量 string outSideRelatedString = string.Empty; LoadEFileOutSideRelated(model.FileListID.ToString(), out outSideRelatedDtCount, out outSideRelatedString); if (outSideRelatedDtCount > 0) { string btnStr = " <input type=\"button\" id=\"btnfirst\" class=\"buttonFileList\" onclick=\"loadPdf(this,'{0}')\" title=\"{1}\" value=\" 主件 \" />"; ltBtnHtml.Text += "<div class=\"divTree\">"; ltBtnHtml.Text += String.Format(btnStr, FormatPdfSrc(model.RootPath, model.SingleProjectID.ToString(), model.PDFFilePath), model.Title); ltBtnHtml.Text += outSideRelatedString; ltBtnHtml.Text += "</div>"; } } else { MessageBox.ShowAndCloseWin(this, "没有文件,无法查看!"); } } } } else { MessageBox.ShowAndCloseWin(this, "没有文件,无法查看!"); } }
public void DeleteFile(string archiveListCellRptID, string singleProjectID) { T_EFile_MDL model = new T_EFile_MDL(); model = eFileBLL.GetModel(Convert.ToInt32(archiveListCellRptID)); if (model != null) { string filePath = string.Concat(model.RootPath, singleProjectID, "\\ODOC\\", model.FilePath); if (filePath != "" && System.IO.File.Exists(filePath)) { System.IO.File.Delete(filePath); } //删除电子文件记录 eFileBLL.Delete(Convert.ToInt32(archiveListCellRptID)); PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_EFile;key=", model.ArchiveListCellRptID, ";SingleProjectID=", SingleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title)); //Leo 更新文件夹,晚上重新生产一次 T_FileList_MDL fileListMDL = fileListBLL.GetModel(model.FileListID); if (fileListMDL != null) { fileListMDL.CONVERT_FLAG = false; fileListMDL.Version = PublicModel.getFileVersion(fileListMDL.SingleProjectID.ToString()); fileListBLL.Update(fileListMDL); } } }
public bool CheckSignatureStatus(string FileListID, string FileListTmpID) { bool flag = false; T_FileList_MDL fileListMDL = fileBLL.GetModel(ConvertEx.ToInt(FileListID)); if (fileListMDL != null && fileListMDL.iSignaturePdf && !fileListMDL.iSignatureWorkFlow) { return(true); } if (signatureLogBLL.GetRecordCount("FileListID=" + FileListID + "") < 1) //如果一个章都没签,则判断文件模板中第一个章的角色是否是当前用户角色 { DataTable dt = new T_FileList_SignatureTmp_BLL().GetList(1000, "FileListID=" + FileListTmpID + "", "OrderIndex asc ").Tables[0]; if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["SignatureType"].ToString().ToLower() == Common.Session.GetSession("RoleCode", true)) { flag = true; } } else { if (signatureLogBLL.GetUpSignatureCount(Common.Session.GetSession("RoleCode"), FileListTmpID, FileListID, "1") > 0 || signatureLogBLL.GetRecordCount("FileListID=" + FileListID + " And Signature_UserRoleCode='" + Common.Session.GetSession("RoleCode", false) + "'") > 0) { flag = true; //当前用户角色的上个角色已签章完成 或当前用户角色已签过章 } } return(flag); }
/// <summary> /// 生成文件编号 /// </summary> /// <param name="type"></param> /// <returns></returns> public string GetBH(string SingleProjectId, string filelistId) { string bh = string.Empty; T_FileList_BLL fileBLL = new T_FileList_BLL(); T_FileList_MDL fileMDL = fileBLL.GetModel(Convert.ToInt32(filelistId)); if (fileMDL != null) { if (fileMDL.IsFolder) { bh = dal.GetBH(fileMDL.BH, SingleProjectId, fileMDL.recID.ToString()); } else { string Maxbh = dal.GetSingle("select MAX(bh) from t_filelist where singleprojectid=" + SingleProjectId + " and bh like '" + fileMDL.BH + "%' "); //最大编号 if (Maxbh == fileMDL.BH) { bh = string.Concat(Maxbh, "-", (1).ToString("D3")); } else { int LastIndex = Common.ConvertEx.ToInt(Maxbh.Substring(Maxbh.LastIndexOf("-") + 1)); string MaxIndex = Common.ConvertEx.ToInt(LastIndex + 1).ToString("D3"); bh = string.Concat(Maxbh.Substring(0, Maxbh.LastIndexOf("-") + 1), MaxIndex); } } } return(bh); }
private void UpdateSignatureStatus(string fileID, string pdfPath, HttpContext context) { string fileName = Path.GetFileName(pdfPath); if (!string.IsNullOrWhiteSpace(fileID) && !string.IsNullOrWhiteSpace(pdfPath)) { T_FileList_MDL fileList = fileBLL.GetModel(Convert.ToInt32(fileID)); if (fileList != null) { fileList.SIGNATURE_FLAG = true; fileList.SIGNATURE_DT = DateTime.Now.ToShortTimeString(); fileBLL.Update(fileList); } #region 增加个人签章保存 T_FileList_SignatureLog_BLL logBLL = new BLL.T_FileList_SignatureLog_BLL(); T_FileList_SignatureLog_MDL logMDL = new Model.T_FileList_SignatureLog_MDL(); logMDL.Signature_DT = DateTime.Now; logMDL.SignatureFinish_DT = null; logMDL.SingleProjectID = ConvertEx.ToInt(fileList.SingleProjectID); logMDL.FileListID = Common.ConvertEx.ToInt(fileList.FileListID); logMDL.FileListTmpID = Common.ConvertEx.ToInt(fileList.OldRecID); logMDL.Signature_UserID = Common.Session.GetSessionInt("UserID"); logMDL.Signature_UserRoleCode = Common.Session.GetSession("RoleCode"); logMDL.OperationType = SystemSet.EumSignatureOperationType.SignatureSave.ToString(); logMDL.Message = "联合签章-个人签章保存"; logBLL.Add(logMDL); #endregion } }
/// <summary> /// 绑定页面 /// </summary> /// <param name="ID"></param> private void BindPage(string ID) { if (!String.IsNullOrWhiteSpace(ID)) { T_FileList_MDL model = fileBLL.GetModel(Convert.ToInt32(ID)); if (model != null) { fileListID = ID; Comm.SetValueToPage(model, this.tbl); if (model.StartTime.Length < 1) { StartTime.Text = ""; } if (model.EndTime.Length < 1) { ENDTIME.Text = ""; } if (ConvertEx.ToInt(model.Status) < 1 && String.IsNullOrWhiteSpace(model.zrr)) { zrr.Text = Common.Session.GetSession("CompanyName"); } } } }
/// <summary> /// 上一条,下一条绑定文件信息 /// </summary> /// <param name="upOrDown"></param> private void BindPage(bool upOrDown) { T_FileList_MDL model = fileBLL.GetFileByPageIndex(fileListID, Common.Session.GetSession("FileInfostrWhere"), upOrDown); if (model != null) { fileListID = model.FileListID.ToString(); DigiPower.Onlinecol.Standard.Web.Comm.SetValueToPage(model, this.tbl); if (model.StartTime.Length < 1) { StartTime.Text = ""; } if (model.EndTime.Length < 1) { ENDTIME.Text = ""; } if (ConvertEx.ToInt(model.Status) < 1) { zrr.Text = Session["CompanyName"].ToString(); } } }
public string SignatureResetFlag(string fileListID) { string strMsg = string.Empty; if (!string.IsNullOrWhiteSpace(fileListID)) { T_FileList_MDL model = fileBLL.GetModel(Common.ConvertEx.ToInt(fileListID)); if (model != null) { if (!string.IsNullOrEmpty(model.RootPath) && !string.IsNullOrEmpty(model.PDFFilePath)) { if (GetSignatureLogCount(fileListID) < 1) //联合签章,则不重置 { ResetFile(model); strMsg = "success"; } else { strMsg = "已联合签章,不能重置!"; } } else { strMsg = "获取文件路径有误,请刷新页面后重试!"; } } else { strMsg = "获取文件信息失败,请刷新页面后重试!"; } } return(strMsg); }
protected void ResetFile(T_FileList_MDL model) { string mEFilePath = string.Empty, oMDPdir = string.Empty, mOrgEFilePath = string.Empty; oMDPdir = string.Concat(model.RootPath, model.SingleProjectID, "\\OMPDF\\"); mEFilePath = string.Concat(model.RootPath, model.SingleProjectID, "\\MPDF\\", model.PDFFilePath.Replace("/", @"\")); mOrgEFilePath = string.Concat(oMDPdir, model.PDFFilePath.Replace("/", @"\")); bool isUpdate = false; if (!Directory.Exists(oMDPdir)) { Directory.CreateDirectory(oMDPdir); System.IO.File.Copy(mEFilePath, mOrgEFilePath, true); } else { if (System.IO.File.Exists(mOrgEFilePath)) { System.IO.File.Copy(mOrgEFilePath, mEFilePath, true); } } model.SIGNATURE_FLAG = false; fileBLL.Update(model); }
public void UpdateFileOrderIndex(string fileListID, string OrderIndex) { T_FileList_MDL flMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); if (flMDL != null) { flMDL.MyOrderIndex = ConvertEx.ToInt(OrderIndex); fileListBLL.Update(flMDL); } }
public void UpdateFile(string fileListID, string remark, string mustSubmitFlag) { T_FileList_MDL fileMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); if (fileMDL != null) { fileMDL.Remark = remark; fileMDL.MustSubmitFlag = ConvertEx.ToBool(mustSubmitFlag); fileListBLL.Update(fileMDL); } }
/// <summary> /// 电子文件上传 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpLoad_Click(object sender, EventArgs e) { try { if (FileUpload1.HasFile) { string odocFilePath = string.Concat(Common.Common.EFileStartPath, SingleProjectID, "\\ODOC\\"); if (!System.IO.Directory.Exists(Common.Common.EFileStartPath)) { System.IO.Directory.CreateDirectory(Common.Common.EFileStartPath); } if (!System.IO.Directory.Exists(odocFilePath)) { System.IO.Directory.CreateDirectory(odocFilePath); } string fileNewName = Guid.NewGuid().ToString() + FileUpload1.FileName.Substring(FileUpload1.FileName.LastIndexOf('.'));; //电子文件存放全路径 string FileFullPath = odocFilePath + fileNewName; FileUpload1.SaveAs(FileFullPath); //保存原始文件 T_EFile_MDL model = new T_EFile_MDL(); model.PageCounts = 0; model.FileListID = Common.ConvertEx.ToInt(FileListID); model.FileType = 1; model.OrderIndex = GetEfileMaxOrderIndex(FileListID); model.Title = FileUpload1.FileName.Substring(0, FileUpload1.FileName.LastIndexOf('.')); model.RootPath = Common.Common.EFileStartPath; model.FilePath = fileNewName; model.FileType = 0; model.Status_Text = "上传成功,当晚批量计算页数!"; model.CREATE_DT = System.DateTime.Now.ToShortDateString(); model.CONVERT_FLAG = false; int ArchiveListCellRptID = efileBLL.Add(model); //更新文件级转换标志,等批量转换晚上转 T_FileList_MDL fileListMDL = filelistBLL.GetModel(model.FileListID); fileListMDL.CONVERT_FLAG = false; fileListMDL.RootPath = Common.Common.EFileStartPath; filelistBLL.Update(fileListMDL); BindGridView(AspNetPager.CurrentPageIndex); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_EFile;key=", ArchiveListCellRptID, ";SingleProjectID=", fileListMDL.SingleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title, "'案卷补录")); } } catch (Exception ex) { Common.LogUtil.Debug(this, "补卷-电子文件上传错误", ex); } }
public void UpdateFileOrderIndex(string fileListID, string OrderIndex) { T_FileList_MDL flMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); if (flMDL != null) { flMDL.OrderIndex = ConvertEx.ToInt(OrderIndex); fileListBLL.Update(flMDL); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_FileList;key=", fileListID, ";SingleProjectID=", flMDL.SingleProjectID, ";ArchiveID=", flMDL.ArchiveID, ";BH=", flMDL.BH, ";Title=", flMDL.Title, ";案卷管理-更新文件序号")); } }
public void DeleteFile(string fileListID) { T_FileList_MDL flMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); if (flMDL != null) { int tempArchiveID = ConvertEx.ToInt(flMDL.ArchiveID); flMDL.ArchiveID = 0; fileListBLL.Update(flMDL); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_FileList;key=", fileListID, ";SingleProjectID=", flMDL.SingleProjectID, ";ArchiveID=", tempArchiveID, ";BH=", flMDL.BH, ";Title=", flMDL.Title, ";案卷管理-拆文件")); } }
public bool DeleteFileList(string FileListID) { bool flag = false; T_FileList_BLL Bll = new T_FileList_BLL(); T_FileList_MDL Mdl = Bll.GetModel(ConvertEx.ToInt(FileListID)); if (Mdl != null && !Mdl.IsSystem) { Bll.Delete(ConvertEx.ToInt(FileListID)); PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_FileList;key=", FileListID, ";SingleProjectID=", Mdl.SingleProjectID, ";bh=", Mdl.BH, ";Title=", Mdl.Title)); flag = true; } return(flag); }
public bool DeleteFileList(string FileListID) { bool flag = false; T_FileList_MDL Mdl = fileListBLL.GetModel(ConvertEx.ToInt(FileListID)); if (Mdl != null && !Mdl.IsFolder) { fileListBLL.Delete(ConvertEx.ToInt(FileListID)); PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_FileList;key=", FileListID, ";SingleProjectID=", Mdl.SingleProjectID, ";FileListID=", FileListID, ";Title=", Mdl.Title, ";工程外观图删除")); flag = true; } return(flag); }
/// <summary> /// 检查文件对应的PDF文件是否存在 /// </summary> /// <param name="fileListID">文件ID</param> /// <returns></returns> public static bool CheckPdfFileExistsForFileListID(int fileListID) { bool existsFlag = false; T_FileList_BLL fileListBLL = new T_FileList_BLL(); T_FileList_MDL fileListMDL = fileListBLL.GetModel(fileListID); string pdfFilePath = Path.Combine(fileListMDL.RootPath, fileListMDL.SingleProjectID.ToString(), "MPDF", fileListMDL.PDFFilePath); if (System.IO.File.Exists(pdfFilePath)) { existsFlag = true; } return(existsFlag); }
public string MoveFileToFileTmp(string singleProjectID, string tempPdfFileName, string fileListTmpRecIDS) { string msg = string.Empty; try { IList <T_FileList_MDL> fileListMDL = fileBLL.GetZrsMoveFileRecID(singleProjectID, fileListTmpRecIDS); if (fileListMDL.Count > 0) { if (!Directory.Exists(string.Concat(Common.Common.EFileStartPath, singleProjectID, "\\MPDF\\"))) { Directory.CreateDirectory(string.Concat(Common.Common.EFileStartPath, singleProjectID, "\\MPDF\\")); } foreach (T_FileList_MDL mdl in fileListMDL) { string pdfNewFileName = Guid.NewGuid().ToString() + ".PDF"; string pdfOldFileName = mdl.PDFFilePath; if (System.IO.File.Exists(Server.MapPath("../Upload/TempReport/" + tempPdfFileName))) { System.IO.File.Copy(Server.MapPath("../Upload/TempReport/" + tempPdfFileName), string.Concat(Common.Common.EFileStartPath, singleProjectID, "\\MPDF\\" + pdfNewFileName), true); T_FileList_MDL tfMdl = fileBLL.GetModel(mdl.FileListID); if (tfMdl != null) { tfMdl.CONVERT_DT = DateTime.Now.ToString("yyyy-MM-dd"); tfMdl.CONVERT_FLAG = true; tfMdl.RootPath = Common.Common.EFileStartPath; tfMdl.PDFFilePath = pdfNewFileName; tfMdl.PagesCount = 1; tfMdl.ManualCount = 1; fileBLL.Update(tfMdl); } otherBLL.UpdateArchiveStatus(mdl.FileListID.ToString(), 10, "0"); //更新文件状态 //原PDF存在则删除 if (System.IO.File.Exists(string.Concat(Common.Common.EFileStartPath, singleProjectID, "\\MPDF\\" + pdfOldFileName))) { System.IO.File.Delete(string.Concat(Common.Common.EFileStartPath, singleProjectID, "\\MPDF\\" + pdfOldFileName)); } } } } msg = SystemSet._RETURN_SUCCESS_VALUE; } catch (Exception ex) { msg = SystemSet._RETURN_FAILURE_VALUE + ex.Message; } return(msg); }
public void SetFileListSignatureStatus(string fileListID, string iSignaturePdf, string iSignatureWorkFlow) { try { //注意:如果文件已开始顺签,后又混签,则没影响; 如果先混签,在设置为顺签,则有影响. 看是否需要过滤下如果文件已开始签章则不能更改 (是否按签章流程签章)标识 T_FileList_MDL fileListMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); if (fileListMDL != null) { fileListMDL.iSignaturePdf = ConvertEx.ToBool(iSignaturePdf); fileListMDL.iSignatureWorkFlow = ConvertEx.ToBool(iSignatureWorkFlow); fileListBLL.Update(fileListMDL); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_FileList;key=", fileListMDL.FileListID, ";SingleProjectID=", fileListMDL.SingleProjectID, ";bh=", fileListMDL.BH, ";iSignaturePdf=", iSignaturePdf, ";iSignatureWorkFlow=", iSignatureWorkFlow, ";Title=", fileListMDL.Title, ";文件登记页更新是否需要签章,是否按流程签章")); } } catch (Exception ex) { LogUtil.Debug(this, "文件登记归档目录保存操作", ex); } }
public string SignatureResetFlag(string fileListID) { string strMsg = string.Empty; if (!string.IsNullOrWhiteSpace(fileListID)) { T_FileList_MDL model = fileBLL.GetModel(Common.ConvertEx.ToInt(fileListID)); if (model != null) { if (!string.IsNullOrEmpty(model.RootPath) && !string.IsNullOrEmpty(model.PDFFilePath)) { ResetFile(model); signatureLogBLL.UpdateSignatureFinishFlag(true, Common.Session.GetSession("UserID"), Common.Session.GetSession("RoleCode"), model.FileListID.ToString()); #region 联合签章-个人签章重置 T_FileList_SignatureLog_MDL signatureLogMDL = new T_FileList_SignatureLog_MDL(); signatureLogMDL.Signature_DT = DateTime.Now; signatureLogMDL.SignatureFinish_DT = null; signatureLogMDL.SingleProjectID = ConvertEx.ToInt(model.SingleProjectID); signatureLogMDL.FileListID = Common.ConvertEx.ToInt(model.FileListID); signatureLogMDL.FileListTmpID = Common.ConvertEx.ToInt(model.OldRecID); signatureLogMDL.Signature_UserID = Common.Session.GetSessionInt("UserID"); signatureLogMDL.Signature_UserRoleCode = Common.Session.GetSession("RoleCode"); signatureLogMDL.OperationType = SystemSet.EumSignatureOperationType.SignatureReset.ToString(); signatureLogMDL.Message = "联合签章-个人签章重置"; signatureLogBLL.Add(signatureLogMDL); #endregion strMsg = SystemSet._RETURN_SUCCESS_VALUE; } else { strMsg = "获取文件路径有误,请刷新页面后重试!"; } } else { strMsg = "获取文件信息失败,请刷新页面后重试!"; } } return(strMsg); }
/// <summary> /// 格式化电子文件图标,文件级 /// </summary> /// <param name="fileListID">文件ID</param> /// <param name="singleProjectID">工程ID</param> /// <param name="bh">文件编号</param> /// <param name="isFolder">是否是目录级</param> /// <param name="imgSrc">null:默认pdf图标,其它为其它图标</param> /// <returns></returns> public static string getEfileImage(string fileListID, string singleProjectID, string bh, bool isFolder = true) { string strImage = " <img extFile=\"0\" style=\"cursor:pointer; border:0px;color:white;\" onclick=\"lookPDF(" + ConvertEx.ToInt(isFolder) + ",'" + bh + "'," + fileListID + "," + singleProjectID + ")\" src=\"../Javascript/Layer/image/EFILE.png\" alt=\"没有文件PDF\" />"; if (!isFolder) { T_FileList_BLL fileListBLL = new T_FileList_BLL(); T_FileList_MDL fileListMDL = fileListBLL.GetModel(ConvertEx.ToInt(fileListID)); string pdfFilePath = Path.Combine(fileListMDL.RootPath, fileListMDL.SingleProjectID.ToString(), "MPDF", fileListMDL.PDFFilePath); if (System.IO.File.Exists(pdfFilePath)) { strImage = " <img extFile=\"1\" style=\"cursor:pointer;border:0px;\" onclick=\"lookPDF(" + ConvertEx.ToInt(isFolder) + ",'" + bh + "'," + fileListID + "," + singleProjectID + ")\" src=\"../Javascript/Layer/image/EFILE_1.png\" alt=\"点击查看合并后的PDF\"/>"; } } return(strImage); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { int fileListID = DNTRequest.GetQueryInt("ID", 0); int singleProjectID = DNTRequest.GetQueryInt("SingleProjectID", 0); if (fileListID > 0 && singleProjectID > 0) { T_FileList_MDL fileListMDL = fileListBLL.GetModel(fileListID); DataTable tb = fileListBLL.GetList("SingleProjectID=" + singleProjectID + " and BH like 'S%' and RootPath !='' and (PID=" + fileListID + " or FileListID=" + fileListID + ")", "OrderIndex", true).Tables[0]; GetImageHTML(tb); } else { MessageBox.ShowAndCloseWin(this, "参数不正确!"); } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { int OperateUserID = Common.ConvertEx.ToInt(SingleProjectUsers.SelectValue); string OperateUserName = SingleProjectUsers.SelectText; List <String> ltKey = ctrlGridEx1.GetSelects(); if (OperateUserID > 0 && ltKey.Count > 0) { foreach (string Key in ltKey) { T_FileList_MDL Mdl = bll.GetModel(Common.ConvertEx.ToInt(Key)); if (Mdl != null) { Mdl.OperateUserID = OperateUserID; Mdl.OperateUserName = OperateUserName; bll.Update(Mdl); } } BindGridView(); } }
public void UpdateEFileIndex(string archiveListCellRptID, string OrderIndex) { T_EFile_MDL model = new T_EFile_MDL(); model = efileBLL.GetModel(ConvertEx.ToInt(archiveListCellRptID)); if (model != null) { model.OrderIndex = ConvertEx.ToInt(OrderIndex); efileBLL.Update(model); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_EFile;key=", model.ArchiveListCellRptID, ";FileListID=", model.FileListID, ";Title=", model.Title, ";案卷补录-更新电子文件序号")); T_FileList_MDL fileListMDL = filelistBLL.GetModel(model.FileListID); if (fileListMDL != null) { fileListMDL.CONVERT_FLAG = false; //重新转换PDF filelistBLL.Update(fileListMDL); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Request.ContentEncoding = Encoding.GetEncoding("UTF-8"); context.Response.ContentEncoding = Encoding.GetEncoding("UTF-8"); context.Response.Charset = "utf-8"; string pid = Common.DNTRequest.GetQueryString("ID");//组ID string SingleProjectID = string.Empty; string BH = string.Empty; T_FileList_MDL filelistMDL = filelistBLL.GetModel(ConvertEx.ToInt(pid)); if (filelistMDL != null) { SingleProjectID = filelistMDL.SingleProjectID.ToString(); BH = filelistMDL.BH; } HttpPostedFile file = context.Request.Files["Filedata"]; string uploadPath = string.Concat(Common.Common.EFileStartPath, "\\SXImage\\", SingleProjectID + "\\"); if (file != null) { if (!Directory.Exists(uploadPath)) { Directory.CreateDirectory(uploadPath); } string thumbFilePath = string.Concat(uploadPath, "\\thumb\\"); if (!Directory.Exists(thumbFilePath)) { Directory.CreateDirectory(thumbFilePath); } string fileName = PublicModel.UpLoadImage1(file, uploadPath, thumbFilePath, 200, 140); if (fileName.IndexOf("Error") < 0)//表示文件上传成功 { InSertFile(pid, BH, SingleProjectID, fileName, uploadPath); } //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失 context.Response.Write("1"); } else { context.Response.Write("0"); } }
public void UpdateEFileIndex(string archiveListCellRptID, string OrderIndex) { T_EFile_MDL model = new T_EFile_MDL(); model = eFileBLL.GetModel(ConvertEx.ToInt(archiveListCellRptID)); if (model != null) { model.OrderIndex = ConvertEx.ToInt(OrderIndex); eFileBLL.Update(model); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_EFile;key=", model.ArchiveListCellRptID, ";FileListID=", model.FileListID, ";Title=", model.Title, ";电子文件排序编号")); T_FileList_MDL fileListMDL = fileListBLL.GetModel(model.FileListID); if (fileListMDL != null) { fileListMDL.CONVERT_FLAG = false; //重新转换PDF,按照新的电子文件顺序 fileListMDL.Version = PublicModel.getFileVersion(fileListMDL.SingleProjectID.ToString()); fileListBLL.Update(fileListMDL); } } }
public string GetFilePath(string id) { string mEFilePath = string.Empty, oMDPdir = string.Empty, mOrgEFilePath = string.Empty; T_FileList_BLL bll = new T_FileList_BLL(); T_FileList_MDL model = bll.GetModel(Common.ConvertEx.ToInt(id)); if (model != null) { if (!string.IsNullOrEmpty(model.RootPath) && !string.IsNullOrEmpty(model.PDFFilePath)) { //string LastPath = model.RootPath.Substring(0, model.RootPath.Length - 1); //int iPos1 = LastPath.LastIndexOf('\\'); //LastPath = LastPath.Substring(iPos1 + 1); //string mHttpUrl = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + LastPath; oMDPdir = string.Concat(model.RootPath, singleProjectID, "\\OMPDF\\"); mEFilePath = string.Concat(model.RootPath, singleProjectID, "\\MPDF\\", model.PDFFilePath.Replace("/", @"\")); mOrgEFilePath = string.Concat(oMDPdir, model.PDFFilePath.Replace("/", @"\")); if (!Directory.Exists(oMDPdir)) { Directory.CreateDirectory(oMDPdir); } if (System.IO.File.Exists(mEFilePath)) { if (Common.DNTRequest.GetQueryString("action") != "view") { System.IO.File.Copy(mEFilePath, mOrgEFilePath, true); } } } else { Common.MessageBox.ShowAndCloseWin(this, "没有文件,无法查看!"); } } return(mEFilePath); }
private void UpdateFile(string singleProjectID, string fileListID, string newFileName, string oldFileName) { T_EFile_MDL model = new T_EFile_MDL(); model.PageCounts = 0;// PDFcount; model.FileListID = Common.ConvertEx.ToInt(fileListID); model.FileType = 1; model.OrderIndex = GetEfileMaxOrderIndex(fileListID); model.Title = oldFileName.Substring(0, oldFileName.LastIndexOf('.')); model.RootPath = Common.Common.EFileStartPath;//记信根目录即可 model.FilePath = newFileName; model.FileType = 0; model.Status_Text = "上传成功,当晚批量计算页数!"; model.CREATE_DT = System.DateTime.Now.ToShortDateString(); model.CONVERT_FLAG = false; T_EFile_BLL bll = new T_EFile_BLL(); int archiveListCellRptID = bll.Add(model); //更新文件级转换标志,等批量转换晚上转 T_FileList_MDL fileListMDL = fileListBLL.GetModel(model.FileListID); fileListMDL.CONVERT_FLAG = false; fileListMDL.RootPath = Common.Common.EFileStartPath; fileListMDL.Version = PublicModel.getFileVersion(fileListMDL.SingleProjectID.ToString()); fileListBLL.Update(fileListMDL); BLL.T_Other_BLL otherBLL = new DigiPower.Onlinecol.Standard.BLL.T_Other_BLL(); otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0"); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_EFile;key=", archiveListCellRptID, ";SingleProjectID=", singleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title)); }