コード例 #1
0
        public List <StoreProduct> GetStoreProducts(String StoreID)
        {
            // storeProductID, StoreID, ProductID, productName, ProductType, BrandID, BrandName, BrandType, price, amount
            DataTable dataTable = queries.GetStoreProducts(StoreID);

            if (dataTable == null)
            {
                return(null);
            }

            List <StoreProduct> storeProductList = new List <StoreProduct>();

            foreach (DataRow row in dataTable.Rows)
            {
                String[] tpStr = new String[dataTable.Columns.Count];
                int      i     = 0;
                foreach (DataColumn col in dataTable.Columns)
                {
                    tpStr[i] = row[col].ToString();
                    i++;
                }
                StoreProduct tempData = new StoreProduct();
                tempData.Handler(tpStr);
                storeProductList.Add(tempData);
            }

            return(storeProductList);
        }
コード例 #2
0
 public Offer(String ID, StoreProduct product, double discountRate)
 {
     this.ID           = ID;
     this.product      = product;
     this.discountRate = discountRate;
 }
コード例 #3
0
 public Offer()
 {
     this.ID           = null;
     this.product      = new StoreProduct();
     this.discountRate = 0.0;
 }
コード例 #4
0
 public string AddStoreProduct(String storeID, StoreProduct product)
 {
     return(queries.AddStoreProduct(storeID, product));
 }