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

📄 recordfilelistview.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
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;

namespace OI.recordFile
{
	/// <summary>
	/// recordFileListView 的摘要说明。
	/// </summary>
	public class recordFileListView : OI.PageBase
	{
		protected System.Web.UI.WebControls.Label LabelTitle;
		protected System.Web.UI.WebControls.Label LabelSendComp;
		protected System.Web.UI.WebControls.Label LabelMainSendComp;
		protected System.Web.UI.WebControls.Label LabelCopySendComp;
		protected System.Web.UI.WebControls.Label LabelSecretGreadID;
		protected System.Web.UI.WebControls.Label LabelDocumentTypeID;
		protected System.Web.UI.WebControls.Label LabelExigenceDegreeID;
		protected System.Web.UI.WebControls.Label LabelDocumentHead;
		protected System.Web.UI.WebControls.Label LabelDocumentNumber;
		protected System.Web.UI.WebControls.Label LabelTopicWord;
	    protected int RecordFileID;
		protected System.Web.UI.WebControls.Label LabelRecordDate;
		protected System.Web.UI.WebControls.Label LabelUsername;
		protected System.Web.UI.WebControls.Label LabelInputDate;
		protected OI.DatabaseOper .DatabaseConnect Dbc=new OI.DatabaseOper.DatabaseConnect ();
		protected System.Web.UI.WebControls.Label LabelContent;
		protected System.Web.UI.WebControls.ImageButton ImageButton1;
		protected System.Web.UI.WebControls.ImageButton ImageButtonOpen;
		protected System.Web.UI.WebControls.Table TableIdeas;
		protected OI.PageBase PB=new PageBase() ;
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			//ImageButton1.Attributes ["onclick"]="history.go(-1);";
			if (!Page.IsPostBack )
			{
				try
				{   
					RecordFileID=int.Parse(Request.QueryString ["id"].ToString ());
				}
				catch
				{
					Response.Redirect ("recordFileList.aspx");
				}
				
			    BindDefaultData();
				this.BindIdeas ();
			}
		}
		private void BindIdeas()
		{
			string sql="select accounts_users.username,filegive.sendtime,filegive.doingtime,filegive.agree,filegive.idea,filegive.isdone from filegive,accounts_users where accounts_users.userid=filegive.userid and filegive.recordfileid="+RecordFileID;
			ArrayList al=Dbc.getData (sql);
			TableRow tableR;
			TableCell tableC;
			for(int i=0;i<al.Count/6 ;i++)
			{
				tableR=new TableRow ();
				tableC=new TableCell ();
				Color tempColor=new Color();
				if(i%2==0)
					tempColor=(Color)TypeDescriptor.GetConverter(typeof(Color)).ConvertFromString("LightGoldenrodYellow"); //new Color("#fbe3b5") ;
				else 
					tempColor=Color.White ;
				//Color c = (Color)TypeDescriptor.GetConverter(typeof(Color)).ConvertFromString("Red");

				tableR.BackColor =tempColor;//"floralwhite";
				tableC.Controls .Add (new LiteralControl("处理人:"));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl (al[i*6].ToString ()));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl("发送时间:"));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl(al[i*6+1].ToString ()));
				tableR.Cells .Add (tableC);
				TableIdeas.Rows .Add (tableR);

				tableR=new TableRow ();
				tableR.BackColor =tempColor;
				
				if(!bool.Parse (al[i*6+5].ToString ()))
				{	
					tableC=new TableCell ();
					tableC.Controls .Add (new LiteralControl ("处理类型:"));
					tableR.Cells .Add (tableC);
					tableC=new TableCell ();
					tableC.Controls .Add (new LiteralControl ("未处理"));
					tableR.Cells .Add (tableC);
					tableC=new TableCell ();
					tableR.Cells .Add (tableC);
					tableC=new TableCell ();
					tableR.Cells .Add (tableC);
					TableIdeas.Rows .Add (tableR);
					continue;
				}	
				
				
				tableC=new TableCell ();
				tableC.BackColor =tempColor;
				tableC.Controls .Add (new LiteralControl("处理时间:"));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl(al[i+2].ToString ()));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl ("处理类型:"));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				string strTemp="";
				if(al[i*6+3].ToString ()=="0")
					strTemp="不同意";
				else if(al[i*6+3].ToString ()=="1")
					strTemp="同意";
				else if(al[i*6+3].ToString ()=="2")
					strTemp="其他";
				tableC.Controls .Add (new LiteralControl (strTemp));
				tableR.Cells .Add (tableC);
				TableIdeas.Rows .Add (tableR);

				tableR=new TableRow ();
				tableC=new TableCell ();
				tableR.BackColor =tempColor;
				tableC.Controls .Add (new LiteralControl ("处理意见:"));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableC.Controls .Add (new LiteralControl (al[i*6+4].ToString ()));
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableR.Cells .Add (tableC);
				tableC=new TableCell ();
				tableR.Cells .Add (tableC);
				TableIdeas.Rows .Add (tableR);
			}
		}
		private void BindDefaultData()
		{
			
            string sql=" select r.*,secretgreadname,documenttypename,exigencedegreename, username ";
                   sql+= " from  recordfile r, SecretGread s, VIEW_DocumentType d, ExigenceDegree e ,accounts_users a ";
                   sql+= " where r.SecretGreadID=s.SecretGreadID  and  r.DocumentTypeID=d.DocumentTypeID and  r.ExigenceDegreeID=e.ExigenceDegreeID ";
			       sql+= "  and r.userid=a.userid  ";
			       sql+= " and RecordFileID="+RecordFileID;

 

			DataSet ds=new DataSet ();
			ds=Dbc.getBinding (sql,"t");
			DataRow dr=ds.Tables[0].Rows[0];
			
			
			////////
			LabelSendComp.Text= dr["SendComp"].ToString ();
			LabelMainSendComp.Text =dr["MainSendComp"].ToString ();
			LabelCopySendComp.Text =dr["CopySendComp"].ToString ();
			LabelTitle.Text =dr["Title"].ToString ();
			LabelContent.Text = PB.GenSafeHtmlString(dr["Content"].ToString ()).Replace ("\r\n","<br>");
			LabelDocumentHead.Text =dr["DocumentHead"].ToString ();
			LabelDocumentNumber.Text =dr["DocumentNumber"].ToString ();
			LabelTopicWord.Text =dr["TopicWord"].ToString ();
			//LabelRecordDate.Text=System.DateTime.Parse(dr["RecordDate"].ToString ()).ToShortDateString();
			LabelRecordDate.Text=dr["RecordDate"].ToString ();
            LabelSecretGreadID.Text =dr["secretgreadname"].ToString ();
            LabelDocumentTypeID.Text =dr["documenttypename"].ToString ();
			LabelExigenceDegreeID.Text =dr["exigencedegreename"].ToString ();
			LabelUsername.Text =dr["Username"].ToString ();
			LabelInputDate.Text =dr["InputDate"].ToString ();
			////////
			if (dr["filepath"].ToString () !="")
			{
				string path=OI.Modules.Config.GetSetting("ReadDocuments")+"/"+ dr["FilePath"].ToString ();
				//path =Request.UserHostName.ToString ()+path+"/"+ dr["FilePath"].ToString ();
				ImageButtonOpen.Attributes["onclick"]="return openit('"+path+"');";
			}
			else
			{
				ImageButtonOpen.Enabled =false;
			}

		}

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

		}
		#endregion

		private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			Response.Redirect ("recordFileList.aspx");
		}

		private void ImageButtonOpen_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
		
		}

		 
	}
}

⌨️ 快捷键说明

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