travelmodify.aspx.cs

来自「登陆界面」· CS 代码 · 共 47 行

CS
47
字号
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Travel_travelModify : System.Web.UI.Page
{
    DateTime now;
    protected void Page_Load(object sender, EventArgs e)
    {
        now = DateTime.Now;
        
        dataBind();
    }
    void dataBind()
    {
        GridView1.DataSource = new corInfMan.BLL.BLLTravel().travelTable(User.Identity.Name);
        GridView1.DataBind();
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string dts = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox1")).Text;
        string dte = ((TextBox)GridView1.Rows[e.RowIndex].Cells[2].FindControl("TextBox2")).Text;
        string money = ((TextBox)GridView1.Rows[e.RowIndex].Cells[3].FindControl("TextBox3")).Text;
        string reason = ((TextBox)GridView1.Rows[e.RowIndex].Cells[5].FindControl("TextBox6")).Text;
        new corInfMan.BLL.BLLTravel().updateTravel(User.Identity.Name, dts, dte, money, reason);
        GridView1.EditIndex = -1;
        dataBind();
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        this.GridView1.EditIndex = Convert.ToInt32(e.NewEditIndex);
        dataBind();
    }
    protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        this.GridView1.EditIndex = -1;
        dataBind();
    }
    protected void TextBox3_TextChanged(object sender, EventArgs e)
    {

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?