Beispiel #1
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <ProductInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <ProductInfoModel> productinfos = new List <ProductInfoModel>();

            ProductInfoModel productinfo = new ProductInfoModel();
            DataTable        dt          = DbUtil.Current.RetrieveMultiple(productinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                productinfo = new ProductInfoModel();
                productinfo.ConvertFrom(dt, i);
                productinfos.Add(productinfo);
            }

            return(productinfos);
        }
Beispiel #2
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="productid"></param>
        /// <returns>实体</returns>
        public ProductInfoModel Retrieve(string productid)
        {
            ProductInfoModel productinfo = new ProductInfoModel();

            productinfo.ProductId = productid;

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

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

            productinfo.ConvertFrom(dt);

            return(productinfo);
        }