⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disptransact.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
using System; 
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace OI.Document
{
	/// <summary>
	/// dispTransact 的摘要说明。
	/// </summary>
	public class dispTransact : OI.PageBase
	{
		//*********************************************************************** modified by lb 12.19
		public string mSubject;
		public string mStatus;
		public string mAuthor;
		public string mFileName;
		public string mFileDate;
		public string mHTMLPath;
        
		public string mDisabled;

		public string mHttpUrl;
		public string mScriptName;
		public string mServerName;
		public string mClientName;
		public string mServerUrl;
		public string mClientUrl;


		public string mRecordID;
		public string mTemplate;
		public string mFileType;
		public string mEditType;
		public string mUserName;
		//
		public string  PTitle;
		public string PSendDate;
		public string Psecretgreadname;
		public string Pdocumenttypename ;
		public string Pexigencedegreename ;
		public string PCuenceNodeId;
		public string PdocumentID;
        public string CurrentNode;
		public string displayTransfer="";
		public string drawman;
		//
		public string Lbl_Content;
		protected OI.DatabaseOper.DatabaseConnect oConn = new OI.DatabaseOper.DatabaseConnect();
		
		public string mWord;
		public string mExcel;
		protected System.Web.UI.WebControls.Panel Panel1;
        public string normalcontent="";
		

		//		private void GetInformation()
		//		{
		//			Request.QueryString ["documentid"].ToString ();
		//		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (Session["userid"]==null)
			{
				Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
				return ;
			}
			// 在此处放置用户代码以初始化页面
			

			mHTMLPath="";
			mDisabled="";
			mScriptName="dispTransact.aspx";
			mServerName="WebDocServer.aspx";
			mClientName="../FairyWebOfficeocx.ocx";
			
			mHttpUrl="http://" + Request.ServerVariables["HTTP_HOST"] + Request.ServerVariables["SCRIPT_NAME"];
			mHttpUrl=mHttpUrl.Substring(0,mHttpUrl.Length -mScriptName.Length);
			if(System.Web.HttpRuntime.AppDomainAppVirtualPath=="")
				mServerUrl="http://"+Request.ServerVariables["HTTP_HOST"] +"/DocTemplate/" + mServerName;
			else
				mServerUrl="http://"+Request.ServerVariables["HTTP_HOST"] +System.Web.HttpRuntime.AppDomainAppVirtualPath+"/DocTemplate/" + mServerName;
			mClientUrl=mHttpUrl + mClientName;
	        
			mRecordID=Request.Params["documentid"];  //:pf modify here by  2003.12.11 11:05
			int documnetid=int.Parse (mRecordID);
//			mRecordID="113";
			//			mRecordID=Request.QueryString["RecordID"];
			mTemplate=Request.QueryString["Template"];
			mFileType=Request.QueryString["FileType"];
			mEditType=Request.QueryString["EditType"];
			mUserName=Session["UserName"].ToString();
//			mEditType="0";
			//取得编号
			if ( mRecordID==null)
			{
				mRecordID="";	//编号为空
			}
			//取得模式
			if ( mEditType==null)
			{
				mEditType="2";		// 1 起草,3 修改 edit by lb by 2004.1.4
			}
			if((mEditType=="0") || (mEditType=="1"))
			{
				Panel1.Visible=false;//在起草和显示时不显示左边的工具栏 
			}

			Panel1.Visible=true;//modified by lb by 12.25


			//取得类型
			if ( mFileType==null)
			{
				mFileType=".doc";	// 默认为.doc文档
			}
			//取得用户名
			if (mUserName==null)
			{
				mUserName="成都派尔科技有限公司";
			}
			
			

			//取得模板
			if ( mTemplate==null)
			{
				mTemplate="";	// 默认没有模板
			}

			//打开数据库
			string strSelectCmd="Select * From view_document Where documentid="+ mRecordID ;//:pf modify here by  2003.12.11 11:05
			//string strSelectCmd="Select * From Document Where RecordID='"+ mRecordID + "'";
			SqlCommand mCommand = new SqlCommand(strSelectCmd,oConn.GetConn());//更改
			SqlDataReader mReader =null;
				mReader=mCommand.ExecuteReader(CommandBehavior.CloseConnection);
			
				if (mReader.Read())
				{
					try
					{
						OI.cs.streamtime st=new OI.cs.streamtime ();
						PSendDate=st.GetPrivTransactTime (int.Parse (mRecordID)); //返回到达时间
					}
					catch(Exception er)
					{
						Response.Write (er.Message );
					}
					mRecordID=mReader["RecordID"].ToString();
					mTemplate=mReader["Template"].ToString() ;
					mSubject=mReader["Subject"].ToString();
					mAuthor=mReader["drawman"].ToString();
					mFileDate=mReader["FileDate"].ToString();
					mStatus=mReader["Status"].ToString();
					mFileType=mReader["FileType"].ToString();
					mHTMLPath=mReader["HTMLPath"].ToString() ;
					PTitle=mReader["Title"].ToString() ;
					drawman=mReader["drawman"].ToString() ;
				//	PSendDate=mReader["SendDate"].ToString() ;
					
					Psecretgreadname=mReader["secretgreadname"].ToString() ;
					Pdocumenttypename=mReader["documenttypename"].ToString() ;
					Pexigencedegreename=mReader["exigencedegreename"].ToString() ;
					PCuenceNodeId=mReader["CurrentStepID"].ToString();
					PdocumentID=mReader["DocumentID"].ToString();
					CurrentNode=mReader["CurrentStepID"].ToString ();
					mReader.Close();
				}
				else
				{
					mReader.Close();
					System.DateTime SystemTime;
					SystemTime=DateTime.Now;

					mRecordID=SystemTime.ToString("yyyyMMddhhmmss");
					mTemplate=mTemplate;
					mSubject="请输入主题";
					mAuthor=mAuthor;
					mFileDate=oConn.GetDateTime();
					mStatus="DERF";
					mFileType=mFileType;
					mHTMLPath="";
				} 
			
			if ( mStatus.CompareTo("EDIT")==0 ) mEditType="0";	//	0 显示
			if ( mStatus.CompareTo("READ")==0 ) mEditType=mEditType; 	// 	
			if ( mStatus.CompareTo("DERF")==0 ) mEditType="1" ;	//	1 起草

			if ( mEditType.CompareTo("0")==0)
			{
				mDisabled="disabled";
			}
			else
			{
				mDisabled="";
			}

			mFileName=mRecordID + mFileType;
			if (mFileType==".doc")
			{
				mWord="";
				mExcel="disabled";
			}
			else
			{
				mWord="disabled";
				mExcel="";
			}
            OI.cs .readStream rs=new OI.cs.readStream ();
			rs.doucmentID =documnetid;
			string nodetype=rs.GetNodeTypeByID (CurrentNode);
			if (nodetype=="公文校核")
			{
				displayTransfer="<input type=button value=\"转交给其它审核者\" class=input onclick=getTitle()>";
			}
			else
			{
			}
			string sqlcontent= "select * from personcontent where userid="+Session["userid"].ToString ();
			DataTable dt=oConn.getBinding (sqlcontent,"t").Tables [0];
			normalcontent="<option selected value='-1'>无</option>";
			foreach (DataRow dr in dt.Rows )
			{
				normalcontent +="<option value='"+dr["personcontent"].ToString ()+"'>"+dr["personcontent"].ToString ()+"</option>";
			}
			//修改人:wugaofa  2004-1-12
			//显示已处理人的意见  
			int nDoc=Convert.ToInt32 (Request.QueryString["DocumentID"].ToString());
			//int nDoc=int.Parse (mRecordID);
			string szSql = "select v.StepID,a.userid,v.Idea,v.ManageID,departmentname from VIEWDocumentTransact  v inner join accounts_users a on v.UserName=a.UserName  where DocumentID='" +nDoc+"'" ;
			
			DataSet dsDocument = oConn.getBinding(szSql,"Temp");

            OI.cs.readStream oReadStream = new OI.cs.readStream();
			oReadStream.doucmentID = nDoc;//appoint stream by the document ID
	
			string szNodeName="";
			foreach (DataRow dr in dsDocument.Tables["Temp"].Rows)
			{
				szNodeName = oReadStream.GetNodeTypeByID(dr["StepID"].ToString());
				string userid=dr["userid"].ToString();
				
				OI.cs.personalSign sign=new OI.cs.personalSign ();
				sign.UserID =int.Parse (userid);
				string displaySign=sign.Displayimg(true);
                string departmentname=dr["departmentname"].ToString ();
 
				if (true)//dr["Idea"].ToString().Trim() != "" && dr["Idea"] != null)
				{
					
					Lbl_Content += "<tr align=left>";
					Lbl_Content += "<td   width='20%' align=right>工作流节点名称:</td>";
					Lbl_Content += "<td width='15%'>&nbsp;" + szNodeName + "</td>";
					Lbl_Content += "<td   width='15%' align=right >处理人:</td>";
					if(szNodeName.Trim ()=="公文起草" || szNodeName.Trim ()=="公文中转") 
					{
						Lbl_Content += "<td width='20%'>&nbsp;" + mAuthor + "</Td><td width=30%>部门:"+departmentname  +"</td>";	
						Lbl_Content += "</tr>";
					}
					else
					{
						if ( szNodeName.Trim ()=="公文中转")
						{

							Lbl_Content += "<td width='20%'>&nbsp;" + dr["username"].ToString () + "</Td><td width=30%>部门:"+departmentname  +"</td>";	
							Lbl_Content += "</tr>";
						}
						else 
						{
							Lbl_Content += "<td width='20%'>&nbsp;" + displaySign +  "</Td><td width=30%>部门:"+departmentname  +"</td>";
					 
							//				Lbl_Content += "<td></td>";
							Lbl_Content += "</tr>";

							Lbl_Content += "<tr bgcolor=#fffaf0>";
					

							Lbl_Content += "<td align=right >处理意见:</td>";
							Lbl_Content += "<td colspan=2 style=\"word-wrap:break-word;\" >&nbsp;" + dr["Idea"].ToString().Replace("\r\n","<br>")+ "</td>";

							string doType="";
							if(dr["ManageID"].ToString ().Trim ()=="1")
								doType="同意";
							else
							{
								if(dr["ManageID"].ToString ().Trim ()=="4")
								{
									doType="中转";
								}
								else
								{
									doType="退回";
								}
							}
							Lbl_Content +="<td  align=right >处理类型:</td>";
							Lbl_Content +="<td >&nbsp;"+doType+"</td>";
					
							Lbl_Content += "</tr>";
						}
					}
				}
			}

		}
		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -