📄 index.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;
using System.Data.SqlClient;
public partial class kehufuwu_index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("test_thglid", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@id", this.TextBox1.Text);
SqlParameter pa = cmd.Parameters.Add("@rs", SqlDbType.Int);
pa.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
if ((int)cmd.Parameters["@rs"].Value == 1)
{
Session["cythid"]=this.TextBox1.Text.ToString();
Response.Redirect("tiandan.aspx");
}
else if((int)cmd.Parameters["@rs"].Value==2)
{
this.Label1.Visible = true;
this.Label1.Text="此单号不存在!";
}
else if ((int)cmd.Parameters["@rs"].Value == 3)
{
this.Label1.Visible = true;
this.Label1.Text = "此单在储运部还未完成!";
}
}
catch (Exception ex)
{
this.Label1.Text = ex.Message;
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -