corporation_reg_display.aspx.cs

来自「ASP.NET的一些开发实例,有论坛管理系统等」· CS 代码 · 共 279 行

CS
279
字号
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 WhiteForum.client
{
	/// <summary>
	/// corporation_reg_display 的摘要说明。
	/// </summary>
	public class corporation_reg_display : BDStudioBase.FormBase
	{
		protected System.Web.UI.WebControls.Label Label02;
		protected System.Web.UI.WebControls.Label Out_Label1;
		protected System.Web.UI.WebControls.Label Out_Label2;
		protected System.Web.UI.WebControls.Label Out_Label3;
		protected System.Web.UI.WebControls.Label In_TextBox1;
		protected System.Web.UI.WebControls.Label In_TextBox2;
		protected System.Web.UI.WebControls.Label In_TextBox3;
		protected System.Web.UI.WebControls.Label Out_Label4;
		protected System.Web.UI.WebControls.Label Out_Label5;
		protected System.Web.UI.WebControls.Label Out_Label6;
		protected System.Web.UI.WebControls.Label In_TextBox4;
		protected System.Web.UI.WebControls.Label In_TextBox5;
		protected System.Web.UI.WebControls.Label In_TextBox6;
		protected System.Web.UI.WebControls.Label Out_Label7;
		protected System.Web.UI.WebControls.Label In_TextBox7;
		protected System.Web.UI.WebControls.Label In_TextBox8;
		protected System.Web.UI.WebControls.LinkButton cbAdd;
		protected System.Web.UI.WebControls.LinkButton cbEdit;
		protected System.Web.UI.WebControls.LinkButton cbDelete;
		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.LinkButton linkbNext1;
		protected System.Web.UI.WebControls.Label labMessage1;
		protected System.Web.UI.WebControls.Label Label_msg;
		protected System.Web.UI.WebControls.LinkButton Link_yes;
		protected System.Web.UI.WebControls.LinkButton Link_no;
		protected System.Web.UI.WebControls.Label Out_Label8;
		protected System.Web.UI.WebControls.Label Out_Label9;
		protected System.Web.UI.WebControls.Label Out_Label10;
		protected System.Web.UI.WebControls.Label Out_Label11;
		protected System.Web.UI.WebControls.Label In_TextBox10;
		protected System.Web.UI.WebControls.Label In_TextBox11;
		protected System.Web.UI.WebControls.Label Out_Label12;
		protected System.Web.UI.WebControls.Label Out_Label13;
		protected System.Web.UI.WebControls.Label Out_Label14;
		protected System.Web.UI.WebControls.Label In_TextBox12;
		protected System.Web.UI.WebControls.Label In_TextBox13;
		protected System.Web.UI.WebControls.Label In_TextBox14;
		protected System.Web.UI.WebControls.Label Out_Label15;
		protected System.Web.UI.WebControls.Label Out_Label16;
		protected System.Web.UI.WebControls.Label Out_Label17;
		protected System.Web.UI.WebControls.Label In_TextBox15;
		protected System.Web.UI.WebControls.Label In_TextBox16;
		protected System.Web.UI.WebControls.Label In_TextBox17;
		protected System.Web.UI.WebControls.Label Out_Label18;
		protected System.Web.UI.WebControls.Label Out_Label19;
		protected System.Web.UI.WebControls.Label In_TextBox18;
		protected System.Web.UI.WebControls.Label In_TextBox19;
		protected System.Web.UI.WebControls.Label Out_Label20;
		protected System.Web.UI.WebControls.Label In_TextBox20;
		protected System.Web.UI.WebControls.Label Out_Label21;
		protected System.Web.UI.WebControls.Label In_TextBox21;
		protected System.Web.UI.WebControls.Label Out_Label22;
		protected System.Web.UI.WebControls.Label In_TextBox22;
		protected System.Web.UI.WebControls.Label labCurrentRow;
		protected System.Web.UI.WebControls.Label In_TextBox9;

		private string m_num="261";
		private COM_SystemClient COM_SystemClient=new COM_SystemClient();
		private string sReturn="";
		private int i_RowCount=0;
		private int i_CurrentRow=0;
		private string sReceiveId="";
		private string[] arr_ReceiveId;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			this.o_str_FormName = "corporation_reg_display";
			this.o_str_FormUrl = "corporation_reg_display.aspx";
			this.o_str_InputFile1 = "corporation_reg_input.aspx";
			this.o_str_ModifyFile1= "corporation_reg_edit.aspx";
			
			this.o_str_Pk1 = string.Empty;
			if (this.Param_check(this.o_str_FormName)==1)
			{
				this.o_str_Pk1=this.Param_get("as_pk");
				this.sReceiveId=this.Param_get("as_sendid");
			}

			if(this.sReceiveId=="W")
			{
				this.linkbPrev1.Visible=false;
				this.linkbNext1.Visible=false;
				this.labPage1.Visible=false;
			}
			else
			{
				arr_ReceiveId=this.sReceiveId.Split(new char[]{','});
				i_RowCount=arr_ReceiveId.Length;
			}

			if(!Page.IsPostBack)
			{
				if(this.sReceiveId!="W")
				{
					i_CurrentRow=this.COMGfunction.GetNumFromArray(this.o_str_Pk1,arr_ReceiveId)+1;
					this.labCurrentRow.Text=i_CurrentRow.ToString();
				}
				//填充标签内容
				this.Out_label(m_num,"DisplayFace",this);
				FormInit(this.o_str_Pk1,"0");
			}				
		}

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

		}
		#endregion

		private void FormInit(string s_pk,string SearchType)
		{
			string[] str_FieldValue = {m_num,"DisplayFace",s_pk};
			DataSet dsData=this.COM_SystemClient.DsSelectSingleData(str_FieldValue,SearchType,ref sReturn);
			this.Put_IntextBox(m_num,"DisplayFace",dsData,this);
			if(this.In_TextBox12.Text=="01")
			{
				this.In_TextBox12.Text="是";
			}
			else
			{
				this.In_TextBox12.Text="否";
			}
			if(this.In_TextBox5.Text=="01")
			{
				In_TextBox5.Text="VIP客户";
			}
			else
			{
				if(In_TextBox5.Text=="02")
				{
					In_TextBox5.Text="普通客户";
				}
				else
				{
					In_TextBox5.Text="临时客户";
				}
			}
			if(In_TextBox6.Text=="01")
			{
				In_TextBox6.Text="大型企业";
			}
			else
			{
				if(In_TextBox6.Text=="02")
				{
					In_TextBox6.Text="中型企业";
				}
				else
				{
					In_TextBox6.Text="小型企业";
				}
			}
			this.labMessage1.Text=sReturn;
			this.PageLabelShow(ref this.labPage1);
		}

		/*翻页按钮事件*/
		protected void PagerButtonClick(object sender, System.EventArgs e)
		{
			i_CurrentRow=Int32.Parse(this.labCurrentRow.Text);
			string arg=((LinkButton)sender).CommandArgument;
			switch(arg)
			{
				case("prev"):
					i_CurrentRow--;
					this.PageLabelShow(ref this.labPage1);
					this.FormInit(arr_ReceiveId[i_CurrentRow-1],"0");
					break;
				case("next"):
					i_CurrentRow++;
					this.PageLabelShow(ref this.labPage1);
					this.FormInit(arr_ReceiveId[i_CurrentRow-1],"0");
					break;
			}		
			this.labCurrentRow.Text=i_CurrentRow.ToString();
		}

		protected void PageLabelShow(ref Label l_lab_Page)
		{
			if(i_CurrentRow<=0)
			{
				i_CurrentRow=1;
			}
			else
			{
				if(i_CurrentRow>=i_RowCount)
				{
					i_CurrentRow=i_RowCount;
				}
			}
			l_lab_Page.Text="第"+i_CurrentRow.ToString()+"条/共"+i_RowCount.ToString()+"条";
		}

		private void cbReturn_Click(object sender, System.EventArgs e)
		{
			//this.ReturnToParent(this.o_str_FormName);
			Response.Redirect("corporation_reg.aspx");
		}

		private void cbAdd_Click(object sender, System.EventArgs e)
		{
			this.CreatUserLogParentWindow("corporation_reg_input",this.o_str_FormUrl);//建立子窗口的父窗口数据值
			Response.Redirect(this.o_str_InputFile1);
		}

		private void cbEdit_Click(object sender, System.EventArgs e)
		{
			this.Param_Open("corporation_reg_edit");
			this.Param_set("as_pk",this.In_TextBox1.Text);
			this.Param_set("as_sendid",this.sReceiveId);
			this.CreatUserLogParentWindow("corporation_reg_edit",this.o_str_FormUrl);//建立子窗口的父窗口数据值
			Response.Redirect(this.o_str_ModifyFile1);
		}

		private void cbDelete_Click(object sender, System.EventArgs e)
		{
			string strSql = string.Format("dep_num = '{0}'",this.In_TextBox1.Text);
			this.i_RowCount=this.i_RowCount-1;

			this.FormInit (this.In_TextBox1.Text,"2");
			string sReturn1 = string.Empty;
			this.COM_SystemClient .DeleteData(strSql,ref sReturn1);
			this.labMessage1.Text = sReturn;
			this.labMessage1.Visible=true;
			if (sReturn == "没有下一条!")
			{
				this.COM_SystemClient .DeleteData(strSql,ref sReturn1);
				this.labMessage1.Text = sReturn;
				this.ReturnToParent(this.o_str_FormName);
			}
			else if (sReturn == "没有上一条!")
			{
				this.ReturnToParent(this.o_str_FormName);
			}			
		}
	
	}
}

⌨️ 快捷键说明

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