//修改车辆停放收费,占车位等信息 private void button1_Click(object sender, EventArgs e) { //获取车辆的类型 string type = comboBox1.SelectedItem.ToString(); int needPosition = Convert.ToInt32(txtPosition.Text); int startMoney = Convert.ToInt32(txtFee.Text); CarType carType = new CarType(); int n = carType.UpdateByType(type, needPosition, startMoney); if (n < 0) { MessageBox.Show("修改失败"); } else { MessageBox.Show("修改成功"); this.Close(); } }