private void buttonOrderDiscardMan_Click(object sender, EventArgs e) { try { OrderMenu orderMenu = new OrderMenu(); // orderMenu.OrderNo = Convert.ToInt32(this.textBoxOrderNo.Text); orderMenu.ItemName = this.textBoxOdrItemNameMan_bt.Text; orderMenu.ItemQuantity = Convert.ToInt32(this.textBoxOrderQuantityMan.Text); InventoryRepo inventoryRepo = new InventoryRepo(); OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); inventoryRepo.Update(orderMenuRepo.GetQuantity(orderMenu.ItemName) + orderMenu.ItemQuantity, orderMenu.ItemName); orderMenuRepo.Delete(orderMenu.ItemName); // orderMenuRepo.Update(, orderMenu.ItemName); List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); this.dataGridViewOrderedItmManagwe2.DataSource = orderMenuList; List <Inventory> inventoryList = inventoryRepo.GetAllInventory(); this.dataGridOrderMenuItemMan1.DataSource = inventoryList; this.textBoxOdrItemNameMan_bt.Text = ""; this.textBoxOrderQuantityMan.Text = ""; } catch { } }
private void buttonOrderAddMan_Click(object sender, EventArgs e) { try { OrderMenu orderMenu = new OrderMenu(); // orderMenu.OrderNo = Convert.ToInt32(this.textBoxOrderNo.Text); orderMenu.ItemName = this.textBoxOdrItemNameMan_bt.Text; orderMenu.ItemQuantity = Convert.ToInt32(this.textBoxOrderQuantityMan.Text); OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); if (orderMenu.ItemQuantity <= orderMenuRepo.GetQuantity(orderMenu.ItemName)) { if (orderMenuRepo.Insert(orderMenu)) { List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); this.dataGridViewOrderedItmManagwe2.DataSource = orderMenuList; InventoryRepo inventoryRepo = new InventoryRepo(); inventoryRepo.Update(orderMenuRepo.GetQuantity(orderMenu.ItemName) - orderMenu.ItemQuantity, orderMenu.ItemName); List <Inventory> inventoryList = inventoryRepo.GetAllInventory(); this.dataGridOrderMenuItemMan1.DataSource = inventoryList; } } else { MessageBox.Show("Quantity Limit Exceed"); } } catch { } }
private void placeManagerOrder_bt_Click(object sender, EventArgs e) { OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); this.textBoxTotal.Text = orderMenuRepo.GetPrice().ToString(); this.textBoxPayableTotalMan.Text = orderMenuRepo.GetPrice().ToString(); List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); this.dataGridViewManagerBill.DataSource = orderMenuList; managerTabControl.SelectedIndex = 4; orderMenuRepo.ResetSelectedItem(); }
private void buttonPlaceOrder_Click(object sender, EventArgs e) { OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); this.textBoxTotalservice.Text = orderMenuRepo.GetPrice().ToString(); this.textBoxPaytotal.Text = orderMenuRepo.GetPrice().ToString(); List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); this.dataGridViewservicebill.DataSource = orderMenuList; SercicetabControl1.SelectedIndex = 3; orderMenuRepo.ResetSelectedItem(); }
private void buttonPlaceOrder_Click(object sender, EventArgs e) { OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); this.textBoxTotalPrice.Text = orderMenuRepo.GetPrice().ToString(); this.textBoxPayableTotal.Text = orderMenuRepo.GetPrice().ToString(); List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); this.dataGridViewBilling.DataSource = orderMenuList; AdminTabControl.SelectedIndex = 5; orderMenuRepo.ResetSelectedItem(); }
private void buttonPlaceOrder_Click(object sender, EventArgs e) { OrderMenu orderMenu = new OrderMenu(); orderMenu.OrderNo = Convert.ToInt32(this.textBoxTableNo.Text); // orderMenu.ItemQuantity = Convert.ToInt32(this.textBoxQuantity.Text); OrderMenuRepo orderMenuRepo = new OrderMenuRepo(); if (orderMenuRepo.Insert(orderMenu)) { List <OrderMenu> orderMenuList = orderMenuRepo.GetAllOrderMenu(); managerTabControl.SelectedIndex = 2; //this.dataGridViewOrderMenu.DataSource = orderMenuList; } else { MessageBox.Show("Not Inserted"); } }