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

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

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