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

📄 savedocument.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.ReFileOperate
{
	/// <summary>
	/// documentdetail 的摘要说明。
	/// </summary>
	public class savedocument : 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 ;

		//
		protected OI.DatabaseOper.DatabaseConnect oConn = new OI.DatabaseOper.DatabaseConnect();
		
		public string mWord;
		public string mExcel;
		protected System.Web.UI.WebControls.Panel Panel1;
		//		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="documentdetail.aspx";
			mServerName="OfficeServer.aspx";
			mClientName="iWebOffice2003.ocx#version=1,0,0,0";
			//			mScriptName="DocumentEdit.aspx";
			//			mServerName="OfficeServer.aspx";
			//			mClientName="FairyWebOfficeOcx.ocx";
			mHttpUrl="http://" + Request.ServerVariables["HTTP_HOST"] + Request.ServerVariables["SCRIPT_NAME"];
			mHttpUrl=mHttpUrl.Substring(0,mHttpUrl.Length -mScriptName.Length);
			mServerUrl="http://"+Request.ServerVariables["HTTP_HOST"] +Request.ApplicationPath+"/DocTemplate/" + mServerName;
			mClientUrl=mHttpUrl + mClientName;
	        
			mRecordID=Request.QueryString["documentid"];  //:pf modify here by  2003.12.11 11:05
			mRecordID="108";
			//			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="1";		// 1 起草
			}
			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="+ 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 = 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.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
	}
}

⌨️ 快捷键说明

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