Exemplo n.º 1
0
        public SpecialPricing(string itemNum)
        {
            ItemNum = itemNum;
            getGui = new get_GUI();
            BulkInfoList = new ArrayList();
            OnSaleInfoList = new ArrayList();
            PricesList = new ArrayList();
            DataTable sale = getGui.GetBulkInfo(StaticClass.storeId, itemNum);
            if(sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    BulkInfo bulkInfo = new BulkInfo(Convert.ToSingle(sale.Rows[i]["Bulk_Quan"]), Convert.ToDecimal(sale.Rows[i]["Bulk_Price"]));
                    BulkInfoList.Add(bulkInfo);
                }
            }
            sale = getGui.GetOnsaleInfo(StaticClass.storeId, itemNum);
            if (sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    OnSalesInfo onSalesInfo = new OnSalesInfo(Convert.ToDateTime(sale.Rows[i]["Sale_Start"]), Convert.ToDateTime(sale.Rows[i]["Sale_End"]), Convert.ToSingle(sale.Rows[i]["Percent"]));
                    OnSaleInfoList.Add(onSalesInfo);
                }
            }

            sale = getGui.GetPrices(StaticClass.storeId, itemNum);
            if (sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    Prices prices = new Prices(Convert.ToDecimal(sale.Rows[i]["Price"]), Convert.ToDateTime(sale.Rows[i]["Criteria1"]), Convert.ToDateTime(sale.Rows[i]["Criteria2"]), Convert.ToString(sale.Rows[i]["Criteria3"]), Convert.ToBoolean(sale.Rows[i]["Enabled"]), Convert.ToInt32(sale.Rows[i]["PriceType"]));
                    PricesList.Add(prices);
                }
            }
        }