https://bbs.csdn.net/topics/350100104
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "edit_admin")
{
GridView1.EditIndex = Convert.ToInt32(e.CommandArgument);
db_common();
}
else
{
if (e.CommandName == "Page")
{
}
else
{
SqlCommand cmd = new SqlCommand();
string sql = "";
fun fun = new fun();
fun.Page = this.Page;
DataTable dt = new DataTable();
Button x = e.CommandSource as Button;
TextBox textBox1 = x.FindControl("TextBox1") as TextBox;
TextBox textBox2 = x.FindControl("TextBox2") as TextBox;
TextBox textBox3 = x.FindControl("TextBox3") as TextBox;
Label label = x.FindControl("Label3") as Label;
sql = "UPDATE AFM_USER SET Name = @Name,MyPhone = @MyPhone,Title = @Title,UpdateDate=@UpdateDate,UpdateUserId=@UpdateUserId WHERE Account=@Account ";
cmd.CommandText = sql;
cmd.Parameters.Clear();
cmd.Parameters.AddWithValue("@Account", label.Text);
cmd.Parameters.AddWithValue("@Name", textBox1.Text);
cmd.Parameters.AddWithValue("@MyPhone", textBox3.Text);
cmd.Parameters.AddWithValue("@Title", textBox2.Text);
cmd.Parameters.AddWithValue("@UpdateDate", DateTime.Now);
cmd.Parameters.AddWithValue("@UpdateUserId", Session["Account"].ToString());
int a = fun.CmdExec(cmd);
if (a == 0)
{
fun.message("更新失敗!!!");
}
else
{
fun.message("已成功更新了" + a + "筆資料");
}
GridView1.EditIndex = -1;
db_common();
}
}
}
訂閱:
張貼留言 (Atom)
WPF聊天室应用(ASP.NET Core SignalR)
WPF聊天室应用(ASP.NET Core SignalR) https://www.bilibili.com/video/BV1Q741187Si?p=2 https://www.bilibili.com/video/BV1UV411e75T?from=search&...
-
介面,依賴反轉,單元測試 https://www.youtube.com/watch?v=GpYieGx4y6M 介面隔離,反射,特性,依賴注入 https://www.youtube.com/watch?v=3bZ4rNS_o10
-
https://mgleon08.github.io/blog/2018/07/16/jwt/ https://medium.com/%E9%BA%A5%E5%85%8B%E7%9A%84%E5%8D%8A%E8%B7%AF%E5%87%BA%E5%AE%B6%E7%AD%86%...
-
https://dotblogs.com.tw/v6610688/2015/02/19/iis_office_access_word_excel_com_interop_api_configuration https://dotblogs.com.tw/gelis/archi...
沒有留言:
張貼留言