📄 cyth_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 cyth_result : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("cyth_scan", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@id", Session["ID"].ToString());
SqlParameter pa1 = cmd.Parameters.Add("@thrq", SqlDbType.Char, 10);
SqlParameter pa2 = cmd.Parameters.Add("@thjs", SqlDbType.Int);
SqlParameter pa3 = cmd.Parameters.Add("@thr", SqlDbType.Char, 10);
SqlParameter pa4 = cmd.Parameters.Add("@thfs", SqlDbType.Char, 10);
SqlParameter pa5 = cmd.Parameters.Add("@hygs", SqlDbType.VarChar, 50);
SqlParameter pa6 = cmd.Parameters.Add("@ddyfje", SqlDbType.Float);
SqlParameter pa7 = cmd.Parameters.Add("@khdq", SqlDbType.Char, 10);
SqlParameter pa8 = cmd.Parameters.Add("@qdsj", SqlDbType.Char, 10);
SqlParameter pa9 = cmd.Parameters.Add("@qdr", SqlDbType.Char, 10);
SqlParameter pa10 = cmd.Parameters.Add("@qdjs", SqlDbType.Int);
SqlParameter pa11 = cmd.Parameters.Add("@bzsm", SqlDbType.VarChar, 100);
SqlParameter pa12 = cmd.Parameters.Add("@jdrq", SqlDbType.Char, 10);
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;
cmd.ExecuteNonQuery();
this.Label1.Text = Session["ID"].ToString();
this.Label2.Text = cmd.Parameters["@thrq"].Value.ToString();
this.Label3.Text = cmd.Parameters["@thjs"].Value.ToString();
this.Label4.Text = cmd.Parameters["@thr"].Value.ToString();
this.Label5.Text = cmd.Parameters["@thfs"].Value.ToString();
this.Label6.Text = cmd.Parameters["@hygs"].Value.ToString();
this.Label7.Text = cmd.Parameters["@ddyfje"].Value.ToString();
this.Label8.Text = cmd.Parameters["@khdq"].Value.ToString();
this.Label9.Text = cmd.Parameters["@qdsj"].Value.ToString();
this.Label10.Text = cmd.Parameters["@qdr"].Value.ToString();
this.Label11.Text = cmd.Parameters["@qdjs"].Value.ToString();
this.Label12.Text = cmd.Parameters["@bzsm"].Value.ToString();
this.Label13.Text = cmd.Parameters["@jdrq"].Value.ToString();
}
catch (Exception ex)
{
MessageBox(ex.Message);
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
protected void MessageBox(string Message)
{
Response.Write("<script language='javascript'>alert('" + Message + "')</script>");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("cyth_chage.aspx");
}
protected void Button3_Click(object sender, EventArgs e)
{
SqlConnection conn1 = new SqlConnection((string)Application["connstr"]);
try
{
conn1.Open();
SqlCommand cmd1 = new SqlCommand("cyth_del", conn1);
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.Add("@id", Session["ID"]);
SqlParameter pa1 = cmd1.Parameters.Add("@rs", SqlDbType.Int);
pa1.Direction = ParameterDirection.Output;
cmd1.ExecuteNonQuery();
if ((int)cmd1.Parameters["@rs"].Value == 1)
{
MessageBox("删除成功!");
Response.Redirect("cyth.aspx");
}
}
catch (Exception ex)
{
MessageBox(ex.Message);
}
finally
{
if (ConnectionState.Open == conn1.State)
conn1.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -