Ejemplo n.º 1
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));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// ctor
 /// </summary>
 public frmPopup2050101(EntityGxySf _sfVo)
 {
     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";
         this.gxySf = _sfVo;
     }
 }
Ejemplo n.º 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)
        {
            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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 随访记录-获取
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        public List <EntityGxySf> GetGxySfRecords(List <EntityParm> parms)
        {
            List <EntityGxySf> data = null;
            SqlHelper          svc  = new SqlHelper(EnumBiz.onlineDB);
            string             Sql  = string.Empty;

            Sql = @" select a.recId,
                           b.clientNo,
                           b.clientName,
                           b.gender,
                           b.birthday,
                           b.gradeName,
                          a.sfId,
                           a.sfDate,
                           a.sfMethod,
                           a.sfClass,
                           e.xmlData,
                           d.oper_name as sfRecorder
                      from gxySf a
                     left join  gxyRecord c
                        on a.recId = c.recId 
											inner join V_ClientInfo  b
                        on c.clientNo = b.clientNo and c.regTimes = b.regTimes
                     left join gxySfData e
						       on a.sfId =  e.sfId
                      left join code_operator d
                        on a.sfRecorder = d.oper_code
								where a.sfStatus = 1 "                                ;

            DataTable dt = svc.GetDataTable(Sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                data = new List <EntityGxySf>();
                EntityGxySf vo = null;
                foreach (DataRow dr in dt.Rows)
                {
                    vo           = new EntityGxySf();
                    vo.recId     = Function.Dec(dr["recId"]);
                    vo.sfId      = Function.Int(dr["sfId"]);
                    vo.sfDateStr = dr["sfDate"] == DBNull.Value ? "" : Function.Datetime(dr["sfDate"]).ToString("yyyy-MM-dd HH:mm");
                    Function.SetClientInfo(ref vo, dr);
                    int sfMethod = Function.Int(dr["sfMethod"]);
                    if (sfMethod == 1)
                    {
                        vo.sfMethod = "上门";
                    }
                    if (sfMethod == 2)
                    {
                        vo.sfMethod = "电话";
                    }
                    if (sfMethod == 3)
                    {
                        vo.sfMethod = "门诊";
                    }
                    vo.sfClass    = (dr["sfClass"].ToString() == "01" ? "普通" : "其他");
                    vo.sfData     = dr["xmlData"].ToString();
                    vo.sfRecorder = dr["sfRecorder"].ToString();
                    data.Add(vo);
                }
            }
            return(data);
        }
Ejemplo n.º 5
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("保存失败。");
                }
            }
        }