コード例 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _nowTimer.Elapsed  += NowTimer_Elapsed;
            _nowTimer.Enabled   = true;
            _nowTimer.AutoReset = true; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
            _nowTimer.Start();
            lbDoctorName.Text = ConfigHelper.LoginName.Trim();
            if (ConfigHelper.IsAdmin)
            {
                btnDoctorInfos.Visible = true;
            }
            _openBlood = new Task(OpenBloodSport);
            _openBlood.Start();

            _getTask = new Task(GetToken);
            _getTask.Start();

            panelFill.Controls.Clear();
            var pif = new PatientInfoForm(null)
            {
                TopLevel = false, FormBorderStyle = FormBorderStyle.None
            };

            panelFill.Controls.Add(pif);
            pif.Dock = DockStyle.Fill;
            pif.Show();

            PaintImage();
        }
コード例 #2
0
        /// <summary>
        /// 基本信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnInfo_Click(object sender, EventArgs e)
        {
            btnInfo.BackgroundImage         = Properties.Resources.xinxiAfter;
            btnPatientInfos.BackgroundImage = Properties.Resources.jiankuang;
            btnEcg.BackgroundImage          = Properties.Resources.xindian;
            btnMmhg.BackgroundImage         = Properties.Resources.xueya;
            btnSpo2.BackgroundImage         = Properties.Resources.xueyang;
            btnC.BackgroundImage            = Properties.Resources.tiwen;
            btnMmol.BackgroundImage         = Properties.Resources.xuetang;
            btnUrine.BackgroundImage        = Properties.Resources.niaochanggui;
            btnDoctorInfos.BackgroundImage  = Properties.Resources.yisheng;
            btnSystemInfo.BackgroundImage   = Properties.Resources.xitong;

            panelFill.Controls.Clear();
            var pif = new PatientInfoForm(null)
            {
                TopLevel = false, FormBorderStyle = FormBorderStyle.None
            };

            panelFill.Controls.Add(pif);
            pif.Dock = DockStyle.Fill;
            pif.Show();
        }
コード例 #3
0
        private void gc_PatientManage_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            if (gc_PatientManage.RowCount > 0)
            {
                _rowIndex = e.RowIndex;
                DataRow dr        = ((DataRowView)gc_PatientManage.Rows[e.RowIndex].DataBoundItem).Row;
                string  patientId = string.Empty;
                if (null != dr)
                {
                    patientId               = dr["PatientID"].ToString();
                    qrCodePatientId.Text    = @"YJL-" + patientId;
                    qrCodePatientId.Visible = true;
                }
                #region  除
                if (gc_PatientManage.Columns[e.ColumnIndex] == DeletePatient)
                {
                    if (gc_EcgList.RowCount > 0)
                    {
                        bool status = Check_App_status(patientId);
                        if (status)
                        {
                            XtraMessageBox.Show(@"此患者已有关联信息,不允许删除!", @"提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }

                    if (XtraMessageBox.Show(@"是否确定删除选中的患者?", @"患者删除提示:", MessageBoxButtons.OKCancel,
                                            MessageBoxIcon.Warning) == DialogResult.OK)
                    {
                        var sqls = new string[6];
                        sqls[0] = "DELETE FROM data_packs WHERE ApplicationID in(select ApplicationID from tb_Application where patientID='" + patientId + "')";
                        sqls[1] = "DELETE FROM Tb_Snapshot WHERE ApplicationID in(select ApplicationID from tb_Application where patientID='" + patientId + "')";
                        sqls[2] = "DELETE FROM AutoDiagnosis WHERE ApplicationID in(select ApplicationID from tb_Application where patientID='" + patientId + "')";
                        sqls[3] = "delete from Tb_ReportTitle where ApplicationID in(select ApplicationID from tb_Application where patientID='" + patientId + "')";
                        sqls[4] = "DELETE FROM tb_Application WHERE PatientID='" + patientId + "'";
                        sqls[5] = "DELETE FROM Tb_PatientInfo WHERE PatientID='" + patientId + "'";
                        WatchDog.WriteMsg(DateTime.Now + "==删除数据:" + dr["PatientName"] + ",患者ID:" + patientId);

                        DataTable tbl       = _sqlite.ExcuteSqlite("SELECT * FROM data_packs WHERE ApplicationID in(select ApplicationID from tb_Application where patientID='" + patientId + "')");
                        bool      isSuccess = _sqlite.SqliteExecuteNonQuery(sqls);
                        if (isSuccess)
                        {
                            if (tbl != null && tbl.Rows.Count > 0)
                            {
                                string ednPathDir = Application.StartupPath + "\\ECG_DATA_NEW";
                                for (int j = 0; j < tbl.Rows.Count; j++)
                                {
                                    if (tbl.Rows[j]["pureData"] == DBNull.Value)
                                    {
                                        try
                                        {
                                            File.Delete(ednPathDir + "\\" + tbl.Rows[j]["ApplicationID"].ToString() + "_" + tbl.Rows[j]["isLead"].ToString());
                                        }
                                        catch
                                        { }
                                    }
                                }
                            }
                        }
                        var pIndex = (int)Math.Ceiling(Convert.ToDouble(_recordCount) / ConfigHelper.PAGE_SIZE);
                        if (_recordCount % ConfigHelper.PAGE_SIZE == 0 && wp.PageIndex == pIndex)
                        {
                            if (wp.PageIndex > 1)
                            {
                                wp.PageIndex = wp.PageIndex - 1;
                            }
                        }
                        gc_EcgList.DataSource = null;
                        wp.Bind();


                        txtID.Text = string.Empty;
                        //XtraMessageBox.Show("患者信息删除成功!");
                        qrCodePatientId.Visible = false;
                    }
                    if (gc_PatientManage.RowCount > 0)
                    {
                        gc_PatientManage.CurrentCell = gc_PatientManage.Rows[e.RowIndex].Cells[0];
                    }
                }
                #endregion

                #region 绑定右侧历史数据

                if (gc_PatientManage.Columns[e.ColumnIndex] != EcgGather &&
                    gc_PatientManage.Columns[e.ColumnIndex] != EditPatient &&
                    gc_PatientManage.Columns[e.ColumnIndex] != DeletePatient)
                {
                    SelEcgList(patientId);
                }

                #endregion

                #region 公共卫生信息
                if (gc_PatientManage.Columns[e.ColumnIndex] == EditPatient)
                {
                    if (dr != null)
                    {
                        string pId = dr["PatientID"].ToString();
                        var    pif = new PatientInfoForm(pId)
                        {
                            WindowState = FormWindowState.Maximized
                        };
                        pif.ShowDialog();
                    }
                    gc_PatientManage.CurrentCell = gc_PatientManage.Rows[e.RowIndex].Cells[0];
                }
                #endregion
            }
            else
            {
                gc_EcgList.DataSource = null;
            }
        }