📄 transactdocument.aspx.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.transferDocument
{
/// <summary>
/// transactdocument 的摘要说明。
/// </summary>
public class transactdocument : System.Web.UI.Page
{
// 在此处放置用户代码以初始化页面
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 Lbl_Content;
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 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_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_Time;
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;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
private int nDoc;
// private string userid;
//*****************************************************************
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
szSql = "select * from VIEWdocument where DocumentID=" + Request.QueryString["DocumentID"].ToString();
dsDocument = oConn.getBinding(szSql,"Temp");
if ( dsDocument.Tables ["Temp"].Rows .Count <=0)
{
Response.Write (szSql);
Response.Write ("<br/>请告诉管理员");
Response.End ();
}
Lbl_DraftDepartment.Text = dsDocument.Tables["Temp"].Rows[0]["DrawMan"].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_StreamName.Text = dsDocument.Tables["Temp"].Rows[0]["StreamName"].ToString();
Lbl_Title.Text = dsDocument.Tables["Temp"].Rows[0]["Title"].ToString();
Lbl_Time.Text = dsDocument.Tables["Temp"].Rows[0]["FileDate"].ToString();
nDoc=int.Parse (Request.QueryString["DocumentID"].ToString());
PdocumentID=nDoc.ToString ();
szSql = "select v.stepID,a.userid,a.username,v.idea,v.ManageID,departmentname from VIEWDocumentTransact v inner join accounts_Users a on v.username=a.username where DocumentID='" +nDoc+"'" ;
dsDocument = oConn.getBinding(szSql,"Temp");
oReadStream.doucmentID = nDoc;//appoint stream by the document ID
// int i=0;
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%'> " + szNodeName + "</td>";
Lbl_Content += "<td width='15%' align=right >处理人:</td>";
if(szNodeName.Trim ()=="公文起草" )
{
Lbl_Content += "<td width='20%'> " + Lbl_DraftDepartment.Text + "</Td><td width=30%>部门:"+departmentname +"</td>";
Lbl_Content += "</tr>";
}
else
{
if ( szNodeName.Trim ()=="公文中转")
{
Lbl_Content += "<td width='20%'> " + dr["username"].ToString () + "</Td><td width=30%>部门:"+departmentname +"</td>";
Lbl_Content += "</tr>";
}
else
{
Lbl_Content += "<td width='20%'> " + 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;\"> " + 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 > "+doType+"</td>";
Lbl_Content += "</tr>";
}
}
}
}
//************************************************************************************************************
// 在此处放置用户代码以初始化页面
mHTMLPath="";
mDisabled="";
mScriptName="transactdocument.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();
//取得编号
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() ;
mReader.Close();
}
else
{
mReader.Close();
System.DateTime SystemTime;
SystemTime=DateTime.Now;
mRecordID=SystemTime.ToString("yyyyMMddhhmmss");
mTemplate=mTemplate;
mSubject="请输入标题";
mAuthor=mUserName;
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 起草
//mEditType = "0";//modified by 黎斌
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 + -