📄 tiandan.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_tiandan : System.Web.UI.Page
{
public static string i = "strat";
public static DateTime jzjsyclrq;
public static DateTime fhrq;
public static DateTime ecclrq;
public static DateTime efhrq;
public static DateTime ffrzrq;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["ID"] == null)
{
if (Session["cythid"] != null)
{
this.Label1.Text = Session["cythid"].ToString();
}
}
else
{
string x = Request.QueryString["ID"];
int xx = Convert.ToInt32(x);
Session["cythid"] = x;
this.Label1.Text = Session["cythid"].ToString();
}
string day;
string month;
if (DateTime.Now.Day < 10)
{
day = "0" + DateTime.Now.Day.ToString();
}
else
{
day = DateTime.Now.Day.ToString();
}
if (DateTime.Now.Month < 10)
{
month = "0" + DateTime.Now.Month.ToString();
}
else
{
month = DateTime.Now.Day.ToString();
}
//this.Label3.Text = DateTime.Now.Year.ToString() + month + day;
}
protected void TextBox5_TextChanged(object sender, EventArgs e)
{
}
protected void MessageBox(string Message)
{
Response.Write("<script language='javascript'>alert('" + Message + "')</script>");
}
protected void Button2_Click(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("return_sales", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@dno", this.TextBox5.Text);
SqlParameter pa = cmd.Parameters.Add("@uno", SqlDbType.Char, 8);
SqlParameter pa1 = cmd.Parameters.Add("@unit", SqlDbType.Char, 100);
SqlParameter pa2 = cmd.Parameters.Add("@rs", SqlDbType.Int);
pa.Direction = ParameterDirection.Output;
pa1.Direction = ParameterDirection.Output;
pa2.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
if ((int)cmd.Parameters["@rs"].Value == 1)
{
this.Label2.Text = cmd.Parameters["@uno"].Value.ToString();
this.Label9.Text = cmd.Parameters["@unit"].Value.ToString();
}
else
{
MessageBox("制单单号输入错误!");
}
}
catch (Exception ex)
{
MessageBox(ex.Message);
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
//string day1;
//string month1;
//if (this.Calendar1.SelectedDate.Day < 10)
//{
// string a = this.Calendar1.SelectedDate.Day.ToString();
// day1 = "0" + a;
//}
//else
//{
// day1 = this.Calendar1.SelectedDate.Day.ToString();
//}
//if (this.Calendar1.SelectedDate.Month < 10)
//{
// string b = this.Calendar1.SelectedDate.Month.ToString();
// month1 = "0" + b;
//}
//else
//{
// month1 = this.Calendar1.SelectedDate.Day.ToString();
//}
//if(i=="lb2")
//{
// this.Label4.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
// jzjsyclrq = this.Calendar1.SelectedDate;
//}
//else if (i == "lb3")
//{
// this.Label5.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
// fhrq = this.Calendar1.SelectedDate;
//}
//else if (i == "lb4")
//{
// this.Label6.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
// ecclrq = this.Calendar1.SelectedDate;
//}
//else if (i == "lb5")
//{
// this.Label7.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
// efhrq = this.Calendar1.SelectedDate;
//}
//else if (i == "lb6")
//{
// this.Label8.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
// ffrzrq = this.Calendar1.SelectedDate;
//}
//this.Calendar1.Visible = false;
//i = "start";
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
i = "lb2";
//this.Calendar1.Visible = true;
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
i = "lb3";
//this.Calendar1.Visible = true;
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
i = "lb4";
//this.Calendar1.Visible = true;
}
protected void LinkButton5_Click(object sender, EventArgs e)
{
i = "lb5";
//this.Calendar1.Visible = true;
}
protected void LinkButton6_Click(object sender, EventArgs e)
{
i = "lb6";
//this.Calendar1.Visible = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection((string)Application["connstr"]);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert_khfw", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cythid", Label1.Text);
cmd.Parameters.Add("@qlr", this.DropDownList1.SelectedValue);
cmd.Parameters.Add("@sf", this.TextBox2.Text);
cmd.Parameters.Add("@zddh", this.TextBox5.Text);
cmd.Parameters.Add("@uno", this.Label2.Text);
cmd.Parameters.Add("@unit", this.Label9.Text);
cmd.Parameters.Add("@zdrq", this.TextBox1.Text);
cmd.Parameters.Add("@jzjsyclrq", TextBox6.Text);
cmd.Parameters.Add("@fhrq", this.TextBox7.Text);
cmd.Parameters.Add("@bz", TextBox3.Text);
cmd.Parameters.Add("@ecclrq", this.TextBox8.Text);
cmd.Parameters.Add("@efhrq", TextBox9.Text);
cmd.Parameters.Add("@zzcljg", this.TextBox4.Text);
cmd.Parameters.Add("@ffrzrq", this.TextBox10.Text);
SqlParameter pa = cmd.Parameters.Add("@rs", SqlDbType.Int);
pa.Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
if ((int)cmd.Parameters["@rs"].Value == 1)
{
MessageBox("提交成功!");
Session["cythid"] = this.Label1.Text.ToString();
Response.Redirect("khfw_result.aspx");
}
else
{
MessageBox("提交失败,请重试!");
}
}
catch (Exception ex)
{
MessageBox(ex.StackTrace);
}
finally
{
if (ConnectionState.Open == conn.State)
conn.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -