コード例 #1
0
        private void RefreshList(string strSQL)
        {
            _DictJson.Clear();
            string           strJson;
            StudyInfo        studyInfo  = new StudyInfo();
            List <StudyInfo> studyInfos = new List <StudyInfo>();

            studyInfos = new List <StudyInfo>();

            System.Diagnostics.Debug.WriteLine("进入RefreshList");
            _dataTable = _dbQuery.ExecuteSQL(strSQL);
            System.Diagnostics.Debug.WriteLine("查询OK");
            for (int i = 0; i < _dataTable.Rows.Count; i++)
            {
                strJson = _dataTable.Rows[i]["患者信息"].ToString();
                try
                {
                    studyInfo      = JsonHelper.DeserializeObject <StudyInfo>(strJson);
                    studyInfo.部位方法 = null;
                    if (studyInfo.姓名 == null)
                    {
                        continue;
                    }
                    _DictJson.Add(studyInfo.ID, strJson);
                }
                catch
                {
                    System.Diagnostics.Debug.WriteLine("出错!");
                    continue;
                }

                studyInfos.Add(studyInfo);
            }

            System.Diagnostics.Debug.WriteLine("循环解析json类型ok");
            gridCtl.DataSource = studyInfos;

            gridView.PopulateColumns();
            gridView.BestFitColumns();

            gridView.Columns["ID"].Visible     = false;
            gridView.Columns["患者ID"].Visible   = false;
            gridView.Columns["执行科室ID"].Visible = false;
            gridView.Columns["检查项目ID"].Visible = false;
            gridView.Columns["主页ID"].Visible   = false;
            gridView.Columns["就诊ID"].Visible   = false;

            for (int i = 0; i < gridView.RowCount; i++)
            {
                string strTmp = "";
                strTmp = gridView.GetRowCellValue(i, "患者来源").ToString();

                if (strTmp == "1")
                {
                    strTmp = "门诊病人";
                }

                if (strTmp == "2")
                {
                    strTmp = "住院病人";
                }


                gridView.SetRowCellValue(i, "患者来源", strTmp);
            }

            System.Diagnostics.Debug.WriteLine("主列表显示数据ok");
        }
