📄 default.aspx.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;
public partial class _Default : System.Web.UI.Page
{
DataBase data = new DataBase();
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = data.GetDataSet("select * from tb_TwoLayer", "table");
GridView1.DataBind();
}
protected void btnSave_Click(object sender, EventArgs e)
{
bool bl = data.ExecSQL("insert into tb_TwoLayer values('" + txtGoodsID.Text + "','" + txtGoodName.Text + "','" + txtMark.Text + "','" + txtType.Text + "','" + txtPrise.Text + "','" + txtUnit.Text + "','" + txtMemo.Text + "')");
if (bl)
{
WebMessageBox.Show("添加成功!", "");
GetWindows.GotoParentWindow("default.aspx");
}
else
{
WebMessageBox.Show("添加失败!", "");
GetWindows.GotoParentWindow("default.aspx");
}
GridView1.DataSource = data.GetDataSet("select * from tb_TwoLayer", "table");
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Text = OutPutString.HighLight(e.Row.Cells[1].Text,true);
e.Row.Attributes.Add("onmouseOver", "color=this.style.backgroundColor;this.style.backgroundColor='yellow'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=color");
e.Row.Cells[6].Text = OutPutString.Out(e.Row.Cells[6].Text, 6);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -