Example #1
0
 /// <summary>
 /// 评估记录-保存
 /// </summary>
 /// <param name="pgData"></param>
 /// <param name="pgId"></param>
 /// <returns></returns>
 public int SaveGxyPgRecord(EntityGxyRecord gxyRecord, EntityGxyPg gxyPg, EntityGxyPgData pgData, out decimal pgId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveGxyPgRecord(gxyRecord, gxyPg, pgData, out pgId));
     }
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="gxyRecord"></param>
 /// <param name="recId"></param>
 /// <returns></returns>
 public int SaveGxyRecord(EntityGxyRecord gxyRecord, out decimal recId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveGxyRecord(gxyRecord, out recId));
     }
 }
Example #3
0
 /// <summary>
 /// 随访记录-保存
 /// </summary>
 /// <param name="sfData"></param>
 /// <param name="sfId"></param>
 /// <returns></returns>
 public int SaveGxySfRecord(EntityGxyRecord gxyRecord, EntityGxySf gxySf, EntityGxySfData sfData, out decimal sfId)
 {
     using (Biz205 biz = new Biz205())
     {
         return(biz.SaveGxySfRecord(gxyRecord, gxySf, sfData, out sfId));
     }
 }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void blbiAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            EntityClientGxyResult 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 <EntityGxyRecord> lstRecord = proxy.Service.GetGxyPatients(parms);

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

            EntityGxyRecord gxyRecorde = new EntityGxyRecord();

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

            using (ProxyHms proxy = new ProxyHms())
            {
                int affect = proxy.Service.SaveGxyRecord(gxyRecorde, out recId);
                if (affect > 0)
                {
                    isRefresh        = true;
                    gxyRecorde.recId = recId;
                    DialogBox.Msg("添加成功!");
                }
                else
                {
                    DialogBox.Msg("添加失败!");
                }
            }
        }
Example #5
0
 public frmPopup2050101(EntityGxyRecord _gxyRecord)
 {
     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";
         gxyRecord = _gxyRecord;
     }
 }
Example #6
0
        /// <summary>
        /// 添加计划
        /// </summary>
        public override void Copy()
        {
            if (mbglTab == EnumMbgltab.record)
            {
                if (this.gvGxyRecord.SelectedRowsCount > 0)
                {
                    EntityGxyRecord  gxyRecord = this.gvGxyRecord.GetRow(this.gvGxyRecord.GetSelectedRows()[0]) as EntityGxyRecord;
                    EntityClientInfo client    = new EntityClientInfo();
                    client = Function.MapperToModel(client, gxyRecord);
                    List <EntityClientInfo> lstClientInfo = new List <EntityClientInfo>();
                    lstClientInfo.Add(client);
                    //frm20401 frm = new frm20401(lstClientInfo);
                    //frm.ShowDialog();

                    object[] parm = new object[2];
                    parm[0] = GlobalParm.dicSysMenu["创建计划"];
                    Form frmMain = this.MdiParent;
                    System.Reflection.MethodInfo objMth = frmMain.GetType().GetMethod("ReflectionByAccVo");
                    objMth.Invoke(frmMain, parm);
                }
            }
        }
