📄 cwgllist.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 Admin_CwglList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//显示车位信息列表
this.GridView1.DataSource = DataControl.GetData("select * from 车位管理");
this.GridView1.DataBind();
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string idKey = this.GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)]["车位代码"].ToString();
if (e.CommandName == "Mod")
{
//传递修改的标志 跳转页面
Response.Redirect("CwglEdit.aspx?ID=" + idKey);
}
else if (e.CommandName == "Del")
{
if (DataControl.GetData("select * from 分配车位 where 车位代码=" + idKey + "").Rows.Count > 0)
{
Response.Write("<script>alert('当前车辆信息正在使用中');</script>");
return;
}
//删除当前的车位信息 刷新列表
DataControl.Execute("delete from 车位管理 where 车位代码=" + idKey + "");
this.GridView1.DataSource = DataControl.GetData("select * from 车位管理");
this.GridView1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
//跳转页面
Response.Redirect("CwglEdit.aspx");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -