예제 #1
0
        private void m_cndFind_Click(object sender, System.EventArgs e)
        {
            clsCaseGradeValue[] objGradeValueArr;
            if (m_cboDept.SelectedItem == null /*|| m_cboArea.SelectedItem == null*/)
            {
                clsPublicFunction.ShowInformationMessageBox("请先选择科室!");
                return;
            }

            long lngRes = 0;

            if (m_cboArea.Items.Count > 0)
            {
                if (m_cboArea.SelectedItem == null)
                {
                    clsPublicFunction.ShowInformationMessageBox("请先选择病区!");
                    return;
                }
                lngRes = m_objDomain.m_lngGetGradeInfoByArea(((clsInPatientArea)m_cboArea.SelectedItem).m_StrAreaID_CHR, m_dtpSeachDate.Value, m_dtpSeachDate2.Value, out objGradeValueArr);
            }
            else
            {
                lngRes = m_objDomain.m_lngGetGradeInfoByDept(((clsDepartment)m_cboDept.SelectedItem).m_StrDeptID, m_dtpSeachDate.Value, m_dtpSeachDate2.Value, out objGradeValueArr);
            }

            if (lngRes <= 0 || objGradeValueArr == null)
            {
                return;
            }

            m_trvPatient.BeginUpdate();
            m_trvPatient.Nodes.Clear();

            TreeNode node = null;

            if (m_cboArea.Items.Count > 0)
            {
                node     = new TreeNode(m_cboArea.SelectedItem.ToString());
                node.Tag = (clsInPatientArea)m_cboArea.SelectedItem;
            }
            else
            {
                node     = new TreeNode(m_cboDept.SelectedItem.ToString());
                node.Tag = (clsDepartment)m_cboDept.SelectedItem;
            }

            node.ImageIndex = 0;
            for (int i = 0; i < objGradeValueArr.Length; i++)
            {
                TreeNode trnChild = new TreeNode(objGradeValueArr[i].m_strInPatientID);
                trnChild.Tag                = objGradeValueArr[i];
                trnChild.ImageIndex         = 1;
                trnChild.SelectedImageIndex = 1;
                node.Nodes.Add(trnChild);
            }
            m_trvPatient.Nodes.Add(node);
            m_trvPatient.SelectedNode = node;
            m_trvPatient.ExpandAll();
            m_trvPatient.EndUpdate();
        }