Example #7
0
        /// <summary>
        /// 评估记录-保存
        /// </summary>
        /// <param name="pgData"></param>
        /// <param name="pgId"></param>
        /// <returns></returns>
        public int SaveGxyPgRecord(EntityGxyRecord gxyRecord, EntityGxyPg gxyPg, EntityGxyPgData 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 (gxyPg.pgId <= 0)
                {
                    id                 = svc.GetNextID("gxyPg", "pgId");
                    gxyPg.status       = 1;
                    gxyPg.pgId         = id;
                    gxyPg.recordDate   = DateTime.Now;
                    gxyRecord.pgTimes += 1;
                    lstParm.Add(svc.GetInsertParm(gxyPg));

                    //高血压下次随访数据
                    string           sql   = @"update gxyRecord set pgTimes = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(2);
                    param[0].Value = gxyRecord.pgTimes;
                    param[1].Value = gxyRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    id = gxyPg.pgId;
                    lstParm.Add(svc.GetUpdateParm(gxyPg,
                                                  new List <string> {
                        EntityGxyPg.Columns.bloodPressLevel,
                        EntityGxyPg.Columns.dangerLevel,
                        EntityGxyPg.Columns.manageLevel,
                        EntityGxyPg.Columns.evaDate,
                    },
                                                  new List <string> {
                        EntityGxyPg.Columns.pgId
                    }));
                }
                pgData.pgId = id;
                //评估数据
                lstParm.Add(svc.GetDelParm(pgData, EntityGxyPgData.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);
        }
Example #8
0
        /// <summary>
        /// 随访记录-保存
        /// </summary>
        /// <param name="sfData"></param>
        /// <param name="sfId"></param>
        /// <returns></returns>
        public int SaveGxySfRecord(EntityGxyRecord gxyRecord, EntityGxySf gxySf, EntityGxySfData 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 (gxySf.sfId <= 0)
                {
                    id                 = svc.GetNextID("gxySf", "sfId");
                    gxySf.sfId         = id;
                    gxySf.sfStatus     = 1;
                    gxySf.recordDate   = DateTime.Now;
                    gxyRecord.sfId     = id;
                    gxyRecord.sfTimes += 1;
                    sfData.sfId        = id;
                    lstParm.Add(svc.GetInsertParm(gxySf));
                }
                else
                {
                    id = gxySf.sfId;
                    lstParm.Add(svc.GetUpdateParm(gxySf,
                                                  new List <string> {
                        EntityGxySf.Columns.sfMethod,
                        EntityGxySf.Columns.sfClass,
                        EntityGxySf.Columns.sfDate
                    },
                                                  new List <string> {
                        EntityGxySf.Columns.sfId
                    }));
                }
                //随访数据
                lstParm.Add(svc.GetDelParm(sfData, EntityGxySfData.Columns.sfId));
                lstParm.Add(svc.GetInsertParm(sfData));
                if (gxyRecord.sfTimes > 0)
                {
                    //高血压下次随访数据
                    string           sql   = @"update gxyRecord set manageLevel = ?, nextSfDate = ?, sfId = ?,sfTimes = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(5);
                    param[0].Value = gxyRecord.manageLevel;
                    param[1].Value = gxyRecord.nextSfDate;
                    param[2].Value = gxyRecord.sfId;
                    param[3].Value = gxyRecord.sfTimes;
                    param[4].Value = gxyRecord.recId;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    //高血压下次随访数据
                    string           sql   = @"update gxyRecord set manageLevel = ?, nextSfDate = ?, sfId = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(4);
                    param[0].Value = gxyRecord.manageLevel;
                    param[1].Value = gxyRecord.nextSfDate;
                    param[2].Value = gxyRecord.sfId;
                    param[3].Value = gxyRecord.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);
        }
Example #9
0
        /// <summary>
        /// 人员列表
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        public List <EntityGxyRecord> GetGxyPatients(List <EntityParm> parms)
        {
            List <EntityGxyRecord> 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 gxyRecord 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 <EntityGxyRecord>();
                EntityGxyRecord vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo            = new EntityGxyRecord();
                    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);
        }
