예제 #1
0
        private void tv_tjlxb_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (object.Equals(null, tv_tjlxb.SelectedNode.Tag))
            {
                return;
            }

            this.Text = "常见结果维护【" + tv_tjlxb.SelectedNode.Text + "】";
            str_tjxm  = tv_tjlxb.SelectedNode.Tag.ToString().Trim();//体检项目
            DataTable dt_tj_tjxmb = ywszbiz.Get_TJ_TJXMB_XJ(str_tjxm);

            if (dt_tj_tjxmb.Rows.Count < 1)
            {
                return;
            }

            str_tjlx         = dt_tj_tjxmb.Rows[0]["lxbh"].ToString().Trim();
            str_lclx         = dt_tj_tjxmb.Rows[0]["lclx"].ToString().Trim(); //临床类型编号
            dt_tj_suggestion = ywszbiz.Get_TJ_SUGGESTION(str_tjlx, str_lclx); //体检类型编号科室
            //1
            DataGridViewComboBoxColumn combox1 = new DataGridViewComboBoxColumn();

            combox1.Name             = "TJ_SUGGESTION1";
            combox1.HeaderText       = "诊断";
            combox1.Width            = 200;
            combox1.DataSource       = dt_tj_suggestion;
            combox1.DisplayMember    = "keyword";
            combox1.ValueMember      = "bh";
            combox1.DataPropertyName = "keyword";
            if (object.Equals(null, dgv_xmjg1.Columns["TJ_SUGGESTION1"]))
            {
                dgv_xmjg1.Columns.Insert(2, combox1);
            }
            else
            {
                dgv_xmjg1.Columns.Remove(dgv_xmjg1.Columns["TJ_SUGGESTION1"]);
                dgv_xmjg1.Columns.Insert(2, combox1);
            }
            //2
            DataGridViewComboBoxColumn combox2 = new DataGridViewComboBoxColumn();

            combox2.Name             = "TJ_SUGGESTION2";
            combox2.HeaderText       = "诊断";
            combox2.Width            = 200;
            combox2.DataSource       = dt_tj_suggestion;
            combox2.DisplayMember    = "keyword";
            combox2.ValueMember      = "bh";
            combox2.DataPropertyName = "keyword";
            if (object.Equals(null, dgv_xmjg2.Columns["TJ_SUGGESTION2"]))
            {
                dgv_xmjg2.Columns.Insert(9, combox2);
            }
            else
            {
                dgv_xmjg2.Columns.Remove(dgv_xmjg2.Columns["TJ_SUGGESTION2"]);
                dgv_xmjg2.Columns.Insert(9, combox2);
            }

            DataGridViewComboBoxColumn dcmbWhys2 = new DataGridViewComboBoxColumn();//危害因素2

            dcmbWhys2.Name             = "whys2";
            dcmbWhys2.HeaderText       = "危害因素";
            dcmbWhys2.Width            = 100;
            dcmbWhys2.DataSource       = xtbiz.GetXtZd(20);
            dcmbWhys2.DisplayMember    = "xmmc";
            dcmbWhys2.ValueMember      = "bzdm";
            dcmbWhys2.DataPropertyName = "whys";
            if (object.Equals(null, dgv_xmjg2.Columns["whys2"]))
            {
                dgv_xmjg2.Columns.Insert(7, dcmbWhys2);
            }
            else
            {
                dgv_xmjg2.Columns.Remove(dgv_xmjg2.Columns["whys2"]);
                dgv_xmjg2.Columns.Insert(7, dcmbWhys2);
            }

            DataGridViewComboBoxColumn dcmbWhys3 = new DataGridViewComboBoxColumn();//危害因素3

            dcmbWhys3.Name             = "whys3";
            dcmbWhys3.HeaderText       = "危害因素";
            dcmbWhys3.Width            = 100;
            dcmbWhys3.DataSource       = xtbiz.GetXtZd(20);
            dcmbWhys3.DisplayMember    = "xmmc";
            dcmbWhys3.ValueMember      = "bzdm";
            dcmbWhys3.DataPropertyName = "whys";
            if (object.Equals(null, dgv_xmjg3.Columns["whys3"]))
            {
                dgv_xmjg3.Columns.Insert(7, dcmbWhys3);
            }
            else
            {
                dgv_xmjg3.Columns.Remove(dgv_xmjg3.Columns["whys3"]);
                dgv_xmjg3.Columns.Insert(7, dcmbWhys3);
            }

            DataGridViewComboBoxColumn dcmbWhys4 = new DataGridViewComboBoxColumn();//危害因素4

            dcmbWhys4.Name             = "whys4";
            dcmbWhys4.HeaderText       = "危害因素";
            dcmbWhys4.Width            = 100;
            dcmbWhys4.DataSource       = xtbiz.GetXtZd(20);
            dcmbWhys4.DisplayMember    = "xmmc";
            dcmbWhys4.ValueMember      = "bzdm";
            dcmbWhys4.DataPropertyName = "whys";
            if (object.Equals(null, dgv_xmjg4.Columns["whys4"]))
            {
                dgv_xmjg4.Columns.Insert(7, dcmbWhys4);
            }
            else
            {
                dgv_xmjg4.Columns.Remove(dgv_xmjg4.Columns["whys4"]);
                dgv_xmjg4.Columns.Insert(7, dcmbWhys4);
            }

            //3
            DataGridViewComboBoxColumn combox3 = new DataGridViewComboBoxColumn();

            combox3.Name             = "TJ_SUGGESTION3";
            combox3.HeaderText       = "诊断";
            combox3.Width            = 200;
            combox3.DataSource       = dt_tj_suggestion;
            combox3.DisplayMember    = "keyword";
            combox3.ValueMember      = "bh";
            combox3.DataPropertyName = "keyword";
            if (object.Equals(null, dgv_xmjg3.Columns["TJ_SUGGESTION3"]))
            {
                dgv_xmjg3.Columns.Insert(7, combox3);
            }
            else
            {
                dgv_xmjg3.Columns.Remove(dgv_xmjg3.Columns["TJ_SUGGESTION3"]);
                dgv_xmjg3.Columns.Insert(7, combox3);
            }
            //4
            DataGridViewComboBoxColumn combox4 = new DataGridViewComboBoxColumn();

            combox4.Name             = "TJ_SUGGESTION4";
            combox4.HeaderText       = "诊断";
            combox4.Width            = 200;
            combox4.DataSource       = dt_tj_suggestion;
            combox4.DisplayMember    = "keyword";
            combox4.ValueMember      = "bh";
            combox4.DataPropertyName = "keyword";
            if (object.Equals(null, dgv_xmjg4.Columns["TJ_SUGGESTION4"]))
            {
                dgv_xmjg4.Columns.Insert(7, combox4);
            }
            else
            {
                dgv_xmjg4.Columns.Remove(dgv_xmjg4.Columns["TJ_SUGGESTION4"]);
                dgv_xmjg4.Columns.Insert(7, combox4);
            }


            if (dt_tj_tjxmb.Rows[0]["sfxj"].ToString().Trim() == "1")
            {
                rb_jgsfjrxj1.Checked = true;
            }
            else
            {
                rb_jgsfjrxj2.Checked = true;
            }

            if (dt_tj_tjxmb.Rows[0]["mcjrxj"].ToString().Trim() == "1")
            {
                rb_xmmcsfjrxj1.Checked = true;
            }
            else
            {
                rb_xmmcsfjrxj2.Checked = true;
            }
            cmb_xb.SelectedValue = dt_tj_tjxmb.Rows[0]["xb"].ToString().Trim();

            string str_jglx = dt_tj_tjxmb.Rows[0]["jglx"].ToString().Trim();

            if (str_jglx == "0")//字符
            {
                rb_nngy.Enabled = false;
                rb_nnfb.Enabled = false;

                tabControl1.SelectedTab = tabPage1;
                tabPage1.Parent         = this.tabControl1;
                tabPage2.Parent         = null;
                tabPage3.Parent         = null;
                tabPage4.Parent         = null;

                dt_tj_keyword1       = ywszbiz.Get_tj_keyword_zf(str_tjxm);//字符结果
                dgv_xmjg1.DataSource = dt_tj_keyword1;
            }
            if (str_jglx == "1")//数值
            {
                rb_nngy.Enabled      = true;
                rb_nnfb.Enabled      = true;
                dt_tj_keyword2       = ywszbiz.Get_tj_keyword_sz_all(str_tjxm); //数值类型男女共用
                dt_tj_keyword3       = ywszbiz.Get_tj_keyword_sz_nx(str_tjxm);  //数值男性
                dt_tj_keyword4       = ywszbiz.Get_tj_keyword_sz_vx(str_tjxm);  //数值女性
                dgv_xmjg2.DataSource = dt_tj_keyword2;
                dgv_xmjg3.DataSource = dt_tj_keyword3;
                dgv_xmjg4.DataSource = dt_tj_keyword4;

                if (dt_tj_keyword3.Rows.Count > 0 || dt_tj_keyword4.Rows.Count > 0)//男女分别结果
                {
                    rb_nnfb.Checked         = true;
                    tabControl1.SelectedTab = tabPage3;
                    tabPage1.Parent         = null;
                    tabPage2.Parent         = null;
                    tabPage3.Parent         = this.tabControl1;
                    tabPage4.Parent         = this.tabControl1;
                }
                else//表示男女共用结果
                {
                    rb_nngy.Checked         = true;
                    tabControl1.SelectedTab = tabPage2;
                    tabPage1.Parent         = null;
                    tabPage2.Parent         = this.tabControl1;
                    tabPage3.Parent         = null;
                    tabPage4.Parent         = null;
                }
            }

            if (tv_tjlxb.SelectedNode.Nodes.Count == 0)
            {
                tv_tjlxb.SelectedNode.SelectedImageIndex = tv_tjlxb.SelectedNode.ImageIndex;
                ////tv_tjlxb.SelectedNode.Parent.ImageIndex = 0;
            }
        }