Пример #1
0
        private void tv_tjdw_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (tv_tjdw.SelectedNode.Nodes.Count == 0)
            {
                tv_tjdw.SelectedNode.SelectedImageIndex = tv_tjdw.SelectedNode.ImageIndex;
                ////tv_tjlxb.SelectedNode.Parent.ImageIndex = 0;
            }

            MyTreeNode node = (MyTreeNode)tv_tjdw.SelectedNode;

            str_dwbh      = node.Str1.Trim();
            str_fzbh      = node.Str2.Trim();
            txt_dwmc.Text = node.Str3.Trim();
            if (str_fzbh == "")
            {
                ClearControl();
                return;
            }//没有子节点
            DataTable dt_TJ_DWFZ_HD = tjglbiz.Get_TJ_DWFZ_HD(str_dwbh, str_fzbh);

            if (dt_TJ_DWFZ_HD.Rows.Count < 1)
            {
                return;
            }
            txt_fzbh.Text        = dt_TJ_DWFZ_HD.Rows[0]["bh"].ToString().Trim();
            txt_fzmc.Text        = dt_TJ_DWFZ_HD.Rows[0]["fzmc"].ToString().Trim();
            cmb_xb.SelectedValue = dt_TJ_DWFZ_HD.Rows[0]["xb"].ToString().Trim();
            txt_zw.Text          = dt_TJ_DWFZ_HD.Rows[0]["zw"].ToString().Trim();
            txt_zc.Text          = dt_TJ_DWFZ_HD.Rows[0]["zc"].ToString().Trim();
            this.Text            = "体检单位分组" + "【" + txt_fzmc.Text.Trim() + "】";

            lv_tjxm.Items.Clear();
            dt_tj_dwfz_dt = tjglbiz.Get_TJ_DWFZ_DT(str_fzbh, str_dwbh);
            foreach (DataRow dr in dt_tj_dwfz_dt.Rows)
            {
                ListViewItem item = new ListViewItem();
                item.Tag        = dr["zhxm"].ToString().Trim();
                item.Text       = dr["mc"].ToString().Trim();
                item.ImageIndex = 5;
                lv_tjxm.Items.Add(item);
            }
        }