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

📄 docdetail.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
/******************************************************************
*  Source File Name  : DocDetail                                  *
*  Project Name:   OI.csproj				                      *
*  Engineer:  黎斌                                                *
*  Date Generated: 2004/1/9                                       *
*  Last Revision Date :											  *
*  Brief Description  : 待发送公文详细信息						  *
******************************************************************/

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.SendMessage
{
	/// <summary>
	/// DocDetail 的摘要说明。
	/// </summary>
	public class DocDetail : OI.PageBase
	{
		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 PDocumentID;

		public string displaychangeuser="";
		
		public string mWord;
		public string mExcel;
		protected System.Web.UI.WebControls.Panel Panel1;

		//******************************************************************  add by 黎斌
		protected System.Web.UI.WebControls.Label Lbl_DraftDepartment;
		protected System.Web.UI.WebControls.Label Lbl_SendDepartment;
		protected System.Web.UI.WebControls.Label Lbl_DocumentType;
		protected System.Web.UI.WebControls.Label Lbl_DocumentTypeName;
		protected System.Web.UI.WebControls.Label Lbl_SecretGreadName;
		protected System.Web.UI.WebControls.Label Lbl_ExigenceDegreeName;
		protected System.Web.UI.WebControls.Label Lbl_MainSendComp;
		protected System.Web.UI.WebControls.Label Lbl_CopySendComp;
		protected System.Web.UI.WebControls.Label Lbl_StreamName;
		protected System.Web.UI.WebControls.Label Lbl_Title;
		protected System.Web.UI.WebControls.Label Lbl_Author;
		protected System.Web.UI.WebControls.Label Lbl_Time;
		protected System.Web.UI.WebControls.Label Lbl_Content;
		protected OI.DatabaseOper.DatabaseConnect oConn = new OI.DatabaseOper.DatabaseConnect();
		private System.Data.DataSet dsDocument;
		private OI.cs.readStream oReadStream = new OI.cs.readStream();
		private string szSql;
		private string szNodeName;
		private int nDoc;
		//*****************************************************************

		public int NDoc 
		{
			set
			{
				nDoc=value;
			}
			get{
				return nDoc;
			}
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			//******************************************  modified by 黎斌
			if (Session["userid"]==null)
			{
				Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
				return ;
			}
			
			//****************************************************************

			//********************************************************************************************* modified by 黎斌
			//get the document's detail infomation
			 nDoc=int.Parse (Request.QueryString["DocumentID"].ToString());
			if(Request.QueryString ["type"]=="send")
			{
              displaychangeuser="";
			}
			else
			{  
				displaychangeuser ="<IMG height=21 src='../images/button_left.gif' width='5' border='0'></TD><TD class=button   noWrap background='../images/button_bg.gif'>";
				displaychangeuser +="<a href='#' onclick =OpenFind('../stream/changeusers.aspx?DocumentID="+ NDoc +"')>更换下一节点处理人员</a>";
				displaychangeuser +="</TD><TD width=14><IMG height=21 src='../images/button_right.gif' width=5 border=0>";
				//displaychangeuser="<a href='../desktop/StreamDetail.aspx?DocumentID="+ NDoc +"'><img src=../images/viewnew.gif border=0></a>";
			}
			//Response.Write("<script>var NDoc="+nDoc+"</script>");
			szSql = "select * from VIEWdocument where DocumentID=" + nDoc;
			dsDocument = oConn.getBinding(szSql,"Temp");

			Lbl_DraftDepartment.Text	 = dsDocument.Tables["Temp"].Rows[0]["DraftDepartment"].ToString();
			Lbl_SendDepartment.Text		 = dsDocument.Tables["Temp"].Rows[0]["SendDepartment"].ToString();
			Lbl_DocumentType.Text		 = dsDocument.Tables["Temp"].Rows[0]["DocumentTypeDescription"].ToString();
			Lbl_DocumentTypeName.Text	 = dsDocument.Tables["Temp"].Rows[0]["DocumentTypeName"].ToString();
			Lbl_SecretGreadName.Text	 = dsDocument.Tables["Temp"].Rows[0]["SecretGreadName"].ToString();
			Lbl_ExigenceDegreeName.Text	 = dsDocument.Tables["Temp"].Rows[0]["ExigenceDegreeName"].ToString();
			Lbl_MainSendComp.Text		 = dsDocument.Tables["Temp"].Rows[0]["MainSendComp"].ToString();
			Lbl_CopySendComp.Text		 = dsDocument.Tables["Temp"].Rows[0]["CopySendComp"].ToString();
			Lbl_StreamName.Text			 = dsDocument.Tables["Temp"].Rows[0]["StreamName"].ToString();
			Lbl_Title.Text				 = dsDocument.Tables["Temp"].Rows[0]["Title"].ToString();
			Lbl_Author.Text				 = dsDocument.Tables["Temp"].Rows[0]["Author"].ToString();
			Lbl_Time.Text				 = dsDocument.Tables["Temp"].Rows[0]["FileDate"].ToString();

			
			szSql = "select * from VIEWDocumentTransact where DocumentID='" +nDoc+"'" ;
			dsDocument = oConn.getBinding(szSql,"Temp");

			oReadStream.doucmentID = nDoc;//appoint stream by the document ID
			Lbl_Content.Text = "";
			foreach (DataRow dr in dsDocument.Tables["Temp"].Rows)
			{
				szNodeName = oReadStream.GetNodeTypeByID(dr["StepID"].ToString());
				if (dr["Idea"].ToString().Trim() != "" && dr["Idea"] != null)
				{
					Lbl_Content.Text += "<tr width=\"100%\">";
					Lbl_Content.Text += "<td width=\"20%\" align=right>工作流节点名称:</td>";
					Lbl_Content.Text += "<td width=\"20%\"> &nbsp;" + szNodeName + "</td>";
					Lbl_Content.Text += "<td width=\"10%\" align=right>处理人:</td>";
					Lbl_Content.Text += "<td width=\"20%\"> &nbsp;" + dr["UserName"].ToString() + "</td>";
					//				Lbl_Content.Text += "<td></td>";
					Lbl_Content.Text += "</tr>";
					Lbl_Content.Text += "<tr bgcolor=FloralWhite>";
					Lbl_Content.Text += "<td width=\"10%\" align=right>处理意见:</td>";
					Lbl_Content.Text += "<td width=\"90%\" colspan=3>&nbsp;" + dr["Idea"].ToString() + "</td>";
					Lbl_Content.Text += "</tr>";
				}
			}
			//************************************************************************************************************

			// 在此处放置用户代码以初始化页面
			

			mHTMLPath="";
			mDisabled="";
			mScriptName="documentdetail.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;

			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="0";		// 0 查看
			}
			if((mEditType=="0") || (mEditType=="1"))
			{
				Panel1.Visible=false;//在起草和显示时不显示左边的工具栏 
			}
			//取得类型
			if ( mFileType==null)
			{
				mFileType=".doc";	// 默认为.doc文档
			}
			//取得用户名
			if (mUserName==null)
			{
				mUserName="成都派尔科技有限公司";
			}			

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

			//打开数据库
			string strSelectCmd="Select * From view_document Where documentid="+ nDoc ;//: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 = mCommand.ExecuteReader(CommandBehavior.CloseConnection);
			
			if (mReader.Read())
			{
				mRecordID=mReader["RecordID"].ToString();
				mTemplate=mReader["Template"].ToString() ;
				mSubject=mReader["Subject"].ToString();
				mAuthor=Session["UserName"].ToString();
				mFileDate=mReader["FileDate"].ToString();
				mStatus=mReader["Status"].ToString();
				mFileType=mReader["FileType"].ToString();
				mHTMLPath=mReader["HTMLPath"].ToString() ;
				PTitle=mReader["Title"].ToString() ;
				PSendDate=mReader["SendDate"].ToString() ;
				Psecretgreadname=mReader["secretgreadname"].ToString() ;
				Pdocumenttypename=mReader["documenttypename"].ToString() ;
				Pexigencedegreename=mReader["exigencedegreename"].ToString() ;
			}
			else
			{
				System.DateTime SystemTime;
				SystemTime=DateTime.Now;

				mRecordID=SystemTime.ToString("yyyyMMddhhmmss");
				mTemplate=mTemplate;
				mSubject="请输入主题";
				mAuthor=mUserName;
				mFileDate=oConn.GetDateTime();
				mStatus="DERF";
				mFileType=mFileType;
				mHTMLPath="";
			}
			mReader.Close();

			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=="3")
//			{
//				mEditType="1";
//			}
//			

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

			mFileName=mRecordID + mFileType;
			if (mFileType==".doc")
			{
				mWord="";
				mExcel="disabled";
			}
			else
			{
				mWord="disabled";
				mExcel="";
			}

		}


		#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

		//		private void LB_Stream_Click(object sender, System.EventArgs e)
		//		{
		//			Response.Redirect("../desktop/StreamDetail.aspx",true);
		//		}
	}
}

⌨️ 快捷键说明

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