📄 gdcjcqkedit.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
public partial class Czy_GdcjcqkEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
this.TextBox3.ReadOnly = true;
this.Textbox4.Text = DateTime.Now.ToString();
if (Request.QueryString["ID"] != null)
{
this.Button3.Visible = false;
this.TextBox3.ReadOnly = false;
this.Textbox4.ReadOnly = true;
//显示当前的固定车进出情况
dt = DataControl.GetData("select * from 固定车进出情况, 分配车位,车位管理 where 固定车进出情况.分配代码=分配车位.分配代码 and 分配车位.车位代码=车位管理.车位代码 and 情况代码=" + Request.QueryString["ID"] + "");
if (dt.Rows.Count > 0)
{
this.TextBox1.Text = dt.Rows[0]["车位编号"].ToString();
this.Textbox4.Text = dt.Rows[0]["出去时间"].ToString();
this.TextBox3.Text = DateTime.Now.ToString();
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
//跳转页面
Response.Redirect("GdcjcqkList.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
//添加或更新固定车进出情况信息
if (Request.QueryString["ID"] != null)
{
DataControl.Execute("update 固定车进出情况 set 回来时间='" + TextBox3.Text + "' where 情况代码='" + Request.QueryString["ID"] + "'");
}
else
{
DataControl.Execute("insert into 固定车进出情况(分配代码,出去时间,帐号) values " +
" ('" + this.Hidden1.Value + "','" + Textbox4.Text + "','" + Session["帐号"].ToString() + "')");
}
Response.Redirect("GdcjcqkList.aspx");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -