Beispiel #1
0
 /// <summary>
 /// 得到列表
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public List<BuAddress> GetBuAddressList(string Where)
 {
     List<BuAddress> list = new List<BuAddress>();
     using(DbDataReader reader = DataBaseManage.ExecuteReader(DalSql+Where))
     {
         while (reader.Read())
         {
            BuAddress ent = new BuAddress();
             SetEnt(ent, reader);
             list.Add(ent);
         }
     }
     return list;
 }
Beispiel #2
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuAddress> GetBuAddressList(string Where)
        {
            List <BuAddress> list = new List <BuAddress>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuAddress ent = new BuAddress();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Beispiel #3
0
 /// <summary>
 /// 根据Id得到 BuAddress 实体
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public BuAddress GetBuAddress(int Id)
 {
     BuAddress ent = null;
     string sql = DalSql;
     sql = sql + " And  Id";
     MySqlParameter[] paras = new MySqlParameter[]
     {
         new MySqlParameter("Id",Id)
     };
     using(DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
     {
         if (reader.Read())
         {
             ent = new BuAddress();
             SetEnt(ent, reader);
         }
        		}
     return ent;
 }
Beispiel #4
0
        /// <summary>
        /// 根据Id得到 BuAddress 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuAddress GetBuAddress(int Id)
        {
            BuAddress ent = null;
            string    sql = DalSql;

            sql = sql + " And  Id";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("Id", Id)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuAddress();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Beispiel #5
0
 public void SetEnt(BuAddress ent, IDataReader dr)
 {
     ent.Id          = MyConvert.ToInt(dr["Id"]);
     ent.AddressName = MyConvert.ToString(dr["AddressName"]);
 }
Beispiel #6
0
 public void SetEnt(BuAddress ent, IDataReader dr)
 {
     ent.Id = MyConvert.ToInt(dr["Id"]);
     ent.AddressName = MyConvert.ToString(dr["AddressName"]);
 }