protected void Btn_Update_Click(object sender, EventArgs e) { UselessDeviceModel uselessDevice = new UselessDeviceModel(); int id = Int32.Parse(Request.QueryString["id"]); uselessDevice.setId(id); uselessDevice.setTypeId(Int32.Parse(this.TypeId.SelectedValue)); uselessDevice.setDeviceName(this.DeviceName.Text); uselessDevice.setDeviceModel(this.DeviceModel.Text); uselessDevice.setDeviceFrom(this.DeviceFrom.Text); uselessDevice.setDeviceCount(Int32.Parse(this.DeviceCount.Text)); if (UselessDeviceDAO.UpdateUselessDevice(uselessDevice)) { Response.Write("<script>alert('更新成功!');location.href='UselessDeviceManage.aspx';</script>"); } else { Response.Write("<script>alert('更新失败!');</script>"); } }