Exemplo n.º 1
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <ProductCategoryInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <ProductCategoryInfoModel> productcategoryinfos = new List <ProductCategoryInfoModel>();

            ProductCategoryInfoModel productcategoryinfo = new ProductCategoryInfoModel();
            DataTable dt = DbUtil.Current.RetrieveMultiple(productcategoryinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                productcategoryinfo = new ProductCategoryInfoModel();
                productcategoryinfo.ConvertFrom(dt, i);
                productcategoryinfos.Add(productcategoryinfo);
            }

            return(productcategoryinfos);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="productcategoryid"></param>
        /// <returns>实体</returns>
        public ProductCategoryInfoModel Retrieve(string productcategoryid)
        {
            ProductCategoryInfoModel productcategoryinfo = new ProductCategoryInfoModel();

            productcategoryinfo.ProductCategoryId = productcategoryid;

            DataTable dt = DbUtil.Current.Retrieve(productcategoryinfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            productcategoryinfo.ConvertFrom(dt);

            return(productcategoryinfo);
        }