📄 khfw_result.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_khfw_result : System.Web.UI.Page
{
protected void MessageBox(string Message)
{
Response.Write("<script language='javascript'>alert('" + Message + "')</script>");
}
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("khfw_return", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cythid", Session["cythid"].ToString());
SqlParameter pa1 = cmd.Parameters.Add("@qlr", SqlDbType.VarChar, 20);
SqlParameter pa2 = cmd.Parameters.Add("@sf", SqlDbType.VarChar,20);
SqlParameter pa3 = cmd.Parameters.Add("@zddh", SqlDbType.VarChar, 20);
SqlParameter pa4 = cmd.Parameters.Add("@uno", SqlDbType.Char, 8);
SqlParameter pa5 = cmd.Parameters.Add("@unit", SqlDbType.VarChar, 100);
SqlParameter pa6 = cmd.Parameters.Add("@zdrq", SqlDbType.Char,8);
SqlParameter pa7 = cmd.Parameters.Add("@jzjsyclrq", SqlDbType.Char, 8);
SqlParameter pa8 = cmd.Parameters.Add("@fhrq", SqlDbType.Char, 8);
SqlParameter pa9 = cmd.Parameters.Add("@bz", SqlDbType.VarChar, 200);
SqlParameter pa10 = cmd.Parameters.Add("@ecclrq", SqlDbType.Char,8);
SqlParameter pa11 = cmd.Parameters.Add("@efhrq", SqlDbType.Char, 8);
SqlParameter pa12 = cmd.Parameters.Add("@zzcljg", SqlDbType.VarChar, 200);
SqlParameter pa13 = cmd.Parameters.Add("@ffrzrq", SqlDbType.Char, 8);
pa1.Direction = ParameterDirection.Output;
pa2.Direction = ParameterDirection.Output;
pa3.Direction = ParameterDirection.Output;
pa4.Direction = ParameterDirection.Output;
pa5.Direction = ParameterDirection.Output;
pa6.Direction = ParameterDirection.Output;
pa7.Direction = ParameterDirection.Output;
pa8.Direction = ParameterDirection.Output;
pa9.Direction = ParameterDirection.Output;
pa10.Direction = ParameterDirection.Output;
pa11.Direction = ParameterDirection.Output;
pa12.Direction = ParameterDirection.Output;
pa13.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
this.Label1.Text = Session["cythid"].ToString();
this.Label2.Text = cmd.Parameters["@qlr"].Value.ToString();
this.Label3.Text = cmd.Parameters["@sf"].Value.ToString();
this.Label4.Text = cmd.Parameters["@zddh"].Value.ToString();
this.Label5.Text = cmd.Parameters["@uno"].Value.ToString();
this.Label6.Text = cmd.Parameters["@unit"].Value.ToString();
this.Label7.Text = cmd.Parameters["@zdrq"].Value.ToString();
this.Label8.Text = cmd.Parameters["@jzjsyclrq"].Value.ToString();
this.Label9.Text = cmd.Parameters["@fhrq"].Value.ToString();
this.Label10.Text = cmd.Parameters["@bz"].Value.ToString();
this.Label11.Text = cmd.Parameters["@ecclrq"].Value.ToString();
this.Label12.Text = cmd.Parameters["@efhrq"].Value.ToString();
this.Label13.Text = cmd.Parameters["@zzcljg"].Value.ToString();
this.Label14.Text = cmd.Parameters["@ffrzrq"].Value.ToString();
}
catch (Exception ex)
{
MessageBox(ex.Message);
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["cythid"] = this.Label1.Text.ToString();
Response.Redirect("khfw_updata.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("khfw_del", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cythid", this.Label1.Text.ToString());
SqlParameter pa1 = cmd.Parameters.Add("@rs", SqlDbType.Int);
pa1.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
if ((int)cmd.Parameters["@rs"].Value == 1)
{
MessageBox("删除成功!");
}
else
{
MessageBox("操作失败,请重试!");
}
}
catch (Exception ex)
{
MessageBox(ex.Message);
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -