/// <summary> /// 设置值 /// </summary> /// <param name="row"></param> /// <param name="text"></param> /// <param name="columnName"></param> private void setValue(MED_TISS_SCORING_RESULT_DETAIL row, string text, string columnName) { decimal value = 0; try { value = decimal.Parse(text); } catch { return; } row.SetValue(columnName, value); }
/// <summary> /// 保存评分明细选项 /// </summary> /// <returns></returns> private int saveDetailSap() { string columnName = ""; //int score = 0; if (txtScore.Text == "") { Dialog.MessageBox("请先评分,再保存!", "麻醉信息工作站", MessageBoxButtons.OK, MessageBoxIcon.Information); return(1); } List <MED_TISS_SCORING_RESULT_DETAIL> detailTable = new List <MED_TISS_SCORING_RESULT_DETAIL>(); MED_TISS_SCORING_RESULT_DETAIL detailRow = new MED_TISS_SCORING_RESULT_DETAIL(); detailRow.PATIENT_ID = _patientID; detailRow.VISIT_ID = (int)_visitID; detailRow.DEP_ID = (int)_deptID; scoreDateTime = DataOperator.GetSysDate(); detailRow.SCORING_DATE_TIME = scoreDateTime; DevExpress.XtraEditors.CheckEdit temp; foreach (Control getControl in panel4.Controls) { try { temp = getControl as DevExpress.XtraEditors.CheckEdit; char[] NumberLetter = temp.Name.ToCharArray(temp.Name.Length - 3, 1); if (char.IsNumber(NumberLetter[0])) { columnName = "T" + temp.Name.Substring(temp.Name.Length - 3); } else { columnName = "T" + temp.Name.Substring(temp.Name.Length - 2); } if (temp.Checked == true) { setValue(detailRow, "4", columnName); } else { setValue(detailRow, "0", columnName); } } catch (Exception) { } } foreach (Control getControl in panel5.Controls) { try { temp = getControl as DevExpress.XtraEditors.CheckEdit; char[] NumberLetter = temp.Name.ToCharArray(temp.Name.Length - 3, 1); if (char.IsNumber(NumberLetter[0])) { columnName = "T" + temp.Name.Substring(temp.Name.Length - 3); } else { columnName = "T" + temp.Name.Substring(temp.Name.Length - 2); } if (temp.Checked == true) { setValue(detailRow, "3", columnName); } else { setValue(detailRow, "0", columnName); } } catch (Exception) { } } foreach (Control getControl in panel6.Controls) { try { temp = getControl as DevExpress.XtraEditors.CheckEdit; char[] NumberLetter = temp.Name.ToCharArray(temp.Name.Length - 3, 1); if (char.IsNumber(NumberLetter[0])) { columnName = "T" + temp.Name.Substring(temp.Name.Length - 3); } else { columnName = "T" + temp.Name.Substring(temp.Name.Length - 2); } if (temp.Checked == true) { setValue(detailRow, "2", columnName); } else { setValue(detailRow, "0", columnName); } } catch (Exception) { } } foreach (Control getControl in panel7.Controls) { try { temp = getControl as DevExpress.XtraEditors.CheckEdit; char[] NumberLetter = temp.Name.ToCharArray(temp.Name.Length - 3, 1); if (char.IsNumber(NumberLetter[0])) { columnName = "T" + temp.Name.Substring(temp.Name.Length - 3); } else { columnName = "T" + temp.Name.Substring(temp.Name.Length - 2); } if (temp.Checked == true) { setValue(detailRow, "1", columnName); } else { setValue(detailRow, "0", columnName); } } catch (Exception) { } } detailRow.MEMO = tex_DescriptionIllness.Text; detailTable.Add(detailRow); if (DataOperator.UpdateTissScoringResult(detailTable) >= 0) { return(1); } else { Dialog.MessageBox("保存失败!", "麻醉信息工作站", MessageBoxButtons.OK, MessageBoxIcon.Information); return(-1); } }