コード例 #2
0
        private void LoadOneData()
        {
            int    intSelRow;
            string strTmp;

            if (gridView1.RowCount == 0)
            {
                return;
            }

            intSelRow = gridView1.GetSelectedRows()[0];
            if (intSelRow < 0)
            {
                return;
            }
            System.Diagnostics.Debug.WriteLine("LoadOneData step1");
            _studyInfo = new StudyInfo();


            //_studyInfo.ID = Convert.ToInt32("100");
            _studyInfo.ID     = Convert.ToInt64(gridView1.GetRowCellValue(intSelRow, "ID").ToString());
            _studyInfo.患者ID   = Convert.ToInt64(gridView1.GetRowCellValue(intSelRow, "患者ID").ToString());
            _studyInfo.执行科室ID = Convert.ToInt64(gridView1.GetRowCellValue(intSelRow, "执行科室ID").ToString());
            _studyInfo.检查项目ID = Convert.ToInt64(gridView1.GetRowCellValue(intSelRow, "检查项目ID").ToString());
            _studyInfo.患者来源   = gridView1.GetRowCellValue(intSelRow, "患者来源").ToString();

            strTmp = gridView1.GetRowCellValue(intSelRow, "主页ID").ToString();
            if (strTmp != "")
            {
                _studyInfo.主页ID = Convert.ToInt16(strTmp);
            }
            else
            {
                _studyInfo.主页ID = 0;
            }


            string str挂号ID = gridView1.GetRowCellValue(intSelRow, "挂号ID").ToString();

            if (_studyInfo.患者来源 == "1")
            {
                _studyInfo.就诊ID = str挂号ID;
            }
            else if (_studyInfo.患者来源 == "2")
            {
                _studyInfo.就诊ID = _studyInfo.主页ID.ToString();
            }
            else
            {
                _studyInfo.就诊ID = "";
            }


            _studyInfo.姓名 = gridView1.GetRowCellValue(intSelRow, "姓名").ToString();
            _studyInfo.性别 = gridView1.GetRowCellValue(intSelRow, "性别").ToString();
            _studyInfo.年龄 = gridView1.GetRowCellValue(intSelRow, "年龄").ToString();
            _studyInfo.身高 = "";    // gridView1.GetRowCellValue(intSelRow, "身高").ToString();
            _studyInfo.体重 = "";    // gridView1.GetRowCellValue(intSelRow, "体重").ToString();

            _studyInfo.住院号 = gridView1.GetRowCellValue(intSelRow, "住院号").ToString();
            _studyInfo.门诊号 = gridView1.GetRowCellValue(intSelRow, "门诊号").ToString();
            _studyInfo.检查号 = "";    // gridView1.GetRowCellValue(intSelRow, "检查号").ToString();

            _studyInfo.影像类别 = gridView1.GetRowCellValue(intSelRow, "影像类别").ToString();
            _studyInfo.执行科室 = gridView1.GetRowCellValue(intSelRow, "执行科室").ToString();
            _studyInfo.检查设备 = "";    // gridView1.GetRowCellValue(intSelRow, "检查设备").ToString();
            _studyInfo.符合情况 = "";    //gridView1.GetRowCellValue(intSelRow, "符合情况").ToString();
            //_studyInfo.报到时间 = "";//gridView1.GetRowCellValue(intSelRow, "报到时间").ToString();

            _studyInfo.登记人  = gridView1.GetRowCellValue(intSelRow, "登记人").ToString();
            _studyInfo.报到人  = "";   //gridView1.GetRowCellValue(intSelRow, "报到人").ToString();
            _studyInfo.完成人  = "";   //gridView1.GetRowCellValue(intSelRow, "完成人").ToString();
            _studyInfo.绿色通道 = "";   // gridView1.GetRowCellValue(intSelRow, "绿色通道").ToString();

            _studyInfo.项目摘要 = gridView1.GetRowCellValue(intSelRow, "项目摘要").ToString();
            _studyInfo.患者科室 = gridView1.GetRowCellValue(intSelRow, "患者科室").ToString();
            string strdt = gridView1.GetRowCellValue(intSelRow, "出生日期").ToString();

            _studyInfo.出生日期  = Convert.ToDateTime(strdt);
            _studyInfo.身份证号  = gridView1.GetRowCellValue(intSelRow, "身份证号").ToString();
            _studyInfo.联系人电话 = gridView1.GetRowCellValue(intSelRow, "联系人电话").ToString();


            System.Diagnostics.Debug.WriteLine("LoadOneData step2");
            ///////////////界面控件信息填充


            txtName.Text        = _studyInfo.姓名;
            txtAge.Text         = _studyInfo.年龄;
            dtp.Text            = _studyInfo.出生日期.ToString();
            cboSex.SelectedItem = _studyInfo.性别;

            txtPhoneNo.Text = _studyInfo.联系人电话;

            string strCheckID = _dbHelper.ExecuteSQLOneOutput("select max(检查号) from 影像检查信息").ToString();

            long lngNextID;

            if (strCheckID == "")
            {
                lngNextID = 1;
            }
            else
            {
                lngNextID  = Convert.ToInt64(strCheckID);
                lngNextID += 1;
            }
            txtCheckNo.Text = lngNextID.ToString();



            txtID.Text            = _studyInfo.身份证号;
            txtAdvice.Text        = _studyInfo.项目摘要;
            cboRoom.SelectedIndex = -1;
            DateTime dt = System.DateTime.Now;

            dt.ToString("yyyy-MM-dd HH24:MI:ss");
            txtRequestTime.Text = dt.ToString();

            txtOther.Text = "";
            txtH.Text     = "";
            txtW.Text     = "";

            dtp.Visible            = true;
            txtRequestTime.Visible = true;
            System.Diagnostics.Debug.WriteLine("LoadOneData ok");
        }