Exemplo n.º 1
0
        private void submitOrderButton_Click(object sender, EventArgs e)
        {
            try
            {
                store storeName = placeOrderService.findStore(_sales.stor_id);

                var DialogResult = MessageBox.Show("Do you want to submit order to " + storeName.stor_name + "?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (DialogResult == DialogResult.Yes)
                {
                    _bookOverview.OrderIDList.Clear();

                    foreach (sales sale in transaction)
                    {
                        placeOrderService.addSaleOrder(sale);
                    }

                    MessageBox.Show("Order #: " + orderNum + " was sent to " + storeName.stor_name + ".", "Success", MessageBoxButtons.OK);

                    Dispose();
                }
                else
                {
                    return;
                }

                return;
            }
            catch
            {
                return;
            }
        }
Exemplo n.º 2
0
        public PlaceOrderForm(Book_Overview frm1, store store)
        {
            InitializeComponent();

            ActiveControl = payTermsDropDown;

            string apiRoot = configFile.getSetting("apiRoot");

            BookRepoREST      bookRepo      = new BookRepoREST(apiRoot);
            StoreRepoREST     storeRepo     = new StoreRepoREST(apiRoot);
            SalesRepoREST     salesRepo     = new SalesRepoREST(apiRoot);
            BookOrderRepoREST bookOrderRepo = new BookOrderRepoREST(apiRoot);

            placeOrderService = new pubsService(bookRepo, storeRepo, salesRepo, bookOrderRepo);

            //creates new order number
            orderNum = RandomString(8);

            _store        = store;
            _bookOverview = frm1;
            _bookList     = new BookList(this, _sales);
            _bookQtyEdit  = new BookQuantityForm(this, _sales);

            transaction = new List <sales>();
        }
        private void placeNewOrderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _storeName = null;

            try
            {
                if (StoresDropDown.Text == "")
                {
                    MessageBox.Show("Choose a Book Store from the drop down.", "Error", MessageBoxButtons.OK);
                    return;
                }
                else
                {
                    _storeName = new store();

                    if (StoresDropDown.SelectedItem is storeViewModel st)
                    {
                        _storeName.stor_id   = st.StoreID;
                        _storeName.stor_name = st.StoreName;
                    }
                    _sales = new sales();

                    _placeOrder         = new PlaceOrderForm(this, _sales, _storeName);
                    _placeOrder.Enabled = true;
                    _placeOrder.ShowDialog();
                }
            }
            catch
            {
                return;
            }
        }
Exemplo n.º 4
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (showtable.Text == "")
     {
         MessageBox.Show("กรุณาเลือกที่นั่ง");
     }
     else
     {
         Program.selectnumber = showtable.Text;//เก็บข้อมูลโต๊ะ
         store s = new store();
         s.ShowDialog();
     }
 }