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

📄 cargo_send.aspx.cs

📁 一个很好的物流管理系统网站!
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Chauffeur_send : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
            strcon.Open();
            string CargoName = this.CargoName.Text.ToString();
            string CargoWeight = this.CargoWeight.Text.ToString();
            string CargoPrice = this.CargoPrice.Text.ToString();
            string CargoDate = this.CargoDate.Text.ToString();
            string Start = this.Start.Text.ToString();
            string Whither = this.Whither.Text.ToString();
            string Linkman = this.Linkman.Text.ToString();
            string Tel = this.Tel.Text.ToString();
            string EffectDate = this.EffectDate.Text.ToString();
            string Bewrite = this.Bewrite.Text.ToString();
            string Username = Session["username"].ToString();
            string CargoNow = Convert.ToString(DateTime.Now);
            SqlCommand cmd = new SqlCommand("insert into tb_Cargo (CargoName,CargoWeight,CargoPrice,CargoDate,Start,Whither,Linkman,Tel,EffectDate,Bewrite,CargoNow,username)values('" + CargoName + "','" + CargoWeight + "','" + CargoPrice + "','" + CargoDate + "','" + Start + "','" + Whither + "','" + Linkman + "','" + Tel + "','" + EffectDate + "','" + Bewrite + "','" + CargoNow + "','" + Username + "')", strcon);
            cmd.ExecuteNonQuery();
            strcon.Close();
            Response.Write("<script language=javascript>alert('恭喜您,添加成功!等待审核!')</script>");
        }
        
    }
}

⌨️ 快捷键说明

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