Exemplo n.º 1
0
        private void InitEmrTreeNodes()
        {
            try
            {
                DataRow drv = gridViewInpatientList.GetDataRow(gridViewInpatientList.FocusedRowHandle);
                m_CurrentEditorForm.CurrentEditorControl.EMRDoc.ClearContent();
                checkedListBoxControlEmrNode.Items.Clear();
                checkEditCheckAll.Checked = false;

                if (drv != null)
                {
                    string noofinpat = drv["noofinpat"].ToString();
                    if (gridViewDeptList.FocusedRowHandle >= 0)
                    {
                        string    id = ((DataTable)gridControlDeptList.DataSource).Rows[gridViewDeptList.FocusedRowHandle]["id"].ToString();
                        DataTable dt = m_HistoryEmrBll.GetEmrListByNoofinpatAndDeptChangeID(noofinpat, id);
                        SetCheckBoxListSource(dt);
                    }
                    else
                    {
                        DataTable depts = gridControlDeptList.DataSource as DataTable;
                        if (null == depts || depts.Rows.Count == 0)
                        {
                            DataTable dt   = m_HistoryEmrBll.GetEmrListByNoofinpatAndDeptChangeID(noofinpat, string.Empty);
                            var       rows = dt.AsEnumerable().Where(p => p["SORTID"].ToString() != "AC");
                            SetCheckBoxListSource((null == rows || rows.Count() == 0) ? dt.Clone() : rows.CopyToDataTable());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }