/// <summary> /// 执行GridView数据行按钮事件 /// </summary> protected void gvRoomType_RowCommand(object sender, GridViewCommandEventArgs e) { //获取按钮命令名称 string cmd = e.CommandName; int typeId = Convert.ToInt32(e.CommandArgument);//获取命令参数 if (cmd == "De") { //根据类型ID删除类型信息 RoomTypeManager.DeleteRoomTypeByTypeId(typeId); } else if (cmd == "Ed") { //转向类型信息编辑页 Page.Server.Transfer("EditRoomType.aspx?typeId=" + Convert.ToString(typeId)); } BindRoomType(); }
/// <summary> /// 删除客房类型信息 /// </summary> private void tsbtnDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(typeID) && !string.IsNullOrEmpty(txtType.Text.Trim())) { //调用业务逻辑层客房信息删除功能 DialogResult result = MessageBox.Show("您确实要删除此信息吗?", "提交提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (result == DialogResult.OK) { RoomTypeManager.DeleteRoomTypeByTypeId(Convert.ToInt32(typeID)); //刷新房屋信息列表 BindRoomTypeList(); MessageBox.Show("信息删除成功!", "提交提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("请选择要删除的信息!", "提交提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }