📄 querystat.aspx.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 SkyShark.LOB
{
/// <summary>
/// Summary description for _default.
/// </summary>
public class QueryStat : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.HyperLink HyperLink4;
protected System.Web.UI.WebControls.HyperLink HyperLink5;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label6;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label9;
protected System.Web.UI.WebControls.Label Label8;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Label txtUser;
protected System.Web.UI.WebControls.Calendar Cal1;
protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;
protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;
protected System.Data.SqlClient.SqlConnection sqlConnection1;
protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
protected System.Data.SqlClient.SqlCommand sqlSelectCommand2;
protected System.Data.SqlClient.SqlCommand sqlInsertCommand2;
protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter2;
protected System.Web.UI.WebControls.Label lblStatus;
protected System.Web.UI.WebControls.TextBox txtTNo;
protected System.Web.UI.WebControls.TextBox txtFltNo;
protected System.Web.UI.WebControls.Label lblMessage;
protected System.Web.UI.WebControls.ListBox lstClass;
protected SkyShark.LOB.DataSet4 dataSet41;
protected System.Web.UI.WebControls.HyperLink HyperLink3;
private void Page_Load(object sender, System.EventArgs e)
{
if (Session["usrRole"]==null)
{
Response.Redirect("..\\default.aspx");
}
if (!(Session["usrRole"].ToString()=="LOB"))
{
Response.Redirect("..\\default.aspx");
}
else
{
txtUser.Text="User: "+ Session["usrName"].ToString();
Cal1.SelectedDate=DateTime.Today;
lstClass.SelectedIndex=0;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDataAdapter2 = new System.Data.SqlClient.SqlDataAdapter();
this.dataSet41 = new SkyShark.LOB.DataSet4();
((System.ComponentModel.ISupportInitialize)(this.dataSet41)).BeginInit();
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT Status FROM dtFltStatus WHERE (FltNo = @fltno) AND (StatusDate = @statdate" +
") AND (StatusClass = @class)";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@fltno", System.Data.SqlDbType.VarChar, 10, "FltNo"));
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@statdate", System.Data.SqlDbType.DateTime, 8, "StatusDate"));
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@class", System.Data.SqlDbType.VarChar, 10, "StatusClass"));
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO dtFltStatus(FltNo, StatusDate, StatusClass, Status) VALUES (@FltNo, @" +
"StatusDate, @StatusClass, @Status); SELECT FltNo, StatusDate, StatusClass, Statu" +
"s FROM dtFltStatus";
this.sqlInsertCommand1.Connection = this.sqlConnection1;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FltNo", System.Data.SqlDbType.VarChar, 10, "FltNo"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@StatusDate", System.Data.SqlDbType.DateTime, 8, "StatusDate"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@StatusClass", System.Data.SqlDbType.VarChar, 10, "StatusClass"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.Int, 4, "Status"));
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "data source=NPANDEY-D185;initial catalog=Skyshark;integrated security=SSPI;persis" +
"t security info=True;workstation id=NPANDEY-D185;packet size=4096";
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "dtFltStatus", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("FltNo", "FltNo"),
new System.Data.Common.DataColumnMapping("StatusDate", "StatusDate"),
new System.Data.Common.DataColumnMapping("StatusClass", "StatusClass"),
new System.Data.Common.DataColumnMapping("Status", "Status")})});
//
// sqlSelectCommand2
//
this.sqlSelectCommand2.CommandText = "SELECT Status FROM dtReservations WHERE (TicketNo = @TicketNo)";
this.sqlSelectCommand2.Connection = this.sqlConnection1;
this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@TicketNo", System.Data.SqlDbType.VarChar, 10, "TicketNo"));
//
// sqlInsertCommand2
//
this.sqlInsertCommand2.CommandText = @"INSERT INTO dtReservations(TicketNo, FltNo, DateOfJourney, ClassOfRes, Name, EMail, Fare, Status, ReservedBy, DateOfRes, TicketConfirmed) VALUES (@TicketNo, @FltNo, @DateOfJourney, @ClassOfRes, @Name, @EMail, @Fare, @Status, @ReservedBy, @DateOfRes, @TicketConfirmed); SELECT TicketNo, FltNo, DateOfJourney, ClassOfRes, Name, EMail, Fare, Status, ReservedBy, DateOfRes, TicketConfirmed FROM dtReservations WHERE (TicketNo = @TicketNo)";
this.sqlInsertCommand2.Connection = this.sqlConnection1;
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@TicketNo", System.Data.SqlDbType.VarChar, 10, "TicketNo"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FltNo", System.Data.SqlDbType.VarChar, 10, "FltNo"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@DateOfJourney", System.Data.SqlDbType.DateTime, 8, "DateOfJourney"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClassOfRes", System.Data.SqlDbType.VarChar, 10, "ClassOfRes"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 20, "Name"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EMail", System.Data.SqlDbType.VarChar, 50, "EMail"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Fare", System.Data.SqlDbType.Int, 4, "Fare"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Status", System.Data.SqlDbType.Int, 4, "Status"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReservedBy", System.Data.SqlDbType.VarChar, 15, "ReservedBy"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@DateOfRes", System.Data.SqlDbType.DateTime, 8, "DateOfRes"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@TicketConfirmed", System.Data.SqlDbType.Bit, 1, "TicketConfirmed"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -