web/WebUserControl2.ascx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class web_WebUserControl2 : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label2.Text = DateTime.Now.ToLongDateString();
        Label1.Text = Request.QueryString["Name"];
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string ConnStr1 = System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ToString();
        SqlConnection cn = new SqlConnection(ConnStr1);
        String sql3 = "select count(*) from CustomersInfo where CidentityId='"+TextBox2.Text.Trim()+"'";
        String sql1 = "insert into CustomersInfo(CidentityId,Cname,Cphone,Address) values('" + TextBox2.Text.Trim() + "','" + TextBox1.Text.Trim() + "','" + TextBox3.Text.Trim() + "','" + TextBox4.Text.Trim() + "')";
        String sql = "insert into RoomOperation(RoomId,BeginTime,CidentityId,Rmarks) values('"+Label1.Text+"','"+Label2.Text.Trim()+"','"+TextBox2.Text.Trim()+"','"+TextBox5.Text.Trim()+"')";
        String sql2 = "update RoomStatus set Statu='不可订',status=0 where RoomId='" + Label1.Text.Trim() + "'";
        String sql4 = "insert into History(BeginTime,RoomId,CidentityId) values('" + DateTime.Now.ToString() + "','" + Label1.Text.Trim() + "','" + TextBox2.Text.Trim() + "')";
        if (TextBox1.Text.Trim() == "" || TextBox2.Text.Trim() == "")
        {
            Response.Write("<script>window.alert('请将必填信息填写完整');</script>");
        }

        else
        {
            cn.Open();
            SqlCommand cmd3 = new SqlCommand(sql3, cn);
            int a = (int)cmd3.ExecuteScalar();
            if (a == 0)
            {
                SqlCommand cmd = new SqlCommand(sql, cn);
                SqlCommand cmd1 = new SqlCommand(sql1, cn);
                SqlCommand cmd2 = new SqlCommand(sql2, cn);
                SqlCommand cmd4 = new SqlCommand(sql4,cn);
                cmd1.ExecuteNonQuery();
                cmd.ExecuteNonQuery();
                cmd2.ExecuteNonQuery();
                cmd4.ExecuteNonQuery();
                cn.Close();
                Response.Write("<script language=javascript>alert('订房成功!!');</script>");
            }
            else
            {
                SqlCommand cmd = new SqlCommand(sql, cn);
                SqlCommand cmd4 = new SqlCommand(sql4, cn);
                SqlCommand cmd2 = new SqlCommand(sql2, cn);
                cn.Open();
                cmd4.ExecuteNonQuery();
                cmd.ExecuteNonQuery();
                cmd2.ExecuteNonQuery();
                cn.Close();
                Response.Write("<script language=javascript>alert('订房成功!!');</script>");
后面还有 10 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。