/// <summary> /// 1、获取病人 /// 2、根据病人生成批量的datatable /// </summary> private void GetDateTable() { WaitDialogForm waitForm = new WaitDialogForm("正在生成病人列表...", "请稍等"); try { if (dateTimeAdd.DateTime == null) { return; } dataElementList = new Dictionary <string, DataElementEntity>(); dicitemList = new Dictionary <string, List <InCommonNoteItemEntity> >(); if (dtInpatient == null) { dtInpatient = m_InCommonNoteBiz.GetInPatientByDepart(); } DataTable dtPL = m_InCommonNoteBiz.GetDateTable(m_CommonNoteEntity.CommonNote_TabList[0], out dataElementList); DataColumn dc = new DataColumn("check", typeof(bool)); dc.Caption = "选择"; dtPL.Columns.Add(dc); dtPL.Columns["check"].SetOrdinal(1); m_InCommonNoteBiz.GetDataTablePLSetValue(dtInpatient, dtPL, m_CommonNoteEntity, dateTimeAdd.DateTime, dataElementList, dicitemList); InitGridControlForDateTable(dtPL); gridControl1.DataSource = dtPL; } catch (Exception ex) { throw ex; } finally { waitForm.Close(); } }
/// <summary> /// 展现数据 /// </summary> private void BindDate() { dataElementList = new Dictionary <string, DataElementEntity>(); dicitemList = new Dictionary <string, List <InCommonNoteItemEntity> >(); if (m_CommonNoteEntity == null || m_CommonNoteEntity.CommonNote_TabList == null) { return; } if (m_CommonNoteEntity.CommonNote_TabList[0].ShowType == "单列") { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该单据的第一个表格不是所需表格格式,无法进行批量录入"); return; } DataTable dt = m_InCommonNoteBiz.GetDateTable(m_CommonNoteEntity.CommonNote_TabList[0], out dataElementList); m_InCommonNoteBiz.SetValueToDataTable(dt, out dicitemList, InCommonNoteItemEntityListAll, dataElementList); InitGridControlForDateTable(dt); dt.DefaultView.Sort = "OUTBED ASC"; //dt = dt.DefaultView.ToTable(); gridControl1.DataSource = dt; }