Example #10
0
        /// <summary>
        /// 保存人员记录
        /// </summary>
        /// <param name="gxyRecord"></param>
        /// <param name="recId"></param>
        /// <returns></returns>
        public int SaveGxyRecord(EntityGxyRecord gxyRecord, out decimal recId)
        {
            int affectRows = 0;

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

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

                if (gxyRecord.recId <= 0)
                {
                    string sql = @"insert into gxyRecord(recid,clientno,regtimes,regno,beginDate,recorder,recorddate,status) values (?,?,?,?,?,?,?,?)";
                    id = svc.GetNextID("gxyRecord", "recId");
                    gxyRecord.recordDate = DateTime.Now;
                    gxyRecord.beginDate  = DateTime.Now;
                    gxyRecord.recorder   = "00";
                    IDataParameter[] param = svc.CreateParm(8);
                    param[0].Value = id;
                    param[1].Value = gxyRecord.clientNo;
                    param[2].Value = gxyRecord.regTimes;
                    param[3].Value = gxyRecord.regNo;
                    param[4].Value = gxyRecord.beginDate;
                    param[5].Value = gxyRecord.recorder;
                    param[6].Value = gxyRecord.recordDate;
                    param[7].Value = gxyRecord.status;
                    lstParm.Add(svc.GetDacParm(EnumExecType.ExecSql, sql, param));
                }
                else
                {
                    string           sql   = @"update gxyRecord set beginDate = ?, manageLevel = ?, nextSfDate = ? where recId = ?";
                    IDataParameter[] param = svc.CreateParm(4);
                    param[0].Value = gxyRecord.beginDate;
                    param[1].Value = gxyRecord.manageLevel;
                    param[2].Value = gxyRecord.nextSfDate;
                    param[3].Value = gxyRecord.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);
        }
Example #11
0
        /// <summary>
        /// SaveData
        /// </summary>
        /// <returns></returns>
        void SaveData()
        {
            if (gxySf == null)
            {
                gxySf       = new EntityGxySf();
                gxySf.recId = gxyRecord.recId;
            }

            if (gxyRecord == null)
            {
                gxyRecord       = new EntityGxyRecord();
                gxyRecord.recId = gxySf.recId;
            }

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

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

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

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

            using (ProxyHms proxy = new ProxyHms())
            {
                if (proxy.Service.SaveGxySfRecord(this.gxyRecord, this.gxySf, this.sfData, out sfId) > 0)
                {
                    this.IsRequireRefresh = true;
                    if (isNew)
                    {
                        this.gxySf.sfId     = sfId;
                        this.sfData.sfId    = sfId;
                        this.gxyRecord.sfId = sfId;
                    }

                    DialogBox.Msg("保存成功!");
                }
                else
                {
                    DialogBox.Msg("保存失败。");
                }
            }
        }
Example #12
0
        /// <summary>
        /// SaveData
        /// </summary>
        /// <returns></returns>
        void SaveData()
        {
            if (pgVo == null)
            {
                pgVo       = new EntityGxyPg();
                pgVo.recId = gxyRecord.recId;
            }
            if (gxyRecord == null)
            {
                gxyRecord       = new EntityGxyRecord();
                gxyRecord.recId = pgVo.recId;
            }
            if (chkXyfj01.Checked == true)
            {
                pgVo.bloodPressLevel = "1";
            }
            if (chkXyfj02.Checked == true)
            {
                pgVo.bloodPressLevel = "2";
            }
            if (chkXyfj03.Checked == true)
            {
                pgVo.bloodPressLevel = "3";
            }
            if (chkXyfj04.Checked == true)
            {
                pgVo.bloodPressLevel = "4";
            }
            if (chkXyfj05.Checked == true)
            {
                pgVo.bloodPressLevel = "5";
            }
            if (chkXyfj06.Checked == true)
            {
                pgVo.bloodPressLevel = "6";
            }

            if (chkWxfc01.Checked == true)
            {
                pgVo.dangerLevel = "1";
            }
            if (chkWxfc02.Checked == true)
            {
                pgVo.dangerLevel = "2";
            }
            if (chkWxfc03.Checked == true)
            {
                pgVo.dangerLevel = "3";
            }

            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 EntityGxyPgData();
            pgData.xmlData = GetData();
            decimal pgId  = 0;
            bool    isNew = this.pgVo.pgId <= 0 ? true : false;

            using (ProxyHms proxy = new ProxyHms())
            {
                if (proxy.Service.SaveGxyPgRecord(this.gxyRecord, 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("保存失败。");
                }
            }
        }