Beispiel #1
0
 /// <summary>
 /// 随访记录-保存
 /// </summary>
 /// <param name="tnbRecord"></param>
 /// <param name="tnbSf"></param>
 /// <param name="sfData"></param>
 /// <param name="sfId"></param>
 /// <returns></returns>
 public int SaveTnbSfRecord(EntityTnbRecord tnbRecord, EntityTnbSf tnbSf, EntityTnbSfData sfData, out decimal sfId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveTnbSfRecord(tnbRecord, tnbSf, sfData, out sfId));
     }
 }
Beispiel #2
0
 /// <summary>
 /// 评估记录-保存
 /// </summary>
 /// <param name="pgData"></param>
 /// <param name="pgId"></param>
 /// <returns></returns>
 public int SaveTnbPgRecord(EntityTnbRecord tnbRecord, EntityTnbPg tnbPg, EntityTnbPgData pgData, out decimal pgId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveTnbPgRecord(tnbRecord, tnbPg, pgData, out pgId));
     }
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="tnbRecord"></param>
 /// <param name="recId"></param>
 /// <returns></returns>
 public int SaveTnbRecord(EntityTnbRecord tnbRecord, out decimal recId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveTnbRecord(tnbRecord, out recId));
     }
 }
Beispiel #4
0
        private void blbiAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            EntityClientTnbResult gxyResult = GetRowObject();

            if (gxyResult == null)
            {
                return;
            }
            List <EntityParm> parms = new List <EntityParm>();
            EntityParm        vo1   = new EntityParm();

            vo1.key   = "clientNo";
            vo1.value = gxyResult.clientNo;
            parms.Add(vo1);

            EntityParm vo2 = new EntityParm();

            vo2.key   = "regTimes";
            vo2.value = gxyResult.regTimes.ToString();
            parms.Add(vo2);

            using (ProxyHms proxy = new ProxyHms())
            {
                List <EntityTnbRecord> lstRecord = proxy.Service.GetTnbPatients(parms);

                if (lstRecord != null)
                {
                    DialogBox.Msg("人员已添加,请重新选择!");
                    return;
                }
            }

            EntityTnbRecord tnbRecorde = new EntityTnbRecord();

            tnbRecorde.clientNo  = gxyResult.clientNo;
            tnbRecorde.regNo     = gxyResult.regNo;
            tnbRecorde.beginDate = DateTime.Now;
            tnbRecorde.regTimes  = gxyResult.regTimes;
            tnbRecorde.status    = 0;
            decimal recId = 0;

            using (ProxyHms proxy = new ProxyHms())
            {
                int affect = proxy.Service.SaveTnbRecord(tnbRecorde, out recId);
                if (affect > 0)
                {
                    isRefresh        = true;
                    tnbRecorde.recId = recId;
                    DialogBox.Msg("添加成功!");
                }
                else
                {
                    DialogBox.Msg("添加失败!");
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// SaveData
        /// </summary>
        /// <returns></returns>
        void SaveData()
        {
            if (pgVo == null)
            {
                pgVo       = new EntityTnbPg();
                pgVo.recId = tnbRecord.recId;
            }
            if (tnbRecord == null)
            {
                tnbRecord       = new EntityTnbRecord();
                tnbRecord.recId = pgVo.recId;
            }

            if (chkManageLevel01.Checked == true)
            {
                pgVo.manageLevel = "1";
            }
            if (chkManageLevel02.Checked == true)
            {
                pgVo.manageLevel = "2";
            }
            if (chkManageLevel03.Checked == true)
            {
                pgVo.manageLevel = "3";
            }

            pgVo.evaluator = lueEnaOper.EditValue.ToString();
            pgVo.evaDate   = Function.Datetime(dteEnaDate.Text);
            pgData         = new EntityTnbPgData();
            pgData.xmlData = GetData();
            decimal pgId  = 0;
            bool    isNew = this.pgVo.pgId <= 0 ? true : false;

            using (ProxyHms proxy = new ProxyHms())
            {
                if (proxy.Service.SaveTnbPgRecord(this.tnbRecord, this.pgVo, this.pgData, out pgId) > 0)
                {
                    this.IsRequireRefresh = true;
                    if (isNew)
                    {
                        this.pgVo.pgId   = pgId;
                        this.pgData.pgId = pgId;
                    }

                    DialogBox.Msg("保存成功!");
                }
                else
                {
                    DialogBox.Msg("保存失败。");
                }
            }
        }
Beispiel #6
0
 public frmPopup2050201(EntityTnbRecord _tnbRecord)
 {
     InitializeComponent();
     this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
     if (!DesignMode)
     {
         this.lueSfOper.LookAndFeel.UseDefaultLookAndFeel = false;
         this.lueSfOper.LookAndFeel.SkinName = "Black";
         this.lueSfRecorder.LookAndFeel.UseDefaultLookAndFeel = false;
         this.lueSfRecorder.LookAndFeel.SkinName = "Black";
         tnbRecord = _tnbRecord;
     }
 }
Beispiel #7
0
        /// <summary>
        /// 随访记录-保存
        /// </summary>
        /// <param name="sfData"></param>
        /// <param name="sfId"></param>
        /// <returns></returns>
        public int SaveTnbSfRecord(EntityTnbRecord tnbRecord, EntityTnbSf tnbSf, EntityTnbSfData sfData, out decimal sfId)
        {
            int affectRows = 0;

            sfId = 0;
            string    Sql = string.Empty;
            SqlHelper svc = null;
            decimal   id  = 0;

            try
            {
                svc = new SqlHelper(EnumBiz.onlineDB);
                List <DacParm> lstParm = new List <DacParm>();
                svc = new SqlHelper(EnumBiz.onlineDB);
                if (tnbSf.sfId <= 0)
                {
                    id                 = svc.GetNextID("tnbSf", "sfId");
                    tnbSf.sfId         = id;
                    tnbSf.sfStatus     = 1;
                    tnbSf.recordDate   = DateTime.Now;
                    tnbRecord.sfId     = id;
                    tnbRecord.sfTimes += 1;
                    sfData.sfId        = id;
                    lstParm.Add(svc.GetInsertParm(tnbSf));
                }
                else
                {
                    id = tnbSf.sfId;
                    lstParm.Add(svc.GetUpdateParm(tnbSf,
                                                  new List <string> {
                        EntityTnbSf.Columns.sfMethod,
                        EntityTnbSf.Columns.sfClass,
                        EntityTnbSf.Columns.sfDate
                    },
                                                  new List <string> {
                        EntityTnbSf.Columns.sfId
                    }));
                }
                //随访数据
                lstParm.Add(svc.GetDelParm(sfData, EntityTnbSfData.Columns.sfId));
                lstParm.Add(svc.GetInsertParm(sfData));
                if (tnbRecord.sfTimes > 0)
                {
                    //高血压下次随访数据
                    string           sql   = @"update tnbRecord set manageLevel = ?, nextSfDate = ?, sfId = ?,sfTimes = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(5);
                    param[0].Value = tnbRecord.manageLevel;
                    param[1].Value = tnbRecord.nextSfDate;
                    param[2].Value = tnbRecord.sfId;
                    param[3].Value = tnbRecord.sfTimes;
                    param[4].Value = tnbRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    //高血压下次随访数据
                    string           sql   = @"update tnbRecord set manageLevel = ?, nextSfDate = ?, sfId = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(4);
                    param[0].Value = tnbRecord.manageLevel;
                    param[1].Value = tnbRecord.nextSfDate;
                    param[2].Value = tnbRecord.sfId;
                    param[3].Value = tnbRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }

                if (lstParm.Count > 0)
                {
                    affectRows = svc.Commit(lstParm);
                }
                sfId = id;
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Beispiel #8
0
        /// <summary>
        /// 保存人员记录
        /// </summary>
        /// <param name="tnbRecord"></param>
        /// <param name="recId"></param>
        /// <returns></returns>
        public int SaveTnbRecord(EntityTnbRecord tnbRecord, out decimal recId)
        {
            int affectRows = 0;

            recId = 0;
            string    Sql = string.Empty;
            SqlHelper svc = null;

            try
            {
                if (tnbRecord == null)
                {
                    return(-1);
                }
                decimal        id      = 0;
                List <DacParm> lstParm = new List <DacParm>();
                svc = new SqlHelper(EnumBiz.onlineDB);

                if (tnbRecord.recId <= 0)
                {
                    string sql = @"insert into tnbRecord(recid,clientno,regtimes,regno,beginDate,recorder,recorddate,status) values (?,?,?,?,?,?,?,?)";
                    id = svc.GetNextID("tnbRecord", "recId");
                    tnbRecord.recordDate = DateTime.Now;
                    tnbRecord.beginDate  = DateTime.Now;
                    tnbRecord.recorder   = "00";
                    IDataParameter[] param = svc.CreateParm(8);
                    param[0].Value = id;
                    param[1].Value = tnbRecord.clientNo;
                    param[2].Value = tnbRecord.regTimes;
                    param[3].Value = tnbRecord.regNo;
                    param[4].Value = tnbRecord.beginDate;
                    param[5].Value = tnbRecord.recorder;
                    param[6].Value = tnbRecord.recordDate;
                    param[7].Value = tnbRecord.status;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    string           sql   = @"update tnbRecord set beginDate = ?, manageLevel = ?, nextSfDate = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(4);
                    param[0].Value = tnbRecord.beginDate;
                    param[1].Value = tnbRecord.manageLevel;
                    param[2].Value = tnbRecord.nextSfDate;
                    param[3].Value = tnbRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                recId = id;

                if (lstParm.Count > 0)
                {
                    affectRows = svc.Commit(lstParm);
                }
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Beispiel #9
0
        /// <summary>
        /// 人员列表
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        public List <EntityTnbRecord> GetTnbPatients(List <EntityParm> parms)
        {
            List <EntityTnbRecord> data = null;
            SqlHelper svc = new SqlHelper(EnumBiz.onlineDB);
            string    Sql = string.Empty;

            Sql = @"select a.recId,a.regNo,
                           b.clientNo,
                           b.clientName,
                           a.regTimes,
                           b.gender,
                           b.birthday,
                           b.gradeName,
                           b.company,
                           manageLevel,
                           sfTimes ,
                           pgTimes ,
                           a.beginDate,
                           a.nextSfDate,
                           0 as planTimes
                      from tnbRecord a
                     inner join V_ClientInfo b
                        on a.clientNo = b.clientNo  and a.regTimes = b.regTimes
                    where a.recid >= 0 ";
            string subStr = string.Empty;
            List <IDataParameter> lstParm = new List <IDataParameter>();

            if (parms != null)
            {
                foreach (var po in parms)
                {
                    switch (po.key)
                    {
                    case "queryDate":
                        IDataParameter[] param = svc.CreateParm(2);
                        param[0].Value = po.value.Split('|')[0] + " 00:00:00";
                        param[1].Value = po.value.Split('|')[1] + " 23:59:59";
                        subStr        += " and a.recordDate between ? and ?";
                        lstParm.AddRange(param);
                        break;

                    case "clientNo":
                        subStr += " and a.clientNo = '" + po.value + "'";
                        break;

                    case "regTimes":
                        subStr += " and a.regTimes = '" + po.value + "'";
                        break;

                    default:
                        break;
                    }
                }
            }
            Sql += subStr;
            DataTable dt = svc.GetDataTable(Sql, lstParm);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityTnbRecord>();
                EntityTnbRecord vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo            = new EntityTnbRecord();
                    vo.recId      = Function.Dec(dr["recId"]);
                    vo.regNo      = dr["regNo"].ToString();
                    vo.regTimes   = Function.Int(dr["regTimes"]);
                    vo.clientNo   = dr["clientNo"].ToString();
                    vo.clientName = dr["clientName"].ToString();
                    string gender = dr["gender"].ToString();
                    if (gender == "1")
                    {
                        vo.sex = "男";
                    }
                    else if (gender == "2")
                    {
                        vo.sex = "女";
                    }
                    vo.age          = dr["birthday"] == DBNull.Value ? "" : Function.CalcAge(Function.Datetime(dr["birthday"]));
                    vo.gradeName    = dr["gradeName"].ToString();
                    vo.company      = dr["company"].ToString();
                    vo.beginDateStr = dr["beginDate"] == DBNull.Value ? "" : Function.Datetime(dr["beginDate"]).ToString("yyyy-MM-dd HH:mm");
                    vo.manageLevel  = dr["manageLevel"].ToString();
                    if (vo.manageLevel == "1")
                    {
                        vo.manageLevel = "一级管理";
                    }
                    if (vo.manageLevel == "2")
                    {
                        vo.manageLevel = "二级管理";
                    }
                    if (vo.manageLevel == "3")
                    {
                        vo.manageLevel = "三级管理";
                    }
                    vo.sfNextDateStr = dr["nextSfDate"] == DBNull.Value ? "" : Function.Datetime(dr["nextSfDate"]).ToString("yyyy-MM-dd HH:mm");
                    vo.sfTimes       = Function.Dec(dr["sfTimes"]);
                    vo.pgTimes       = Function.Dec(dr["pgTimes"]);

                    data.Add(vo);
                }
            }
            return(data);
        }
Beispiel #10
0
        /// <summary>
        /// 评估记录-保存
        /// </summary>
        /// <param name="pgData"></param>
        /// <param name="pgId"></param>
        /// <returns></returns>
        public int SaveTnbPgRecord(EntityTnbRecord tnbRecord, EntityTnbPg tnbPg, EntityTnbPgData pgData, out decimal pgId)
        {
            int affectRows = 0;

            pgId = 0;
            string    Sql = string.Empty;
            SqlHelper svc = null;
            decimal   id  = 0;

            try
            {
                svc = new SqlHelper(EnumBiz.onlineDB);
                List <DacParm> lstParm = new List <DacParm>();
                svc = new SqlHelper(EnumBiz.onlineDB);
                if (tnbPg.pgId <= 0)
                {
                    id                 = svc.GetNextID("tnbPg", "pgId");
                    tnbPg.status       = 1;
                    tnbPg.pgId         = id;
                    tnbPg.recordDate   = DateTime.Now;
                    tnbRecord.pgTimes += 1;
                    lstParm.Add(svc.GetInsertParm(tnbPg));

                    //糖尿病下次随访数据
                    string           sql   = @"update tnbRecord set pgTimes = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(2);
                    param[0].Value = tnbRecord.pgTimes;
                    param[1].Value = tnbRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    id = tnbPg.pgId;
                    lstParm.Add(svc.GetUpdateParm(tnbPg,
                                                  new List <string> {
                        EntityTnbPg.Columns.dangerLevel,
                        EntityTnbPg.Columns.manageLevel,
                        EntityTnbPg.Columns.evaDate,
                    },
                                                  new List <string> {
                        EntityTnbPg.Columns.pgId
                    }));
                }
                pgData.pgId = id;
                //评估数据
                lstParm.Add(svc.GetDelParm(pgData, EntityTnbPgData.Columns.pgId));
                lstParm.Add(svc.GetInsertParm(pgData));
                if (lstParm.Count > 0)
                {
                    affectRows = svc.Commit(lstParm);
                }
                pgId = id;
            }
            catch (Exception e)
            {
                ExceptionLog.OutPutException(e);
                affectRows = -1;
            }
            finally
            {
                svc = null;
            }
            return(affectRows);
        }
Beispiel #11
0
        /// <summary>
        /// SaveData
        /// </summary>
        /// <returns></returns>
        void SaveData()
        {
            if (tnbSf == null)
            {
                tnbSf       = new EntityTnbSf();
                tnbSf.recId = tnbRecord.recId;
            }

            if (tnbRecord == null)
            {
                tnbRecord       = new EntityTnbRecord();
                tnbRecord.recId = tnbSf.recId;
            }

            tnbSf.sfDate          = Function.Datetime(dteSfDate.Text);
            tnbSf.sfMethod        = string.Empty;
            tnbSf.sfClass         = string.Empty;
            tnbRecord.manageLevel = string.Empty;
            if (chkSffs01.Checked == true)
            {
                tnbSf.sfMethod = "1";
            }
            if (chkSffs02.Checked == true)
            {
                tnbSf.sfMethod = "2";
            }
            if (chkSffs03.Checked == true)
            {
                tnbSf.sfClass = "3";
            }
            if (chkSfClass01.Checked == true)
            {
                tnbSf.sfClass = "1";
            }
            if (chkSfClass02.Checked == true)
            {
                tnbSf.sfClass = "2";
            }
            if (chkSfClass03.Checked == true)
            {
                tnbSf.sfClass = "3";
            }
            if (chkSfClass04.Checked == true)
            {
                tnbSf.sfClass = "4";
            }
            if (chkManageLevel01.Checked == true)
            {
                tnbRecord.manageLevel = "1";
            }
            if (chkManageLevel02.Checked == true)
            {
                tnbRecord.manageLevel = "2";
            }
            if (chkManageLevel03.Checked == true)
            {
                tnbRecord.manageLevel = "3";
            }
            if (string.IsNullOrEmpty(tnbSf.sfMethod))
            {
                DialogBox.Msg("随访形式必选 !");
                return;
            }
            if (string.IsNullOrEmpty(tnbSf.sfClass))
            {
                DialogBox.Msg("随访分类必选 !");
                return;
            }
            if (string.IsNullOrEmpty(tnbRecord.manageLevel))
            {
                DialogBox.Msg("管理等级必选 !");
                return;
            }

            tnbSf.sfRecorder = this.lueSfRecorder.EditValue.ToString();
            tnbSf.sfStatus   = 1;
            if (this.sfData == null)
            {
                this.sfData = new EntityTnbSfData();
            }
            this.sfData.sfId    = tnbSf.sfId;
            this.sfData.xmlData = this.GetData();

            if (!string.IsNullOrEmpty(dteNextSfDate.Text))
            {
                tnbRecord.nextSfDate = Function.Datetime(dteNextSfDate.Text);
            }

            decimal sfId  = 0;
            bool    isNew = this.sfData.sfId <= 0 ? true : false;

            using (ProxyHms proxy = new ProxyHms())
            {
                if (proxy.Service.SaveTnbSfRecord(this.tnbRecord, this.tnbSf, this.sfData, out sfId) > 0)
                {
                    this.IsRequireRefresh = true;
                    if (isNew)
                    {
                        this.tnbSf.sfId     = sfId;
                        this.sfData.sfId    = sfId;
                        this.tnbRecord.sfId = sfId;
                    }

                    DialogBox.Msg("保存成功!");
                }
                else
                {
                    DialogBox.Msg("保存失败。");
                }
            }
        }