⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cyth.aspx.cs

📁 退书管理系统
💻 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 index : System.Web.UI.Page
{
    protected string thfs;
    public static string i = "strat";
    public static DateTime thsj;
    public static DateTime qdsj;
    public static DateTime jdsj;
    protected void MessageBox(string Message)
    {
        Response.Write("<script language='javascript'>alert('" + Message + "')</script>");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
          //this.SmartNavigation = true;
        //this.TextBox9.Text = DBNull.Value.ToString();
        
               
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        if (RadioButton3.Checked == true && TextBox4.Text.Length == 0)
        {
            MessageBox("请输入货运公司名称!");

        }
        else
        {
                if (this.TextBox2.Text != this.TextBox9.Text && this.TextBox10.Text.Length == 0 &&this.TextBox9.Text.Length!=0)
                {
                    MessageBox("提货件数与清点件数不符,请填写备注说明!");
                }
                else
                {
                    SqlConnection conn = new SqlConnection((string)Application["connstr"]);
                    try
                    {
                        conn.Open();
                        SqlCommand cmd = new SqlCommand("insert_cyth", conn);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@thsj", TextBox1.Text);
                        cmd.Parameters.Add("@thjs", TextBox2.Text);
                        cmd.Parameters.Add("@thr", this.DropDownList1.SelectedValue);
                        if (RadioButton1.Checked == true)
                        {
                            thfs = "铁快";
                        }
                        else if (RadioButton2.Checked == true)
                        {
                            thfs = "铁慢";
                        }
                        else if (RadioButton3.Checked == true)
                        {
                            thfs = "货运公司";
                        }
                        else if (RadioButton4.Checked == true)
                        {
                            thfs = "邮寄";
                        }
                        cmd.Parameters.Add("@thfs", thfs);
                        cmd.Parameters.Add("@hygs", TextBox4.Text);
                        cmd.Parameters.Add("@ddyfje", TextBox5.Text);
                        cmd.Parameters.Add("@khdq", TextBox6.Text);
                        cmd.Parameters.Add("@qdsj", TextBox3.Text);
                        cmd.Parameters.Add("@qdr", this.DropDownList2.Text);
                        //if (this.TextBox9.Text.Length != 0)
                        //{
                        cmd.Parameters.Add("@qdjs", TextBox9.Text);
                        //}
                        //else 
                        //{
                        //    cmd.Parameters.Add("@qdjs", int.Parse(DBNull.Value.ToString()));
                        //}
                        cmd.Parameters.Add("@bzsm", TextBox10.Text);
                        cmd.Parameters.Add("@jdrq", TextBox7.Text);
                        SqlParameter pa = cmd.Parameters.Add("@rs", SqlDbType.Int);
                        SqlParameter pa1 = cmd.Parameters.Add("@id", SqlDbType.Char,8);
                        pa.Direction = ParameterDirection.Output;
                        pa1.Direction = ParameterDirection.Output;
                        cmd.ExecuteNonQuery();
                        if ((int)cmd.Parameters["@rs"].Value == 1)
                        {
                            MessageBox("提交成功!");
                            Session["ID"]=cmd.Parameters["@id"].Value.ToString();
                            Response.Redirect("cyth_result.aspx");

                        }
                        else
                        {
                            MessageBox("提交失败,请重试!");
                        }

                    }
                    catch (Exception ex)
                    {
                        MessageBox(ex.StackTrace);
                    }
                    finally
                    {
                        if (ConnectionState.Open == conn.State)
                            conn.Close();
                    }
                }
            }
        }
    
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        i = "textBox1";
        //this.Calendar1.Visible = true;
       
    }
    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 == "textBox1")
       // {
       //     this.Label1.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
       //     thsj = this.Calendar1.SelectedDate;
            
       // }

       // else if (i == "textBox7")
       // {
       //     this.Label2.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
       //     qdsj = this.Calendar1.SelectedDate;
       // }

       // else if (i == "textBox11")
       // {
       //     this.Label3.Text = this.Calendar1.SelectedDate.Year.ToString() + month1 + day1;
       //     jdsj = this.Calendar1.SelectedDate;
       // }
       // //Response.Cache.SetNoStore(); 
       ////this.CompareValidator1.
       // this.Calendar1.Visible = false;
       // i = "start";
        
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        i = "textBox7";
        //this.Calendar1.Visible = true;
       
       
    }
    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        i = "textBox11";
        //this.Calendar1.Visible = true;

    }

    protected void TextBox10_TextChanged(object sender, EventArgs e)
    {
               
    }
}

    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -