示例#1
0
 /// <summary>
 /// 将数据信息加载到DataGridView中
 /// </summary>
 /// <param name="row"></param>
 /// <param name="qcWorkloadStatInfo"></param>
 private void SetRowData(DataGridViewRow row, EMRDBLib.QcSpecialCheck qcSpecialCheck)
 {
     if (row == null || qcSpecialCheck == null)
     {
         return;
     }
     if (row.DataGridView == null)
     {
         return;
     }
     row.Cells[this.colCreater.Index].Value          = qcSpecialCheck.Creater;
     row.Cells[this.colCreateTime.Index].Value       = qcSpecialCheck.CreateTime != qcSpecialCheck.DefaultTime ? qcSpecialCheck.CreateTime.ToString("yyyy-MM-dd") : "";
     row.Cells[this.colDischargeMode.Index].Value    = qcSpecialCheck.DischargeMode;
     row.Cells[this.colEndTime.Index].Value          = qcSpecialCheck.EndTime != qcSpecialCheck.DefaultTime ? qcSpecialCheck.EndTime.ToString("yyyy-MM-dd") : "";
     row.Cells[this.colName.Index].Value             = qcSpecialCheck.Name;
     row.Cells[this.colPatientCondition.Index].Value = qcSpecialCheck.PatientCondition;
     row.Cells[this.colPatientCount.Index].Value     = qcSpecialCheck.PatientCount.ToString();
     row.Cells[this.colPerCount.Index].Value         = qcSpecialCheck.PerCount;
     row.Cells[this.colSpecialCount.Index].Value     = qcSpecialCheck.SpecialCount;
     row.Cells[this.colStartTime.Index].Value        = qcSpecialCheck.StartTime != qcSpecialCheck.DefaultTime ? qcSpecialCheck.StartTime.ToString("yyyy-MM-dd") : "";
     row.Cells[this.colChecked.Index].Value          = qcSpecialCheck.Checked;
     row.Tag = qcSpecialCheck;
 }
示例#2
0
        private void btnSaveResult_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                MessageBoxEx.ShowWarning("请设置本次抽检名称");
                this.txtName.Focus();
                return;
            }
            if (this.numCount.Value == 0)
            {
                MessageBoxEx.ShowWarning("请输入每科室抽检的病案数");
                this.numCount.Focus();
                return;
            }
            if (this.dataGridView1.Rows.Count <= 0)
            {
                MessageBoxEx.ShowWarning("未抽检出病案信息");
                return;
            }
            if (this.dgvDetailList.Rows.Count <= 0)
            {
                MessageBoxEx.ShowWarning("请选择专家!");
                return;
            }
            if (this.m_QcSpecialCheck == null || this.m_QcSpecialCheck.ConfigID == string.Empty)
            {
                this.m_QcSpecialCheck            = new QcSpecialCheck();
                this.m_QcSpecialCheck.ConfigID   = this.m_QcSpecialCheck.MakeConfigID();
                this.m_QcSpecialCheck.Creater    = SystemParam.Instance.UserInfo.USER_NAME;
                this.m_QcSpecialCheck.CreateTime = DateTime.Now;
            }
            this.m_QcSpecialCheck.Name             = this.txtName.Text.Trim();
            this.m_QcSpecialCheck.DischargeMode    = this.cboDischargeMode.Text.Trim();
            this.m_QcSpecialCheck.PatientCondition = this.cboPatientCondition.Text.Trim();
            this.m_QcSpecialCheck.PatientCount     = this.dataGridView1.Rows.Count;
            this.m_QcSpecialCheck.PerCount         = int.Parse(this.numCount.Text);
            this.CheckdgvDetailInfos();//移除分配为0份病案的专家
            this.m_QcSpecialCheck.SpecialCount = this.dgvDetailList.Rows.Count;
            this.m_QcSpecialCheck.StartTime    = this.dtpBeginTime.Value;
            this.m_QcSpecialCheck.EndTime      = this.dtpEndTime.Value;
            short shRet = SystemData.ReturnValue.OK;

            if (this.IsNew)
            {
                shRet = SpecialAccess.Instance.SaveQCSpecialCheck(this.m_QcSpecialCheck);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.ShowError("保存失败");
                    this.m_QcSpecialCheck = null;
                    return;
                }
            }
            else
            {
                shRet = SpecialAccess.Instance.UpdateQCSpecialCheck(this.m_QcSpecialCheck);
                if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
                {
                    MessageBoxEx.ShowError("保存失败");
                    return;
                }
            }
            //保存专家质控病案分配详情信息
            //先删除之前的配置信息
            if (!this.IsNew)
            {
                shRet = SpecialAccess.Instance.DeleteQCSpecialDetail(this.m_QcSpecialCheck.ConfigID);
            }
            //再保存分配信息
            for (int detailIndex = 0; detailIndex < this.dgvDetailList.Rows.Count; detailIndex++)
            {
                DataGridViewRow     detailRow      = this.dgvDetailList.Rows[detailIndex];
                List <PatVisitInfo> lstPatVisitLog = detailRow.Cells[this.colPatientCount.Index].Tag as List <PatVisitInfo>;
                Specialist          specialist     = detailRow.Tag as Specialist;
                if (specialist == null)
                {
                    continue;
                }
                if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
                {
                    continue;
                }
                foreach (PatVisitInfo item in lstPatVisitLog)
                {
                    QcSpecialDetail qcSpecialDetail = new QcSpecialDetail();
                    qcSpecialDetail.ConfigID    = this.m_QcSpecialCheck.ConfigID;
                    qcSpecialDetail.PatientID   = item.PATIENT_ID;
                    qcSpecialDetail.VisitID     = item.VISIT_ID;
                    qcSpecialDetail.SpecialID   = specialist.UserID;
                    qcSpecialDetail.SpecialName = specialist.UserName;
                    shRet = SpecialAccess.Instance.SaveQCSpecialDetail(qcSpecialDetail);
                    if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
                    {
                        MessageBoxEx.ShowError("病案分配详情保存失败!");
                        return;
                    }
                }
            }
            MessageBoxEx.ShowMessage("保存成功");
            this.IsNew = false;
        }