Example #1
0
        /// <summary>
        /// 插入一条联系方式记录
        /// </summary>
        /// <param name="linkway">联系方式类</param>
        /// <returns>影响的行数、-1 失败</returns>
        public int Insert(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkway)
        {
            string strSQL = "";

            //读取SQL语句
            if (this.Sql.GetSql("HealthReacord.Visit.LinkWay.Insert", ref strSQL) == -1)
            {
                this.Err = "没有找到HealthReacord.Visit.LinkWay.Insert字段!";
                return(-1);
            }
            try
            {
                //取联系方式流水号
                linkway.ID = this.GetSequence("HealthReacord.Visit.LinkWay.GetLinkWayID");
                if (linkway.ID == null)
                {
                    return(-1);
                }
                //获取传递参数
                string[] strParm = this.GetLinkWayParmItem(linkway);
                strSQL = string.Format(strSQL, strParm);
            }
            catch (Exception ex)
            {
                this.Err = "赋值时出错!" + ex.Message;
                return(-1);
            }

            //执行SQL语句返回
            return(this.ExecNoQuery(strSQL));
        }
Example #2
0
        /// <summary>
        /// 根据住院号或病历号查询患者联系人列表
        /// </summary>
        /// <param name="patientNo">住院号</param>
        /// <param name="cardNo">病历号</param>
        private void GetLinkWay(string patientNo, string cardNo)
        {
            fpLinkWay_Sheet1.RowCount = 0;

            ArrayList list = new ArrayList();

            list = linkWayManager.QueryLinkWay(patientNo, cardNo);
            if (list == null)
            {
                return;
            }
            fpLinkWay_Sheet1.Rows.Count = list.Count;
            for (int i = 0; i < list.Count; i++)
            {
                Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWayObj
                    = list[i] as Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay;


                if (linkWayObj != null)
                {
                    this.fpLinkWay_Sheet1.Cells[i, 0].Text = linkWayObj.Name;    //联系人
                    this.fpLinkWay_Sheet1.Cells[i, 1].Text = linkWayObj.Memo;    //与患者关系
                    this.fpLinkWay_Sheet1.Cells[i, 2].Text = linkWayObj.Phone;   //联系电话
                    this.fpLinkWay_Sheet1.Cells[i, 3].Text = linkWayObj.User01;  //电话状态
                    this.fpLinkWay_Sheet1.Cells[i, 4].Text = linkWayObj.Address; //联系地址
                    this.fpLinkWay_Sheet1.Cells[i, 5].Text = linkWayObj.Mail;    //电子邮件

                    this.fpLinkWay_Sheet1.Rows[i].Tag = linkWayObj;
                }
            }
        }
Example #3
0
 /// <summary>
 /// 获取Insert的参数
 /// </summary>
 /// <param name="linkway">联系方式实体类</param>
 /// <returns>返回参数数组</returns>
 private string[] GetLinkWayParmItem(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkway)
 {
     string[] strParm = new string[17];
     strParm[0] = linkway.ID;
     if (linkway.IsLinkMan)
     {
         strParm[1] = "1";
     }
     else
     {
         strParm[1] = "0";
     }
     strParm[2]  = linkway.LinkMan.Name;
     strParm[3]  = linkway.LinkWayType.ID;
     strParm[4]  = linkway.Relation.ID;
     strParm[5]  = linkway.Patient.PID.CardNO;
     strParm[6]  = linkway.ZIP;
     strParm[7]  = linkway.OperEnvi.ID;
     strParm[8]  = linkway.OperEnvi.OperTime.ToString();
     strParm[9]  = linkway.Address;
     strParm[10] = linkway.Mail;
     strParm[11] = linkway.Phone;
     strParm[12] = linkway.OtherLinkway;
     strParm[13] = linkway.Memo;
     strParm[14] = linkway.User01;
     strParm[15] = linkway.User02;
     strParm[16] = linkway.User03;
     //返回数组
     return(strParm);
 }
Example #4
0
        /// <summary>
        /// 执行SQL语句,读取linkWay实体信息到ArrayList中
        /// </summary>
        /// <param name="strSQL">需要执行的SQL语句</param>
        /// <returns>返回数组、错误返回null</returns>
        private ArrayList ReadLinkWayInfo(string strSQL)
        {
            this.ExecQuery(strSQL);

            ArrayList list = new ArrayList();

            Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWay = null;

            try
            {
                while (this.Reader.Read())
                {
                    linkWay = new Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay();

                    linkWay.ID = this.Reader[0].ToString();
                    if (this.Reader[1].ToString().Equals("1"))
                    {
                        linkWay.IsLinkMan = true;
                    }
                    else
                    {
                        linkWay.IsLinkMan = false;
                    }
                    linkWay.LinkMan.Name       = this.Reader[2].ToString();
                    linkWay.LinkWayType.ID     = this.Reader[3].ToString();
                    linkWay.Relation.ID        = this.Reader[4].ToString();
                    linkWay.Patient.PID.CardNO = this.Reader[5].ToString();
                    linkWay.ZIP               = this.Reader[6].ToString();
                    linkWay.OperEnvi.ID       = this.Reader[7].ToString();
                    linkWay.OperEnvi.OperTime = NConvert.ToDateTime(this.Reader[8].ToString());
                    linkWay.Address           = this.Reader[9].ToString();
                    linkWay.Mail              = this.Reader[10].ToString();
                    linkWay.Phone             = this.Reader[11].ToString();
                    linkWay.OtherLinkway      = this.Reader[12].ToString();
                    linkWay.Memo              = this.Reader[13].ToString();
                    linkWay.User01            = this.Reader[14].ToString();
                    linkWay.User02            = this.Reader[15].ToString();
                    linkWay.User03            = this.Reader[16].ToString();
                    linkWay.LinkWayType.Name  = this.Reader[17].ToString();
                    linkWay.Relation.Name     = this.Reader[18].ToString();
                    linkWay.OperEnvi.Name     = this.Reader[19].ToString();

                    list.Add(linkWay);
                }
            }
            catch (Exception ex)
            {
                this.Err = "读取联系方式出错!" + ex.Message;
                return(null);
            }
            finally
            {
                this.Reader.Close();
            }

            //返回数组
            return(list);
        }
