Пример #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);
                }
            }
        }
Пример #2
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);
                }
            }
        }
Пример #3
0
        private void button16_Click(object sender, EventArgs e)
        {
            FrmDayOfWeek frmDayOfWeek = new FrmDayOfWeek();
            DateTime cr1 = DateTime.Now;
            DateTime cr2 = DateTime.Now;
            decimal price;
            int[] cr3;
            Prices prices ;
            if(frmDayOfWeek.ShowDialog() == DialogResult.OK)
            {
                cr3 = new int[frmDayOfWeek.creListBox1.SelectedItems.Count];
                for (int i = 0; i < frmDayOfWeek.creListBox1.SelectedItems.Count; i++)
                {
                    cr3[i] = frmDayOfWeek.creListBox1.SelectedIndices[i] + 1;
                }
                FrmTime frmTime = new FrmTime("Giờ bắt đầu ");
                frmTime.myPassPara = startTimeText;
                if(frmTime.ShowDialog() == DialogResult.OK)
                {
                    cr1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, FrmReporting.ChangeModeTime(frmTime.Hour,frmTime.Mode), frmTime.Minute, frmTime.Second);
                    frmTime = new FrmTime("Thời gian kết thúc ");
                    frmTime.myPassPara = startTimeText;
                    if(frmTime.ShowDialog() == DialogResult.OK)
                    {
                        cr2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, FrmReporting.ChangeModeTime(frmTime.Hour, frmTime.Mode), frmTime.Minute, frmTime.Second);
                        FrmKeyboardNumber frmKeyboardNumber = new FrmKeyboardNumber("Giá ", String.Format("{0:0,0}",Convert.ToDecimal(txtGiaMua.Text)));
                        if(frmKeyboardNumber.ShowDialog() == DialogResult.OK)
                        {
                            price = Convert.ToDecimal(frmKeyboardNumber.value);
                            for (int i = 0; i < cr3.Length; i++)
                            {
                                prices = new Prices(price, cr1, cr2, cr3[i].ToString());
                                prices.isNew = true;
                                specialPricing.PricesList.Add(prices);
                                creListBox4.Items.Add(prices);
                            }
                        }
                    }

                }
            }
        }