Esempio n. 1
0
        private void NewSaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaleController saleController = new SaleController();

            saleController.Open();

            NewSaleToolStripMenuItem.Enabled                  = false;
            NewOrderToolStripMenuItem.Enabled                 = true;
            ViewTotalsToolStripMenuItem.Enabled               = true;
            ToolStripTotals.Enabled                           = true;
            CloseCurrentSaleToolStripMenuItem.Enabled         = true;
            toolStripOrderButton.Enabled                      = true;
            toolStripStartingCash.Enabled                     = true;
            initialSaleContributionsToolStripMenuItem.Enabled = true;

            StatusStrip1.Items[0].Text = "Sale Created: " + Convert.ToDateTime(saleController.GetOpenSale().startDate).ToLongDateString();

            DialogResult dr = MessageBox.Show("Would you like to enter initial contributions?", "Sale Setup", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                AddStartingCash startingCashForm = new AddStartingCash();
                startingCashForm.KeepOpenOnAdd = true;
                startingCashForm.SaleId        = (int)saleController.GetOpenSale().id;
                startingCashForm.ShowDialog();
            }
        }
Esempio n. 2
0
        private void ViewTotal_Load(object sender, EventArgs e)
        {
            SaleController saleController = new SaleController();
            int            saleId         = (int)saleController.GetOpenSale().id;

            CompileTotals(saleId);
        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            SaleController saleController = new SaleController();

            if (saleController.IsOpen)
            {
                NewSaleToolStripMenuItem.Enabled                  = false;
                toolStripOrderButton.Enabled                      = true;
                NewOrderToolStripMenuItem.Enabled                 = true;
                ViewTotalsToolStripMenuItem.Enabled               = true;
                ToolStripTotals.Enabled                           = true;
                CloseCurrentSaleToolStripMenuItem.Enabled         = true;
                toolStripStartingCash.Enabled                     = true;
                initialSaleContributionsToolStripMenuItem.Enabled = true;

                StatusStrip1.Items[0].Text = "Sale Created: " + Convert.ToDateTime(saleController.GetOpenSale().startDate).ToLongDateString();
            }
            else
            {
                NewSaleToolStripMenuItem.Enabled                  = true;
                NewOrderToolStripMenuItem.Enabled                 = false;
                toolStripOrderButton.Enabled                      = false;
                ViewTotalsToolStripMenuItem.Enabled               = false;
                ToolStripTotals.Enabled                           = false;
                CloseCurrentSaleToolStripMenuItem.Enabled         = false;
                toolStripStartingCash.Enabled                     = false;
                initialSaleContributionsToolStripMenuItem.Enabled = false;

                StatusStrip1.Items[0].Text = "No sale currently open. To start a new sale, click New Sale under File menu.";
            }
        }
Esempio n. 4
0
        private void OrderSearch_Load(object sender, EventArgs e)
        {
            SaleController saleController = new SaleController();

            _saleId = (int)saleController.GetOpenSale().id;
            LoadOrderData();
        }
        private void StartingCashManagement_Load(object sender, EventArgs e)
        {
            SaleController saleController = new SaleController();

            _saleId = (int)saleController.GetOpenSale().id;

            LoadStartCashData();
        }
Esempio n. 6
0
        private void ToolStripNewOrderButton_Click(object sender, EventArgs e)
        {
            OrderManagement orderManagementForm = (OrderManagement)this.MdiChildren.SingleOrDefault <Form>(c => c.Name.ToLower() == "ordermanagement");

            if (orderManagementForm == null)
            {
                SaleController saleController = new SaleController();
                int            saleId         = (int)saleController.GetOpenSale().id;

                orderManagementForm           = new OrderManagement();
                orderManagementForm.SaleId    = saleId;
                orderManagementForm.MdiParent = this;
                orderManagementForm.Show();
            }
            else
            {
                orderManagementForm.BringToFront();
            }
        }