Esempio n. 1
0
 /// <summary>
 /// DeleteRpt
 /// </summary>
 #region
 void DeleteRpt()
 {
     vo = GetRowObject();
     if (vo.rptId <= 0)
     {
         return;
     }
     else
     {
         vo.status = -1;
         using (ProxyAdverseEvent proxy = new ProxyAdverseEvent())
         {
             if (proxy.Service.ComfirmRpt(vo) > 0)
             {
                 DialogBox.Msg("删除成功");
                 vo = null;
             }
             else
             {
                 DialogBox.Msg("删除失败");
                 vo = null;
             }
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="vo"></param>
        /// <returns></returns>
        internal int ComfirmRpt(EntityInfectionus vo)
        {
            int       affectRows = 0;
            string    Sql        = string.Empty;
            SqlHelper svc        = null;

            try
            {
                #region Sql
                svc = new SqlHelper(EnumBiz.onlineDB);
                Sql = @"update rptinfectionus set status = ? where rptid = ?";

                IDataParameter[] parm = svc.CreateParm(2);
                parm[0].Value = vo.status;
                parm[1].Value = vo.rptId;

                #endregion
                affectRows = svc.ExecSql(Sql, parm);
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Esempio n. 3
0
 /// <summary>
 /// 审核
 /// </summary>
 /// <param name="EntityInfectionus"></param>
 /// <returns></returns>
 public int ComfirmRpt(EntityInfectionus vo)
 {
     using (bizAdverseInfectionus biz = new bizAdverseInfectionus())
     {
         return(biz.ComfirmRpt(vo));
     }
 }
Esempio n. 4
0
        /// <summary>
        /// ConfirmRpt
        /// </summary>
        /// <param name="flg">1 审核通过 2 审核未通过 0 反审核</param>
        #region
        void ConfirmRpt(int flg)
        {
            vo = GetRowObject();
            if (vo.rptId <= 0)
            {
                return;
            }
            if ((flg == 1 && vo.status == 1) || (flg == 2 && vo.status == 2))
            {
                DialogBox.Msg("已审核");
            }
            else
            {
                vo.status = flg;
                using (ProxyAdverseEvent proxy = new ProxyAdverseEvent())
                {
                    if (proxy.Service.ComfirmRpt(vo) > 0)
                    {
                        if (flg == 1)
                        {
                            if (this.gvReport.FocusedRowHandle > 0)
                            {
                                this.gvReport.Appearance.SelectedRow.ForeColor = Color.Green;
                            }
                            DialogBox.Msg("审核成功");
                        }
                        else if (flg == 2)
                        {
                            if (this.gvReport.FocusedRowHandle > 0)
                            {
                                this.gvReport.Appearance.SelectedRow.ForeColor = Color.Red;
                            }
                            DialogBox.Msg("审核成功");
                        }
                        else
                        {
                            if (this.gvReport.FocusedRowHandle > 0)
                            {
                                this.gvReport.Appearance.SelectedRow.ForeColor = Color.Black;
                            }
                            DialogBox.Msg("反审核成功");
                        }

                        vo = null;
                    }
                    else
                    {
                        if (flg == 1)
                        {
                            DialogBox.Msg("审核失败");
                        }
                        else
                        {
                            DialogBox.Msg("反审核失败");
                        }
                        vo = null;
                    }
                }
            }
        }
Esempio n. 5
0
 /// <summary>
 /// 保存不良事件
 /// </summary>
 /// <param name="EntityInfectionus"></param>
 /// <param name="EntityPathogeny"></param>
 /// <returns></returns>
 public int SaveInfectionus(EntityInfectionus infectionusVo, List <EntityPathogeny> lstPathogenyVo)
 {
     using (bizAdverseInfectionus biz = new bizAdverseInfectionus())
     {
         return(biz.SaveInfectionus(infectionusVo, lstPathogenyVo));
     }
 }
Esempio n. 6
0
        /// <summary>
        /// EditRpt
        /// </summary>
        #region
        void EditRpt()
        {
            EntityPatientInfo pat = new EntityPatientInfo();

            vo = GetRowObject();
            decimal rptId = vo.rptId;

            using (ProxyAdverseEvent proxy = new ProxyAdverseEvent())
            {
                this.gvSampleBindingSource.DataSource = proxy.Service.GetPathogeny(rptId);
            }

            this.txtAge.Text     = vo.patAge;
            this.txtBedNo.Text   = vo.bedNo;
            this.txtInpatid.Text = vo.inpatNo;
            this.txtIpNo.Text    = vo.inpatNo;
            this.cboPatDept.Text = vo.deptName;
            this.cboPatDept.Properties.Items.Clear();
            this.txtName.Text     = vo.patName;
            this.txtSex.Text      = vo.patSex;
            this.dteInDate.Text   = vo.dateIn.ToString();
            this.mmtDiagnose.Text = vo.inDiagnosis;
            if (vo.incisionType == 1)
            {
                this.chk01.Checked = true;
            }
            if (vo.incisionType == 2)
            {
                this.chk02.Checked = true;
            }
            if (vo.incisionType == 3)
            {
                this.chk03.Checked = true;
            }
            if (vo.incisionType == 4)
            {
                this.chk04.Checked = true;
            }

            this.cboInfectionSite01.Text = vo.infectionSite01;
            this.cboInfectionSite01.Properties.Items.Clear();
            this.cboInfectionSite02.Text = vo.infectionSite02;
            this.cboInfectionSite02.Properties.Items.Clear();
            this.dteInfection01.Text = vo.infectionDate01.ToString();
            this.dteInfection02.Text = vo.infectionDate02.ToString();
            this.cboCausation.Text   = vo.infectionReason;
            this.cboCausation.Properties.Items.Clear();
            this.txtDoctor.Text        = vo.doctName;
            this.dteOperationDate.Text = vo.operationDate.ToString();
            this.txtOperationName.Text = vo.operationName;
            this.txtName.Tag           = pat;
        }
Esempio n. 7
0
 /// <summary>
 /// 审核
 /// </summary>
 public override void Confirm()
 {
     vo = GetRowObject();
     //frmInfectionusConfirm frm = new frmInfectionusConfirm(vo);
     //frm.ShowDialog();
     if (DialogBox.Msg("审核通过请点“是”,未通过请点“否”!", MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ConfirmRpt(1);
     }
     else
     {
         ConfirmRpt(2);
     }
     this.Query();
 }
Esempio n. 8
0
        private void gvReport_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
        {
            int hand = e.RowHandle;

            if (hand < 0)
            {
                return;
            }
            EntityInfectionus vo = this.gvReport.GetRow(hand) as EntityInfectionus;

            if (vo.status == 1)
            {
                e.Appearance.ForeColor = Color.Green;// 改变行字体颜色
            }
            if (vo.status == 2)
            {
                e.Appearance.ForeColor = Color.Red;// 改变行字体颜色
            }
            vo = null;
        }
Esempio n. 9
0
        /// <summary>
        /// getInfectionusValue
        /// </summary>
        #region
        void GetInfectionusValue(ref EntityInfectionus vo, EntityPatientInfo pat)
        {
            vo.patName     = pat.name;
            vo.inpatNo     = pat.ipNo;
            vo.patSex      = pat.sex;
            vo.patAge      = pat.age;
            vo.deptCode    = pat.deptCode;
            vo.birthDay    = Function.Datetime((Function.Datetime(pat.birth)).ToString("yyyy-MM-dd"));
            vo.doctId      = pat.doctCode;
            vo.dateIn      = Function.Datetime(pat.inDate);
            vo.doctName    = this.txtDoctor.Text;
            vo.inDiagnosis = this.mmtDiagnose.Text;

            if (this.chk01.Checked == true)
            {
                vo.incisionType = 1;
            }
            if (this.chk02.Checked == true)
            {
                vo.incisionType = 2;
            }
            if (this.chk03.Checked == true)
            {
                vo.incisionType = 3;
            }
            if (this.chk04.Checked == true)
            {
                vo.incisionType = 4;
            }

            vo.infectionSite01 = this.cboInfectionSite01.Text;
            vo.infectionSite02 = this.cboInfectionSite02.Text;
            vo.infectionDate01 = this.dteInfection01.Text;
            vo.infectionDate02 = this.dteInfection02.Text;
            vo.infectionReason = this.cboCausation.Text;
            vo.operationName   = this.txtOperationName.Text;
            vo.operationDate   = this.dteOperationDate.Text;
        }
Esempio n. 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="rptId"></param>
        /// <returns></returns>
        public List <EntityInfectionus> GetXrDataSource(decimal rptId)
        {
            string Sql  = string.Empty;
            string Sql1 = string.Empty;
            List <EntityInfectionus> data = new List <EntityInfectionus>();
            SqlHelper svc = null;

            try
            {
                #region Sql
                Sql = @"select t.rptid,
                               t.reporttime,
                               t.inpatno,
                               t.patname,
                               t.patsex,
                               t.patage,
                               t.bedno,
                               t.datein,
                               t.recorddate,
                               t.deptcode,
                               t.indiagnosis,
                               t.incisiontype,
                               t.infectionsite01,
                               t.infectionsite02,
                               t.infectiondate01,
                               t.infectiondate02,
                               t.infectionreason,
                               t.reportername,
                               t.reporterid,
                               t.status,
                               b.deptname_vchr as deptname,
                               e.lastname_vchr as doctname,
                               t.operationdate,
                               t.operationname
                          from rptinfectionus t
                          left join t_bse_deptdesc b
                            on t.deptcode = b.CODE_VCHR
                          left join t_bse_employee e
                            on e.empno_chr = t.doctid
                         where t.rptid = ? ";


                Sql1 = @"select sampleName, checkDate, pathogenyName, drugName  
                          from rptpathogeny where rptid = ? ";

                svc = new SqlHelper(EnumBiz.onlineDB);
                IDataParameter[] parm  = null;
                IDataParameter[] parm1 = null;
                parm           = svc.CreateParm(1);
                parm[0].Value  = rptId;
                parm1          = svc.CreateParm(1);
                parm1[0].Value = rptId;
                DataTable         dt  = svc.GetDataTable(Sql, parm);
                DataTable         dt1 = svc.GetDataTable(Sql1, parm1);
                EntityInfectionus vo  = null;
                #endregion

                #region 赋值

                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt1 != null && dt1.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt1.Rows)
                        {
                            vo = new EntityInfectionus();

                            vo.rptId        = Function.Int(dt.Rows[0]["rptid"].ToString());
                            vo.reportTime   = dt.Rows[0]["reporttime"].ToString();
                            vo.reporterName = dt.Rows[0]["reportername"].ToString();
                            vo.inpatNo      = dt.Rows[0]["inpatno"].ToString();
                            vo.patName      = dt.Rows[0]["patname"].ToString();
                            vo.patSex       = dt.Rows[0]["patsex"].ToString() == "1" ? "男" : "女";
                            vo.patAge       = dt.Rows[0]["patage"].ToString();
                            vo.deptName     = dt.Rows[0]["deptname"].ToString();
                            vo.dateIn       = Function.Datetime(dt.Rows[0]["datein"].ToString());
                            vo.incisionType = Function.Int(dt.Rows[0]["incisiontype"].ToString());
                            if (vo.incisionType == 1)
                            {
                                vo.incisionType01 = 1;
                            }
                            if (vo.incisionType == 2)
                            {
                                vo.incisionType02 = 1;
                            }
                            if (vo.incisionType == 3)
                            {
                                vo.incisionType03 = 1;
                            }
                            if (vo.incisionType == 4)
                            {
                                vo.incisionType04 = 1;
                            }

                            vo.infectionDate01 = dt.Rows[0]["infectiondate01"].ToString();
                            vo.infectionDate02 = dt.Rows[0]["infectiondate02"].ToString();
                            vo.infectionSite01 = dt.Rows[0]["infectionsite01"].ToString();
                            vo.infectionSite02 = dt.Rows[0]["infectionsite02"].ToString();
                            vo.infectionReason = dt.Rows[0]["infectionreason"].ToString();
                            vo.operationName   = dt.Rows[0]["operationname"].ToString();
                            vo.operationDate   = dt.Rows[0]["operationdate"].ToString();
                            vo.doctName        = dt.Rows[0]["doctname"].ToString();
                            vo.reporterName    = dt.Rows[0]["reportername"].ToString();
                            vo.reporterId      = dt.Rows[0]["reporterid"].ToString();
                            vo.status          = Function.Int(dt.Rows[0]["status"].ToString());
                            vo.inDiagnosis     = dt.Rows[0]["indiagnosis"].ToString();
                            vo.operationName   = dt.Rows[0]["operationname"].ToString();
                            vo.operationDate   = dt.Rows[0]["operationdate"].ToString();

                            vo.sampleName    = dr["sampleName"].ToString();
                            vo.checkDate     = dr["checkDate"].ToString();
                            vo.pathogenyName = dr["pathogenyName"].ToString();
                            vo.drugName      = dr["drugName"].ToString();

                            data.Add(vo);
                        }
                    }
                    else
                    {
                        vo = new EntityInfectionus();

                        vo.rptId        = Function.Int(dt.Rows[0]["rptid"].ToString());
                        vo.reportTime   = dt.Rows[0]["reporttime"].ToString();
                        vo.reporterName = dt.Rows[0]["reportername"].ToString();
                        vo.inpatNo      = dt.Rows[0]["inpatno"].ToString();
                        vo.patName      = dt.Rows[0]["patname"].ToString();
                        //vo.patSex = dt.Rows[0]["patsex"].ToString() == "1" ? "男" : "女";
                        if (dt.Rows[0]["patsex"].ToString() == "1")
                        {
                            vo.patSex = "男";
                        }
                        else if (dt.Rows[0]["patsex"].ToString() == "2")
                        {
                            vo.patSex = "女";
                        }
                        else
                        {
                            vo.patSex = "\\";
                        }
                        vo.patAge       = dt.Rows[0]["patage"].ToString();
                        vo.deptName     = dt.Rows[0]["deptname"].ToString();
                        vo.dateIn       = Function.Datetime(dt.Rows[0]["datein"].ToString());
                        vo.incisionType = Function.Int(dt.Rows[0]["incisiontype"].ToString());
                        if (vo.incisionType == 1)
                        {
                            vo.incisionType01 = 1;
                        }
                        if (vo.incisionType == 2)
                        {
                            vo.incisionType02 = 1;
                        }
                        if (vo.incisionType == 3)
                        {
                            vo.incisionType03 = 1;
                        }
                        if (vo.incisionType == 4)
                        {
                            vo.incisionType04 = 1;
                        }

                        vo.infectionDate01 = dt.Rows[0]["infectiondate01"].ToString();
                        vo.infectionDate02 = dt.Rows[0]["infectiondate02"].ToString();
                        vo.infectionSite01 = dt.Rows[0]["infectionsite01"].ToString();
                        vo.infectionSite02 = dt.Rows[0]["infectionsite02"].ToString();
                        vo.infectionReason = dt.Rows[0]["infectionreason"].ToString();
                        vo.operationName   = dt.Rows[0]["operationname"].ToString();
                        vo.operationDate   = dt.Rows[0]["operationdate"].ToString();
                        vo.doctName        = dt.Rows[0]["doctname"].ToString();
                        vo.reporterName    = dt.Rows[0]["reportername"].ToString();
                        vo.reporterId      = dt.Rows[0]["reporterid"].ToString();
                        vo.status          = Function.Int(dt.Rows[0]["status"].ToString());
                        vo.inDiagnosis     = dt.Rows[0]["indiagnosis"].ToString();
                        vo.operationName   = dt.Rows[0]["operationname"].ToString();
                        vo.operationDate   = dt.Rows[0]["operationdate"].ToString();

                        data.Add(vo);
                    }
                }
                #endregion
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
            }
            finally
            {
                svc = null;
            }

            return(data);
        }
Esempio n. 11
0
        /// <summary>
        /// 获取感染报告列表
        /// </summary>
        /// <param name="dicParm"></param>
        /// <returns></returns>
        internal List <EntityInfectionus> GetInfectionusList(List <EntityParm> dicParm)
        {
            string Sql  = string.Empty;
            string Sql1 = string.Empty;
            List <EntityInfectionus> data = new List <EntityInfectionus>();
            SqlHelper svc = null;

            try
            {
                #region Sql
                svc = new SqlHelper(EnumBiz.onlineDB);
                Sql = @"select t.rptid,
                               t.reporttime,
                               t.inpatno,
                               t.patname,
                               t.patsex,
                               t.patage,
                               t.bedno,
                               t.datein,
                               t.recorddate,
                               t.deptcode,
                               t.indiagnosis,
                               t.incisiontype,
                               t.infectionsite01,
                               t.infectionsite02,
                               t.infectiondate01,
                               t.infectiondate02,
                               t.infectionreason,
                               t.reportername,
                               t.reporterid,
                               t.status,
                               b.deptname_vchr as deptname,
                               e.lastname_vchr as doctname,
                               t.operationdate,
                               t.operationname
                          from rptinfectionus t
                          left join t_bse_deptdesc b
                            on t.deptcode = b.CODE_VCHR
                          left join t_bse_employee e
                            on e.empno_chr = t.doctid
                         where t.status in (0,1,2)";
                #endregion

                #region 条件

                string strSub = string.Empty;
                List <IDataParameter> lstParm = new List <IDataParameter>();
                // 默认参数
                IDataParameter parm = null;

                foreach (EntityParm po in dicParm)
                {
                    parm = svc.CreateParm();
                    string keyValue = po.value;
                    parm.Value = keyValue;
                    switch (po.key)
                    {
                    case "reportDate":
                        IDataParameter parm1 = svc.CreateParm();
                        parm1.Value = keyValue.Split('|')[0] + " 00:00:00";
                        lstParm.Add(parm1);
                        IDataParameter parm2 = svc.CreateParm();
                        parm2.Value = keyValue.Split('|')[1] + " 23:59:59";
                        lstParm.Add(parm2);
                        strSub += " and (t.reporttime between ? and ?)";
                        break;

                    case "deptCode":
                        if (keyValue.IndexOf("','") > 0)
                        {
                            strSub += " and (t.deptcode in (" + keyValue + "))";
                        }
                        else
                        {
                            parm.Value = parm.Value.ToString().Replace("'", "");
                            lstParm.Add(parm);
                            strSub += " and (t.deptcode = ?)";
                        }
                        break;

                    case "cardNo":
                        lstParm.Add(parm);
                        strSub += " and (t.inpatno = ?)";
                        break;

                    case "patName":
                        Sql        = Sql1;
                        parm.Value = "%" + keyValue + "%";
                        lstParm.Add(parm);
                        strSub += " and (t.patname like ?)";
                        break;

                    case "areaStr":
                        strSub += " and (t.deptcode in (" + keyValue + ")";
                        break;

                    case "selfId":
                        strSub += " or t.reporterid = '" + keyValue + "')";
                        break;

                    case "limitId":
                        strSub += " and (t.reporterid in (" + keyValue + "))";
                        break;

                    default:
                        break;
                    }
                }

                #endregion

                #region 赋值

                // 组合条件
                Sql += strSub;
                Sql += " order by t.reporttime";
                DataTable dt = svc.GetDataTable(Sql, lstParm.ToArray());
                if (dt != null)
                {
                    EntityInfectionus vo = null;
                    foreach (DataRow dr in dt.Rows)
                    {
                        vo = new EntityInfectionus();
                        //vo.rptIdStr = dr["rptId"].ToString();
                        vo.rptId        = Function.Int(dr["rptid"].ToString());
                        vo.reportTime   = dr["reporttime"].ToString();
                        vo.reporterName = dr["reportername"].ToString();
                        vo.inpatNo      = dr["inpatno"].ToString();
                        vo.patName      = dr["patname"].ToString();
                        //vo.patSex = dr["patsex"].ToString() == "1" ? "男" : "女";
                        if (dr["patSex"].ToString() == "1")
                        {
                            vo.patSex = "男";
                        }
                        else if (dr["patSex"].ToString() == "2")
                        {
                            vo.patSex = "女";
                        }
                        else
                        {
                            vo.patSex = "\\";
                        }
                        vo.patAge          = dr["patage"].ToString();
                        vo.deptName        = dr["deptname"].ToString();
                        vo.dateIn          = Function.Datetime(dr["datein"].ToString());
                        vo.incisionType    = Function.Int(dr["incisiontype"].ToString());
                        vo.infectionDate01 = dr["infectiondate01"].ToString();
                        vo.infectionDate02 = dr["infectiondate02"].ToString();
                        vo.infectionSite01 = dr["infectionsite01"].ToString();
                        vo.infectionSite02 = dr["infectionsite02"].ToString();
                        vo.infectionReason = dr["infectionreason"].ToString();
                        vo.operationName   = dr["operationname"].ToString();
                        vo.operationDate   = dr["operationdate"].ToString();
                        vo.doctName        = dr["doctname"].ToString();
                        vo.reporterName    = dr["reportername"].ToString();
                        vo.reporterId      = dr["reporterid"].ToString();
                        vo.status          = Function.Int(dr["status"].ToString());
                        vo.inDiagnosis     = dr["indiagnosis"].ToString();
                        vo.operationName   = dr["operationname"].ToString();
                        vo.operationDate   = dr["operationdate"].ToString();
                        if (vo.status == 1)
                        {
                            vo.isPass = "******";
                        }
                        else if (vo.status == 2)
                        {
                            vo.isPass = "******";
                        }
                        else
                        {
                            vo.isPass = "";
                        }
                        data.Add(vo);
                    }
                }
                #endregion
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
            }
            finally
            {
                svc = null;
            }
            return(data);
        }
Esempio n. 12
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="vo"></param>
        /// <param name="lstPathogenyVo"></param>
        /// <param name="rptId"></param>
        /// <returns></returns>
        internal int SaveInfectionus(EntityInfectionus vo, List <EntityPathogeny> lstPathogenyVo)
        {
            int       affectRows = 0;
            decimal   rptId      = 0;
            decimal   serNo      = 0;
            string    Sql        = string.Empty;
            SqlHelper svc        = null;

            try
            {
                List <DacParm> lstParm = new List <DacParm>();
                svc = new SqlHelper(EnumBiz.onlineDB);

                if (vo.rptId <= 0)  // new
                {
                    rptId = Function.Dec(GetNextID(svc, "rptinfectionus").ToString());

                    vo.rptId = rptId;
                    lstParm.Add(svc.GetInsertParm(vo));

                    foreach (EntityPathogeny item in lstPathogenyVo)
                    {
                        serNo      = Function.Dec(GetNextID(svc, "rptpathogeny").ToString());
                        item.serNo = serNo;
                        item.rptId = rptId;
                    }

                    if (lstPathogenyVo.Count > 0)
                    {
                        lstParm.Add(svc.GetInsertParm(lstPathogenyVo.ToArray()));
                    }

                    affectRows = svc.Commit(lstParm);
                }
                else                // edit
                {
                    #region Sql
                    svc = new SqlHelper(EnumBiz.onlineDB);
                    Sql = @"update rptinfectionus set 
                            reportTime = ?, inDiagnosis = ?, incisionType = ?,  infectionSite01 = ?, 
                            infectionSite02 = ?, infectionDate01 = ?, infectionDate02 = ?, infectionreason = ?,  
                            operationName = ?, operationDate = ?,recordDate = ?, status = ? where rptid = ?";

                    IDataParameter[] parm = svc.CreateParm(13);
                    parm[0].Value  = vo.reportTime;
                    parm[1].Value  = vo.inDiagnosis;
                    parm[2].Value  = vo.incisionType;
                    parm[3].Value  = vo.infectionSite01;
                    parm[4].Value  = vo.infectionSite02;
                    parm[5].Value  = vo.infectionDate01;
                    parm[6].Value  = vo.infectionDate02;
                    parm[7].Value  = vo.infectionReason;
                    parm[8].Value  = vo.operationName;
                    parm[9].Value  = vo.operationDate;
                    parm[10].Value = vo.recordDate;
                    parm[11].Value = vo.status;
                    parm[12].Value = vo.rptId;
                    #endregion
                    //lstParm.Add(svc.ExecSql(Sql, parm));
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, Sql, parm));
                    Sql           = @"delete from  rptPathogeny where rptId = ?";
                    parm          = svc.CreateParm(1);
                    parm[0].Value = vo.rptId;
                    //lstParm.Add(svc.ExecSql(Sql, parm));
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, Sql, parm));

                    foreach (EntityPathogeny item in lstPathogenyVo)
                    {
                        serNo      = Function.Dec(GetNextID(svc, "rptpathogeny").ToString());
                        item.serNo = serNo;
                        item.rptId = vo.rptId;
                    }

                    if (lstPathogenyVo.Count > 0)
                    {
                        lstParm.Add(svc.GetInsertParm(lstPathogenyVo.ToArray()));
                    }

                    affectRows = svc.Commit(lstParm);
                }
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Esempio n. 13
0
        /// <summary>
        /// 保存
        /// </summary>
        #region
        public override void Save()
        {
            EntityPatientInfo patVo = this.txtName.Tag as EntityPatientInfo;

            if (this.txtName.Tag == null)
            {
                DialogBox.Msg("请先调出患者信息。");
                return;
            }

            if (vo != null && vo.rptId > 0 && vo.status == 1)
            {
                DialogBox.Msg("已审核不可修改,请先反审核");
                return;
            }

            this.gvSample.CloseEditor();
            this.gvSample.UpdateCurrentRow();

            if (vo == null)
            {
                vo = new EntityInfectionus();
            }
            DateTime dtmNow = Utils.ServerTime();

            GetInfectionusValue(ref vo, patVo);
            if (vo.rptId <= 0)
            {
                vo.reportTime   = dtmNow.ToString("yyyy-MM-dd HH:mm:ss");
                vo.reporterId   = GlobalLogin.objLogin.EmpNo;
                vo.reporterName = GlobalLogin.objLogin.EmpName;
            }

            vo.recordDate = dtmNow;
            List <EntityPathogeny> data = new List <EntityPathogeny>();

            for (int i = this.gvSample.RowCount - 1; i >= 0; i--)
            {
                if (this.gvSample.GetRowCellValue(i, "sampleName") != null && !string.IsNullOrEmpty(this.gvSample.GetRowCellValue(i, "sampleName").ToString()))
                {
                    EntityPathogeny pathogenyVo = new EntityPathogeny();
                    pathogenyVo.sampleName    = this.gvSample.GetRowCellValue(i, "sampleName").ToString();
                    pathogenyVo.checkDate     = Function.Datetime(this.gvSample.GetRowCellValue(i, "checkDate").ToString()).ToString("yyyy-MM-dd");
                    pathogenyVo.pathogenyName = this.gvSample.GetRowCellValue(i, "pathogenyName").ToString();
                    pathogenyVo.drugName      = this.gvSample.GetRowCellValue(i, "drugName").ToString();

                    data.Add(pathogenyVo);
                }
                else
                {
                    this.gvSample.DeleteRow(i);
                }
            }

            using (ProxyAdverseEvent proxy = new ProxyAdverseEvent())
            {
                if (proxy.Service.SaveInfectionus(vo, data) >= 0)
                {
                    DialogBox.Msg("保存成功");
                    vo = null;
                }
                else
                {
                    DialogBox.Msg("保存失败");
                    vo = null;
                }
            }
            this.txtName.Tag = null;
            this.Query();
        }