/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lblDiagnose_Click(object sender, EventArgs e) { Frm_Diagnoise frm = new Frm_Diagnoise(); frm.ShowDialog(); Parameter parameter = frm.ReturnParameter; frm = null; if (parameter != null) { this.txtBox_disease.Tag = parameter.Name; this.txtBox_disease.Text = parameter.Value; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToolStripMenuItemAdd_Click(object sender, EventArgs e) { Frm_Diagnoise frm = new Frm_Diagnoise(); frm.ShowDialog(); Parameter parameterDiagnose = frm.ReturnParameter; frm = null; DataTable dt = new DataTable(); dt.Columns.Add("诊断编号"); dt.Columns.Add("诊断名称"); if (this.c1FlexGridDisease.Cols.Contains("诊断编号")) { for (int i = 1; i < this.c1FlexGridDisease.Rows.Count; i++) { DataRow dr = dt.NewRow(); dr["诊断编号"] = this.c1FlexGridDisease.Rows[i]["诊断编号"].ToString().Trim(); dr["诊断名称"] = this.c1FlexGridDisease.Rows[i]["诊断名称"].ToString().Trim(); dt.Rows.Add(dr); } } if (parameterDiagnose != null) { DataRow dataRow = dt.NewRow(); dataRow["诊断编号"] = parameterDiagnose.Name; dataRow["诊断名称"] = parameterDiagnose.Value; dt.Rows.Add(dataRow); } this.c1FlexGridDisease.DataSource = dt; this.c1FlexGridDisease.Cols["诊断编号"].Width = 105; this.c1FlexGridDisease.Cols["诊断名称"].Width = 180; }