private void cbCalType_SelectedIndexChanged(object sender, EventArgs e) { this.tbResultFee.ForeColor = Color.Black; this.tbResultFee.Enabled = true; this.tabPage1.Text = this.cbCalType.Text; this.CalType = this.cbCalType.SelectedValue.ToString(); if (fm != null) { fm.ChangedData(CalType); DataTable dt = fm.ArrangCalculate(); for (int i = 0; i < fm.fsvlist.Count; i++) { switch (fm.fsvlist[i].name) { case "总金额": fm.fsvlist[i].value = allFee.ToString("0.00"); break; case "诊金": fm.fsvlist[i].value = examineFee.ToString("0.00"); break; case "自费金额": fm.fsvlist[i].value = selfFee.ToString("0.00"); break; } } fm.Calculate(dt); this.dataGridViewEx1.DataSource = dt; } }