Ejemplo n.º 1
0
        public Model.Demographic GetByPID(int patientID)
        {
            Model.Demographic        d       = new Model.Demographic();
            List <Model.Demographic> myLists = GetModelList("PID = " + patientID.ToString());

            if (myLists != null & myLists.Count > 0)
            {
                d = myLists[0];
            }
            return(d);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        public bool SaveOrUpdate(Model.Demographic d)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("PID =" + d.PID);
            DataSet ds = GetList(sb.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                d.ID = int.Parse(ds.Tables[0].Rows[0]["PID"].ToString());
                return(this.Update(d));
            }
            else
            {
                return(this.Add(d));
            }
        }