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

📄 messagedisplay.aspx.cs

📁 ASP.NET的一些开发实例,有论坛管理系统等
💻 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 BDStudioBase.syssoft
{
	/// <summary>
	/// MessageDisplay 的摘要说明。
	/// </summary>
	public class MessageDisplay : FormBase
	{
		protected System.Web.UI.WebControls.Label Label02;
		protected System.Web.UI.WebControls.Label Out_Label1;
		protected System.Web.UI.WebControls.Label In_TextBox1;
		protected System.Web.UI.WebControls.Label Out_Label7;
		protected System.Web.UI.WebControls.Label Out_Label8;
		protected System.Web.UI.WebControls.LinkButton cbReturn;
		protected System.Web.UI.WebControls.LinkButton linkbPrev1;
		protected System.Web.UI.WebControls.Label labPage1;
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label3;
		protected System.Web.UI.WebControls.Label In_TextBox2;
		protected System.Web.UI.WebControls.Label In_TextBox3;
		protected System.Web.UI.WebControls.Label In_TextBox4;
		protected System.Web.UI.WebControls.Label In_TextBox5;
		protected System.Web.UI.WebControls.LinkButton linkbNext1;

	    protected COM_Message COM_Message=new COM_Message();
		protected string as_pk="";
		protected string as_parent="";
		protected DataSet ds;

		private void Page_Load(object sender, System.EventArgs e)
		{
			as_pk=Request.QueryString["as_pk"];
			as_parent=Request.QueryString["parentwindow"]+".aspx";
			this.CreatUserLogParentWindow("MessageDisplay",as_parent);//建立子窗口的父窗口数据值

			string[] sFieldValue={as_pk};
			string sReturn="";
			// 在此处放置用户代码以初始化页面
			if(!Page.IsPostBack)
			{
				ds=this.COM_Message.DsSelectSingleData(sFieldValue,"0",ref sReturn);
				foreach(DataRow row in ds.Tables[0].Rows)
				{
					this.In_TextBox2.Text=row["m_date"].ToString();
					this.In_TextBox3.Text=row["start_emp"].ToString();
					this.In_TextBox4.Text=row["m_title"].ToString();
					this.In_TextBox5.Text=row["m_note"].ToString();
				}
			}
		}

		#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.cbReturn.Click += new System.EventHandler(this.cbReturn_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		protected void PagerButtonClick(object sender, System.EventArgs e)
		{
			string arg=((LinkButton)sender).CommandArgument;
			switch(arg)
			{
				case("prev"):
					//this.DataFill(this.In_TextBox1.Text,"1");
					this.PageLabelShow(ref this.labPage1,this.In_TextBox1.Text.ToString());
					break;
				case("next"):
					//this.DataFill(this.In_TextBox1.Text,"2");
					this.PageLabelShow(ref this.labPage1,this.In_TextBox1.Text.ToString());
					break;
			}			
		}

		protected void PageLabelShow(ref Label l_lab_Page,string work_num)
		{
			string[] str_FieldValue1 = {};
			DataSet ds=this.COM_Message .DsMainListForAll(str_FieldValue1);
			int totalCount = ds.Tables[0].Rows.Count;
			int currCount = 0;
			for(int i=0;i<totalCount;i++)
			{
				if (ds.Tables[0].Rows[i]["work_num"].ToString() == work_num)
				{
					currCount = i+1;
				}
			}										
			l_lab_Page.Text="第"+currCount.ToString()+"条/共"+totalCount.ToString()+"条";
		}

		private void cbReturn_Click(object sender, System.EventArgs e)
		{
			this.ReturnToParent("MessageDisplay");
		}
	}
}

⌨️ 快捷键说明

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