1.method:
来源:互联网 发布:数据库系统的组成包括 编辑:程序博客网 时间:2024/05/21 06:52
1.method:
public void DetaGrid_bookcate_ItemCommand(object sender, DataGridCommandEventArgs e)
...{
// this event fires prior to all of the other commands
// use it to provide a more graceful transition out of edit mode
DetailCheckIsEditing(e.CommandName);
}
public void DetailCheckIsEditing(string commandName)
...{
if (DetaGrid_bookcate.EditItemIndex != -1)
...{
// we are currently editing a row
if (commandName != "Cancel" && commandName != "Update")
...{
// user's edit changes (if any) will not be committed
// Message.InnerHtml = "在选择另一条目前,请先保存或取消对当前条目的修改!";
isEditing = true;
}
}
}
2.method:
protected void DataGrid_OrderInfo_ItemCommand(object source, DataGridCommandEventArgs e)
...{
if (e.CommandName == "Memo")
...{
//获取控件中的选定项的索引
this.DataGrid_OrderInfo.SelectedIndex = e.Item.ItemIndex;
if(DataGrid_OrderInfo.SelectedIndex == -1)
...{
this.OrdersDetail.Visible = true;
Memo = this.txtMemo.Text.Trim();
IsDel = this.chkIsDel.Checked.ToString();
Datetimed = Convert.ToDateTime(this.txtDateTimed.Text.Trim());
CustomerId = Convert.ToInt32(this.txtCustomerId.Text.Trim());
ShipDate = Convert.ToDateTime(this.txtshipDated.Text.Trim());
Hasview = this.chkHasView.Checked.ToString();
Hascheck = this.chkHasCheck.Checked.ToString();
Hassend = this.chkHasSend.Checked.ToString();
HasReceive = this.chkHasReceive.Checked.ToString();
adminPub.spDataGrid_OrderInfo_ItemCommand(Memo, IsDel, Datetimed, CustomerId, ShipDate, Hasview, Hascheck, Hassend, HasReceive);
int CartId = Convert.ToInt32(Request.Params["CartId"].ToString());
int ProductId = Convert.ToInt32(Request.Params["ProductId"].ToString());
//展示购物车中的商品
BindDatagrid_ShoppingCart(CartId, ProductId);
}
else
...{
Response.Write("<script language=javascript>alert('请注册为正式会员才行')</script>");
}
}
}
如果没有在代码中没有DataGrid_CannelCommand() and DataGrid_UpdateCommand() 时就采用第二种方法。
public void DetaGrid_bookcate_ItemCommand(object sender, DataGridCommandEventArgs e)
...{
// this event fires prior to all of the other commands
// use it to provide a more graceful transition out of edit mode
DetailCheckIsEditing(e.CommandName);
}
public void DetailCheckIsEditing(string commandName)
...{
if (DetaGrid_bookcate.EditItemIndex != -1)
...{
// we are currently editing a row
if (commandName != "Cancel" && commandName != "Update")
...{
// user's edit changes (if any) will not be committed
// Message.InnerHtml = "在选择另一条目前,请先保存或取消对当前条目的修改!";
isEditing = true;
}
}
}
2.method:
protected void DataGrid_OrderInfo_ItemCommand(object source, DataGridCommandEventArgs e)
...{
if (e.CommandName == "Memo")
...{
//获取控件中的选定项的索引
this.DataGrid_OrderInfo.SelectedIndex = e.Item.ItemIndex;
if(DataGrid_OrderInfo.SelectedIndex == -1)
...{
this.OrdersDetail.Visible = true;
Memo = this.txtMemo.Text.Trim();
IsDel = this.chkIsDel.Checked.ToString();
Datetimed = Convert.ToDateTime(this.txtDateTimed.Text.Trim());
CustomerId = Convert.ToInt32(this.txtCustomerId.Text.Trim());
ShipDate = Convert.ToDateTime(this.txtshipDated.Text.Trim());
Hasview = this.chkHasView.Checked.ToString();
Hascheck = this.chkHasCheck.Checked.ToString();
Hassend = this.chkHasSend.Checked.ToString();
HasReceive = this.chkHasReceive.Checked.ToString();
adminPub.spDataGrid_OrderInfo_ItemCommand(Memo, IsDel, Datetimed, CustomerId, ShipDate, Hasview, Hascheck, Hassend, HasReceive);
int CartId = Convert.ToInt32(Request.Params["CartId"].ToString());
int ProductId = Convert.ToInt32(Request.Params["ProductId"].ToString());
//展示购物车中的商品
BindDatagrid_ShoppingCart(CartId, ProductId);
}
else
...{
Response.Write("<script language=javascript>alert('请注册为正式会员才行')</script>");
}
}
}
如果没有在代码中没有DataGrid_CannelCommand() and DataGrid_UpdateCommand() 时就采用第二种方法。
- 1.method:
- Method
- method
- method
- method
- 1.工厂模式(Factory Method)
- 1.模板方法 Template Method
- [设计模式]1. Template Method
- Method method
- java design pattern (1. Factory Method pattern)
- unbound method & bound method
- Iterative Method / Recursive Method
- Python的method, class method, static method
- 10. 11. 1. 线程同步 Test Synchronized method
- Factory Method
- Template Method
- factory method
- template method
- TP-Link WN321G+ 在Ubuntu 7.04上的使用
- An annoyed day
- Smss.exe 进程分析--NT 源码--当机方法
- 什么是存储过程
- BCB 与 WTL (二)
- 1.method:
- 猪的一生应当这样度过
- 武装你的测试
- CSS兼容IE6,IE7,FIREFOX的一些收集
- Java连接SQL 数据库测试代码
- PE加载器的实现
- The thread 0xDE8 has exited with code "X"意义
- Recognizer & FS & Filter
- 轻松一招,巧移C盘Firefox配置文件