⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 patient.cs

📁 .net 开发的基础框架
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using Sybase.DataWindow;
using SPRFrame;

namespace HPIResource.PAT
{
    // 病人
    public class Patient : Sybase.DataWindow.DataStore
    {

        string strSQl = "";

        public Patient()
        {
            this.LibraryList = HPIR.PbdFile;
            this.DataWindowObject = "dw_patient_list";
            this.SetTransaction(SPRF.GetDB());
            strSQl = this.GetSqlSelect();
        }

        public void ResetSQL()
        {
            this.SetSqlSelect(strSQl);
        }

        #region 属性
        public string Pat_Id
        {// 病人ID
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "Pat_Id");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Id", value);
            }
        }
        public string Pat_Name
        {// 病人姓名
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "Pat_Name");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Name", value);
            }
        }
        public string Pat_Sex
        {// 性别
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "Pat_Sex");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Sex", value);
            }
        }
        
        public int Pat_Birthday
        {// 生日
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Pat_Birthday"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "Pat_Birthday", value);
            }
        }
        public int Pat_BirthTime
        {// 出生时间
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Pat_BirthTime"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "Pat_BirthTime", value);
            }
        }
        public int First_Date
        {// 首诊日期
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "First_Date"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "First_Date", value);
            }
        }
        public string Pat_Job
        {// 病人职业
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "Pat_Job");
                }
                catch
                {
                    return "无";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Job", value);
            }
        }
        public string Pat_Address
        {// 病人地址
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "Pat_Address");
                }
                catch
                {
                    return "无";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Address", value);
            }
        }
        public string Pat_Tel
        {// 病人电话
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "Pat_Tel");
                }
                catch
                {
                    return "0";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "Pat_Tel", value);
            }
        }
        #endregion

        #region  方法
        public void SetDataByPatId(string Pat_Id)
        {//根据病历号取数据
            this.ResetSQL();
            string SqlString = this.GetSqlSelect();
            SqlString += "where Pat_Id = '" + Pat_Id + "'";
            this.SetSqlSelect(SqlString);
        }
        public void SetDataByPatName(string Pat_Name)
        {//根据名字取数据
            this.ResetSQL();
            string SqlString = this.GetSqlSelect();
            SqlString += "where Pat_Name like '%" + Pat_Name + "%' order by Pat_Id";
            this.SetSqlSelect(SqlString);
        }
        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -