Exemplo n.º 1
0
        private void bt_select_Click(object sender, EventArgs e)
        {
            if (dtp_begin.Value > dtp_end.Value)
            {
                MessageBox.Show("开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = dtp_begin;
                return;
            }
            if (txt_tjdw.Text == "")
            {
                txt_tjdw.Tag = "";
            }

            string str_dwbh = "";

            if (txt_tjdw.Tag.ToString().Trim() != "")
            {
                str_dwbh = txt_tjdw.Tag.ToString().Trim().Substring(0, 4);
            }
            string str_bmbh = txt_tjdw.Tag.ToString().Trim();

            if (str_bmbh.Length == 4)
            {
                str_bmbh = "";
            }

            string str_xb = "%";

            if (!object.Equals(null, cmb_xb.SelectedValue))
            {
                str_xb = cmb_xb.SelectedValue.ToString().Trim();
            }

            string str_zjzt = "0";

            if (cmb_zjzt.Text == "已总检")
            {
                str_zjzt = "2";
            }
            else if (cmb_zjzt.Text == "未总检")
            {
                str_zjzt = "1";
            }
            else//全部
            {
                str_zjzt = "0";
            }
            tjdj.tjdjBiz tjdjbiz = new tjdj.tjdjBiz();
            dgv_tjdjb.DataSource = tjdjbiz.Get_TJ_TJDJB(dtp_begin.Value.ToString("yyyy-MM-dd"), dtp_end.Value.AddDays(1).ToString("yyyy-MM-dd"), txt_tjbh1.Text.Trim(), txt_tjbh2.Text.Trim(), txt_xm.Text.Trim(), str_xb, str_dwbh, str_bmbh, str_zjzt);
            ChargeColor();
        }
Exemplo n.º 2
0
        void JLMXB_DataBind(DataGridViewRow dgr)
        {
            string str_zhxm = dgr.Cells["zhxm"].Value.ToString().Trim();
            string str_xh   = dgr.Cells["xh"].Value.ToString().Trim();
            string str_xmlx = dgr.Cells["xmlx"].Value.ToString().Trim();       //0检验科 1医生检查 2功能检查
            string str_lxbh = dgr.Cells["lxbh"].Value.ToString().Trim();       //类型编号,科室ID

            dgv_tjjlmxb.DataSource = tjjgbiz.Get_TJ_TJJLMXB(str_xh, str_zhxm); //---------------------
            dgv_tjjlmxb.Tag        = str_xmlx;                                 //Tag保存项目类型值-----------------------------------------------------------------------------------
            if (str_xmlx == "0")
            {
                dgv_tjjlmxb.Columns["tjjlmxb_jg"].Width     = 80;
                dgv_tjjlmxb.Columns["tjjlmxb_dw"].Visible   = true;
                dgv_tjjlmxb.Columns["tjjlmxb_ckxx"].Visible = true;
                dgv_tjjlmxb.Columns["tjjlmxb_cksx"].Visible = true;
            }
            if (str_xmlx == "1")
            {
                dgv_tjjlmxb.Columns["tjjlmxb_jg"].Width     = 200;
                dgv_tjjlmxb.Columns["tjjlmxb_dw"].Visible   = true;
                dgv_tjjlmxb.Columns["tjjlmxb_ckxx"].Visible = false;
                dgv_tjjlmxb.Columns["tjjlmxb_cksx"].Visible = false;
            }
            if (str_xmlx == "2")
            {
                dgv_tjjlmxb.Columns["tjjlmxb_jg"].Width     = 300;
                dgv_tjjlmxb.Columns["tjjlmxb_dw"].Visible   = false;
                dgv_tjjlmxb.Columns["tjjlmxb_ckxx"].Visible = false;
                dgv_tjjlmxb.Columns["tjjlmxb_cksx"].Visible = false;
            }

            //1初始化参考值 2获取该项疾病记录 3异常情况,结果以红色字体显示
            foreach (DataGridViewRow dgrow in dgv_tjjlmxb.Rows)
            {
                string str_tjlx = dgrow.Cells["tjjlmxb_tjlx"].Value.ToString().Trim();
                string str_tjxm = dgrow.Cells["tjjlmxb_tjxm"].Value.ToString().Trim();
                //检验科获取参考值
                if (str_xmlx == "0")
                {
                    int nl = 0;
                    try
                    {
                        nl = Convert.ToInt32(str_nl);
                    }
                    catch
                    {
                    }

                    DataTable dt_gz = new tjdj.tjdjBiz().Get_TJ_TJDJB(str_tjbh, str_tjcs);
                    string    gz    = "";
                    if (dt_gz.Rows.Count > 0)
                    {
                        gz = dt_gz.Rows[0]["gz"].ToString().Trim();
                    }

                    DataTable dtCkz = tjjgbiz.Get_pro_get_ckz(str_tjlx, str_tjxm, str_xb, nl, gz);
                    if (dtCkz.Rows.Count <= 0)
                    {
                        continue;
                    }
                    string str_ckz = dtCkz.Rows[0]["ckz"].ToString().Trim();
                    if (str_ckz == "")
                    {
                        continue;               //获取值为空跳过,设置有问题
                    }
                    dgrow.Cells["tjjlmxb_ckxx"].Value = str_ckz.Split('—')[0];
                    dgrow.Cells["tjjlmxb_cksx"].Value = str_ckz.Split('—')[1];
                    dgrow.Cells["tjjlmxb_ckz"].Value  = str_ckz;
                    dgrow.Cells["spy"].Value          = dtCkz.Rows[0]["spy"].ToString().Trim();
                    dgrow.Cells["xpy"].Value          = dtCkz.Rows[0]["xpy"].ToString().Trim();
                }
                //异常情况,结果以红色字体显示
                string str_sfyx = dgrow.Cells["tjjlmxb_sfyx"].Value.ToString().Trim();
                if (str_sfyx == "1")
                {
                    dgrow.Cells["tjjlmxb_jg"].Style.ForeColor = Color.Red;
                }
            }

            rtb_xj.Text = "";
            DataTable dt = tjjgbiz.Get_TJ_TJJLB(str_tjbh, str_tjcs, str_xh, str_zhxm);

            try
            {
                dtp_jcrq.Value         = Convert.ToDateTime(dt.Rows[0]["jcrq"]);
                cmb_czy.SelectedValue  = dt.Rows[0]["czy"].ToString().Trim();
                cmb_jcys.SelectedValue = dt.Rows[0]["jcys"].ToString().Trim();
                rtb_xj.Text            = dt.Rows[0]["xj"].ToString().Trim();
            }
            catch { }
        }