Пример #1
0
 internal List <ProductRelatedInfo> ProductRelated_GetList(int productid, Enums.RelatedType t)
 {
     return(this.ProductRelated_GetList(productid, 0, t));
     //string sql = "ProductRelated_Get";
     //var cmd = dbr.GetStoredProcCommand(sql);
     //dbw.AddInParameter(cmd, "ProductID", DbType.Int32, productid);
     //dbw.AddInParameter(cmd, "Type", DbType.Int32, (int)t);
     //var list = new List<ProductRelatedInfo>();
     //using (var read = dbr.ExecuteReader(cmd))
     //{
     //    while (read.Read())
     //    {
     //        list.Add(ReaderModel(read));
     //    }
     //}
     //return list;
 }
Пример #2
0
        internal List <ProductRelatedInfo> ProductRelated_GetList(int productid, int childproductid, Enums.RelatedType t)
        {
            string sql = "ProductRelated_GetList";
            var    cmd = dbr.GetStoredProcCommand(sql);

            dbw.AddInParameter(cmd, "ProductID", DbType.Int32, productid);
            dbw.AddInParameter(cmd, "ChildProductID", DbType.Int32, childproductid);
            dbw.AddInParameter(cmd, "Type", DbType.Int32, (int)t);
            var list = new List <ProductRelatedInfo>();

            using (var read = dbr.ExecuteReader(cmd))
            {
                while (read.Read())
                {
                    list.Add(ReaderModel(read));
                }
            }
            return(list);
        }