private void button5_Click(object sender, EventArgs e) { string Height = this.textBox5.Text; string Weight = this.textBox6.Text; string BMI = this.textBox7.Text; bool istrue = tjdao.updateSgtzInfo(aichive_no, bar_code, Height, Weight, BMI); if (istrue) { //2019-6-19更新 zkhw_tj_bgdc 要根据输入的数值进行判断 int r0 = 1; int r1 = 1; int r2 = 1; if (Height != "") { double a = 0; bool b = double.TryParse(Height, out a); if (b == true) { r0 = GetJudgeResultForHeight(a); } } if (Weight != "") { double a = 0; bool b = double.TryParse(Weight, out a); if (b == true) { r1 = GetJudgeResultForWeight(a); } } if (BMI != "") { double a = 0; bool b = double.TryParse(BMI, out a); if (b == true) { r2 = GetJudgeResultForBMI(a); } } int r = r0; if (r < r1) { r = r1; } if (r < r2) { r = r2; } tjdao.updateTJbgdcSgtz(aichive_no, bar_code, r.ToString()); tjdao.updatePESgtzInfo(aichive_no, bar_code, Height, Weight, BMI); testFunDelegate(r, 11, rowIndex); MessageBox.Show("数据保存成功!"); } else { MessageBox.Show("数据保存失败!"); } }