DocumentList.aspx.cs
上传用户:hbbfjy2008
上传日期:2015-02-05
资源大小:5616k
文件大小:5k
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using System.Data.SqlClient;
- namespace iWebOffice.ocx.c.net
- {
- /// <summary>
- /// DocumentList 的摘要说明。
- /// </summary>
- public class DocumentList : System.Web.UI.Page
- {
- iDBManage2000 DBAobj;
- private void Page_Load(object sender, System.EventArgs e)
- {
- // 在此处放置用户代码以初始化页面
- DBAobj=(iDBManage2000)Session["DBDemo"];
- }
- //列出所有模版
- public string GetTemplateList(string ObjType,string FileType)
- {
- string mTemplateList;
- mTemplateList="<select name=" + ObjType + ">" ;
- mTemplateList+="<option value=''>------不用模版------</option>";
- string strSelectCmd="select RecordID,Descript from Template_File where FileType='" + FileType + "'";
- SqlCommand mCommand = new SqlCommand(strSelectCmd,DBAobj.Connection);
- SqlDataReader mReader = mCommand.ExecuteReader();
-
- while (mReader.Read())
- {
- mTemplateList+="<option value='" + mReader["RecordID"].ToString() + "'>" + mReader["Descript"].ToString() + "</option>";
- }
- mReader.Close();
- mTemplateList+="</select>";
- return (mTemplateList);
- }
- public string GetTableContent()
- {
- string mTableContent="";
- string strSelectCmd="select * from Document order by DocumentID desc";
- SqlCommand mCommand = new SqlCommand(strSelectCmd, DBAobj.Connection);
- SqlDataReader mReader = mCommand.ExecuteReader();
- while(mReader.Read())
- {
-
- mTableContent+="<tr>";
- mTableContent+="<td class=TDStyle>"+mReader["DocumentID"].ToString() +" </td>n";
- mTableContent+="<td class=TDStyle>"+mReader["Subject"].ToString()+" </td>n";
- mTableContent+="<td class=TDStyle>"+mReader["Author"].ToString()+" </td>n";
- mTableContent+="<td class=TDStyle>"+mReader["FileType"].ToString()+" </td>n";
- mTableContent+="<td class=TDStyle>"+mReader["FileDate"].ToString()+" </td>n";
- mTableContent+="<td class=TDStyle nowrap>n";
- mTableContent+="<input type=button onclick="javascript:location.href='DocumentEdit.aspx?RecordID="+mReader["RecordID"].ToString() +"&EditType=0,0&ShowType=1&UserName='+username.value;" value="阅读">n";
- mTableContent+="<input type=button ";
- if (mReader["Status"].ToString().Equals("EDIT"))
- {
- mTableContent+=" disabled ";
- }
- mTableContent+="onclick="javascript:location.href='DocumentEdit.aspx?RecordID="+mReader["RecordID"].ToString() +"&EditType=1,1&ShowType=1&UserName='+username.value;" value="修改[无痕迹]">n";
- mTableContent+="<input type=button ";
- if (mReader["Status"].ToString().Equals("EDIT"))
- {
- mTableContent+=" disabled ";
- }
- mTableContent+="onclick="javascript:location.href='DocumentEdit.aspx?RecordID="+mReader["RecordID"].ToString() +"&EditType=2,1&ShowType=1&UserName='+username.value;" value="修改[有痕迹]">n";
- mTableContent+="<input type=button ";
- if (mReader["Status"].ToString().Equals("EDIT"))
- {
- mTableContent+=" disabled ";
- }
- mTableContent+="onclick="javascript:location.href='DocumentEdit.aspx?RecordID="+mReader["RecordID"].ToString() +"&EditType=3,1&ShowType=2&UserName='+username.value;" value="领导手写">n";
- mTableContent+="<input type=button ";
- if (mReader["Status"].ToString().Equals("EDIT"))
- {
- mTableContent+=" disabled ";
- }
- mTableContent+="onclick="javascript:location.href='DocumentEdit.aspx?RecordID="+mReader["RecordID"].ToString() +"&EditType=3,0&ShowType=0&UserName='+username.value;" value="审核">n";
- mTableContent+="<input type=button ";
- if (mReader["HTMLPath"].ToString().Equals(""))
- {
- mTableContent+=" disabled ";
- }
- mTableContent+="onclick="javascript:window.open('" + mReader["HTMLPath"].ToString() +"');" value="HTML">n";
- mTableContent+="</td>n";
- mTableContent+="</tr>n";
- }
- mReader.Close();
- return (mTableContent);
- }
- #region Web Form Designer generated code
- 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
- }
- }