protected void Btn_Update_Click(object sender, EventArgs e) { BackupDeviceModel backupDevice = new BackupDeviceModel(); int id = Int32.Parse(Request.QueryString["id"]); backupDevice.setId(id); backupDevice.setTypeId(Int32.Parse(this.TypeId.SelectedValue)); backupDevice.setDeviceName(this.DeviceName.Text); backupDevice.setDeviceModel(this.DeviceModel.Text); backupDevice.setPrice(Convert.ToSingle(this.Price.Text)); backupDevice.setDeviceFrom(this.DeviceFrom.Text); backupDevice.setManufacturer(this.Manufacturer.Text); backupDevice.setInDate(this.InDate.Text); backupDevice.setOutDate(this.OutDate.Text); backupDevice.setStockCount(Int32.Parse(this.StockCount.Text)); backupDevice.setInOperator(this.InOperator.Text); backupDevice.setOutOperator(this.OutOperator.Text); if (BackupDeviceDAO.UpdateDeviceModel(backupDevice)) { Response.Write("<script>alert('更新成功!');location.href='BackupDeviceManage.aspx';</script>"); } else { Response.Write("<script>alert('更新失敗!');</script>"); } }