Example #5
0
        /// <summary>
        /// 插入一条联系方式记录
        /// </summary>
        /// <param name="linkway">联系方式实体类</param>
        /// <returns>影响的行数、-1 失败</returns>
        public int InsertLinkWay(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkway)
        {
            this.SetDB(linkWayManager);

            int intReturn = linkWayManager.Insert(linkway);

            if (intReturn < 0)
            {
                this.Err = linkWayManager.Err;
                return(-1);
            }

            return(intReturn);
        }
Example #6
0
 /// <summary>
 /// 获取SQL语句参数
 /// </summary>
 /// <param name="linkWayObj">联系方式实体类</param>
 /// <returns>返回参数数组</returns>
 private string[] GetLinkWayParm(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWayObj)
 {
     return(new string[] { linkWayObj.ID,                    //唯一编号
                           linkWayObj.Patient.PID.PatientNO, //住院号
                           linkWayObj.Patient.PID.CardNO,    //病历号
                           linkWayObj.Name,                  //联系人
                           linkWayObj.Memo,                  //与患者关系
                           linkWayObj.Address,               //地址
                           linkWayObj.Mail,                  //电子邮箱
                           linkWayObj.Phone,                 //联系电话
                           linkWayObj.User01,                //电话状态
                           this.Operator.ID,                 //操作员
                           this.GetSysDateTime()             //操作时间
            });
 }
Example #7
0
        /// <summary>
        /// 删除联系人
        /// </summary>
        /// <param name="linkWayObj">联系方式实体类</param>
        /// <returns>失败返回-1</returns>
        public int DelLinkWay(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWayObj)
        {
            //获取主sql语句
            string strSQL = string.Empty;

            if (this.Sql.GetSql("HealthReacord.Visit.LinkWay.DeleteLinkWay", ref strSQL) == -1)
            {
                this.Err = "获取SQL语句:HealthReacord.Visit.LinkWay.DeleteLinkWay 失败";
                return(-1);
            }

            strSQL = string.Format(strSQL, linkWayObj.ID);

            return(this.ExecNoQuery(strSQL));
        }
Example #8
0
        /// <summary>
        /// 更新联系人
        /// </summary>
        /// <param name="linkWayObj">联系方式实体类</param>
        /// <returns>失败返回-1</returns>
        public int UpdateInsertLinkWay(Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWayObj)
        {
            //获取主sql语句
            string strSQL = string.Empty;

            if (this.Sql.GetSql("HealthReacord.Visit.LinkWay.UpdateLinkWay", ref strSQL) == -1)
            {
                this.Err = "获取SQL语句:HealthReacord.Visit.LinkWay.UpdateLinkWay 失败";
                return(-1);
            }

            //获取传递参数
            string[] strParm = GetLinkWayParm(linkWayObj);

            strSQL = string.Format(strSQL, strParm);

            return(this.ExecNoQuery(strSQL));
        }
Example #9
0
        /// <summary>
        /// 根据SQL语句,查询患者联系人列表
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        private ArrayList QueryLinkWayBySql(string strSql)
        {
            this.ExecQuery(strSql);

            ArrayList list = new ArrayList();

            Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay linkWay = null;

            try
            {
                while (this.Reader.Read())
                {
                    linkWay = new Neusoft.HISFC.Models.HealthRecord.Visit.LinkWay();

                    linkWay.ID      = this.Reader[0].ToString(); //唯一编号
                    linkWay.Name    = this.Reader[1].ToString(); //联系人
                    linkWay.Memo    = this.Reader[2].ToString(); //与患者关系
                    linkWay.Phone   = this.Reader[3].ToString(); //联系电话
                    linkWay.User01  = this.Reader[4].ToString(); //电话状态
                    linkWay.Address = this.Reader[5].ToString(); //联系地址
                    linkWay.Mail    = this.Reader[6].ToString(); //Email

                    list.Add(linkWay);
                }
            }
            catch (Exception ex)
            {
                this.Err = "读取联系方式出错!" + ex.Message;
                return(null);
            }
            finally
            {
                this.Reader.Close();
            }

            return(list);
        }