/// <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; }
/// <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); }
/// <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; }
/// <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); }
public void SetEnt(BuAddress ent, IDataReader dr) { ent.Id = MyConvert.ToInt(dr["Id"]); ent.AddressName = MyConvert.ToString(dr["AddressName"]); }