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

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

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