updatesupply.aspx.cs
来自「一个较小的采购系统,一些比较实际的代码,可以用来参考」· CS 代码 · 共 61 行
CS
61 行
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;
using System.Data.SqlClient;
public partial class updatesupply : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridViewBind();
}
}
private void GridViewBind()
{
order supplybind = new order();
DataSet ds = supplybind.selectsupply();
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
GridViewBind();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
Label lblname = (Label)GridView1.Rows[e.RowIndex].FindControl("Label1");
TextBox txtLxr = (TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox1");
TextBox txtpho = (TextBox)GridView1.Rows[e.RowIndex].Cells[2].FindControl("TextBox2");
TextBox txtgdnum = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].FindControl("TextBox3");
TextBox txtfax = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].FindControl("TextBox4");
order update = new order();
update.updatesupply(lblname.Text, txtLxr.Text, txtpho.Text, txtgdnum.Text, txtfax.Text);
GridView1.EditIndex = -1;
GridViewBind();
GridView1.EditIndex = -1;
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
GridViewBind();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?