/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Gymnasium_APP.Model.PositionReservationInfoModel DataRowToModel(DataRow row)
 {
     Gymnasium_APP.Model.PositionReservationInfoModel model=new Gymnasium_APP.Model.PositionReservationInfoModel();
     if (row != null)
     {
         if(row["ID"]!=null && row["ID"].ToString()!="")
         {
             model.ID=int.Parse(row["ID"].ToString());
         }
         if(row["PositionName"]!=null)
         {
             model.PositionName=row["PositionName"].ToString();
         }
         if(row["DTime"]!=null)
         {
             model.DTime=row["DTime"].ToString();
         }
         if(row["Name"]!=null)
         {
             model.Name=row["Name"].ToString();
         }
         if(row["Phone"]!=null)
         {
             model.Phone=row["Phone"].ToString();
         }
         if(row["State"]!=null)
         {
             model.State=row["State"].ToString();
         }
         if(row["ReservationNum"]!=null)
         {
             model.ReservationNum=row["ReservationNum"].ToString();
         }
         if(row["TypeName"]!=null)
         {
             model.TypeName=row["TypeName"].ToString();
         }
         if(row["HTime"]!=null)
         {
             model.HTime=row["HTime"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Gymnasium_APP.Model.PositionReservationInfoModel GetModel(int ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 ID,PositionName,DTime,Name,Phone,State,ReservationNum,TypeName,HTime from PositionReservationInfo ");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.Int,4)			};
            parameters[0].Value = ID;

            Gymnasium_APP.Model.PositionReservationInfoModel model=new Gymnasium_APP.Model.PositionReservationInfoModel();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }