Example #1
0
        //高血压随访记录历史表  关联传参调查询的方法
        private void querypBasicInfo()
        {
            this.dataGridView1.DataSource = null;
            DataTable dt = pBasicInfo.queryPersonalBasicInfo(pCa, time1, time2);

            this.dataGridView1.DataSource                  = dt;
            this.dataGridView1.Columns[0].Visible          = false;
            this.dataGridView1.Columns[1].HeaderCell.Value = "姓名";
            this.dataGridView1.Columns[2].HeaderCell.Value = "身份证号";
            this.dataGridView1.Columns[3].HeaderCell.Value = "创建人";
            this.dataGridView1.Columns[4].HeaderCell.Value = "创建时间";
            this.dataGridView1.Columns[5].HeaderCell.Value = "责任医生";
            this.dataGridView1.Columns[6].HeaderCell.Value = "数据状态";

            this.dataGridView1.ReadOnly = true;
            this.dataGridView1.RowsDefaultCellStyle.ForeColor = Color.Black;
            this.dataGridView1.AllowUserToAddRows             = false;
            this.dataGridView1.AutoSizeColumnsMode            = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
            {
                this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }
        }
Example #2
0
        //个人基本建档记录历史表  关联传参调查询的方法
        private void querypBasicInfo()
        {
            time1 = this.dateTimePicker1.Text.ToString() + " 00:00:00"; //开始时间
            time2 = this.dateTimePicker2.Text.ToString() + " 23:59:59"; //结束时间
            this.dataGridView1.DataSource = null;
            LoadingHelper.myCaption       = "正在查询...";
            LoadingHelper.myLabel         = "正在查询数据...";
            LoadingHelper.ShowLoadingScreen();
            Thread.Sleep(50);
            try
            {
                DataTable dt = pBasicInfo.queryPersonalBasicInfo(pCa, time1, time2, xcuncode);
                //这里处理下对应的记录
                DataTable dtfinished = CreateDataTable();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dtfinished.NewRow();
                    dr[0] = dt.Rows[i][0].ToString();
                    dr[1] = dt.Rows[i][1].ToString();
                    dr[2] = dt.Rows[i][2].ToString();
                    dr[3] = dt.Rows[i][3].ToString();

                    #region 处理特殊标签
                    String _teshubiaoqian = "";
                    String _tmp           = dt.Rows[i]["age"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) >= 65)
                    {
                        _teshubiaoqian = "老";
                    }
                    else
                    {
                        if (int.Parse(_tmp) <= 6)
                        {
                            _teshubiaoqian = "儿童";
                        }
                    }


                    _tmp = dt.Rows[i]["is_gravida"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 孕";
                    }

                    _tmp = dt.Rows[i]["is_hypertension"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 高";
                    }

                    _tmp = dt.Rows[i]["is_diabetes"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 糖";
                    }

                    _tmp = dt.Rows[i]["is_psychosis"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 精";
                    }

                    _tmp = dt.Rows[i]["is_tuberculosis"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 结";
                    }

                    _tmp = dt.Rows[i]["is_poor"].ToString();
                    if (_tmp == "")
                    {
                        _tmp = "0";
                    }
                    if (int.Parse(_tmp) != 0)
                    {
                        _teshubiaoqian = _teshubiaoqian + " 贫";
                    }
                    #endregion

                    dr[4] = _teshubiaoqian.Trim();
                    dr[5] = dt.Rows[i][4].ToString();
                    dr[6] = dt.Rows[i][5].ToString();
                    dr[7] = dt.Rows[i][6].ToString();
                    dtfinished.Rows.Add(dr);
                }
                this.dataGridView1.DataSource = dtfinished;
                dataGridView1.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("微软雅黑", 12, System.Drawing.FontStyle.Regular);
                this.dataGridView1.Columns[0].Visible            = false;
                this.dataGridView1.Columns[1].HeaderCell.Value   = "姓名";
                this.dataGridView1.Columns[2].HeaderCell.Value   = "档案编号";
                this.dataGridView1.Columns[3].HeaderCell.Value   = "身份证号";
                this.dataGridView1.Columns[4].HeaderCell.Value   = "重点人群标签";
                this.dataGridView1.Columns[5].HeaderCell.Value   = "创建人";
                this.dataGridView1.Columns[6].HeaderCell.Value   = "创建时间";
                this.dataGridView1.Columns[7].HeaderCell.Value   = "责任医生";

                this.dataGridView1.ReadOnly = true;
                this.dataGridView1.RowsDefaultCellStyle.ForeColor = Color.Black;
                this.dataGridView1.AllowUserToAddRows             = false;
                this.dataGridView1.AutoSizeColumnsMode            = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
                for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                {
                    this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                }
                LoadingHelper.CloseForm();
            }
            catch (Exception ex)
            {
                LoadingHelper.CloseForm();
                MessageBox.Show("出错,请联系请联系管理员!" + ex.Message + "/r/n" + ex.StackTrace);
            }
        }