Exemplo n.º 1
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuCityInfo> GetBuCityInfoList(string Where)
        {
            List <BuCityInfo> list = new List <BuCityInfo>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuCityInfo ent = new BuCityInfo();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据CityCode得到 BuCityInfo 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuCityInfo GetBuCityInfo(string CityCode)
        {
            BuCityInfo ent = null;
            string     sql = DalSql;

            sql = sql + " And  CityCode";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("CityCode", CityCode)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuCityInfo();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Exemplo n.º 3
0
 public void SetEnt(BuCityInfo ent, IDataReader dr)
 {
     ent.CityCode   = MyConvert.ToString(dr["CityCode"]);
     ent.CityName   = MyConvert.ToString(dr["CityName"]);
     ent.ProvinceId = MyConvert.ToInt(dr["ProvinceId"]);
 }