private void btnAddSeat_Click(object sender, EventArgs e) { frmAddSeat frm = new frmAddSeat(); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Seat = frm.NumberSeat; SeatModel seatAdd = new SeatModel(); seatAdd.Seat = Seat; lstSeat.Add(seatAdd); OrderSlpitNew.ListSeatOfOrder = lstSeat; UCSeat ucSeat = new UCSeat(); ucSeat.lblSeat.Text = "Seat " + Seat; //ucSeat.Click += ucSeat_Click; lblSeat.Text = Seat.ToString(); flpNewTable.Controls.Add(ucSeat); } }
public void LoadOrder(string TableID, int orderID, FlowLayoutPanel flp) { int indexControl = 1; try { OrderMain = OrderService.GetOrderByTable(TableID, 0); if (OrderMain.ListSeatOfOrder.Count > 0) { OrderMain.IsLoadFromData = true; //lblSeat.Text = OrderMain.Seat.ToString(); foreach (SeatModel seat in OrderMain.ListSeatOfOrder) { UCSeat ucSeat = new UCSeat(); ucSeat.lblSeat.Text = "Seat " + seat.Seat.ToString(); // ucSeat.Click += ucSeat_Click; flpOldTable.Controls.Add(ucSeat); indexControl = flpOldTable.Controls.Count; if (OrderMain.ListOrderDetail.Count > 0) { for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { if (OrderMain.ListOrderDetail[i].Seat == seat.Seat) { addOrder(OrderMain.ListOrderDetail[i], flp); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; //uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j], flp); indexControl++; } } } } else { OrderMain.FloorID = TableID; int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; } } } else { if (OrderMain.ListOrderDetail.Count > 0) { OrderMain.IsLoadFromData = true; for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { addOrder(OrderMain.ListOrderDetail[i], flp); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; //uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j], flp); indexControl++; } } } else { OrderMain.FloorID = TableID; int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; } } } catch (Exception ex) { LogPOS.WriteLog("frmTranferTable:::::::::::::::::::LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
public void BindOrder(OrderDateModel OrderMain) { try { detailScreen(); if (OrderMain.ListSeatOfOrder.Count > 0) { OrderMain.IsLoadFromData = true; Boolean addSet; foreach (SeatModel seat in OrderMain.ListSeatOfOrder) { addSet = true; if (OrderMain.ListOrderDetail.Count > 0) { for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { if (OrderMain.ListOrderDetail[i].Seat == seat.Seat) { if (addSet) { UCSeat ucSeat = new UCSeat(); ucSeat.lblSeat.Text = "Seat " + seat.Seat.ToString(); ucSeat.Tag = seat.Seat; flowLayoutPanel1.Controls.Add(ucSeat); indexControl = flowLayoutPanel1.Controls.Count; addSet = false; } addOrder(OrderMain.ListOrderDetail[i]); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } else { if (OrderMain.ListOrderDetail[i].Seat == 0) { addOrder(OrderMain.ListOrderDetail[i]); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } } } } else { if (OrderMain.ListOrderDetail.Count > 0) { OrderMain.IsLoadFromData = true; for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { addOrder(OrderMain.ListOrderDetail[i]); for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); } } } } this.lblSubtotal.Text = money.Format2(OrderMain.SubTotal()); Double gst = Convert.ToDouble(OrderMain.TotalAmount) / 11000; if (gst < 1) { this.lblTax.Text = "$0" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11); } else { this.lblTax.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11); } this.lblTotal.Text = money.Format2(OrderMain.SubTotal()); } catch (Exception ex) { SystemLog.LogPOS.WriteLog("POS::frmCustomerDisplay:::::::::::::::::::" + ex.Message); } }
public void LoadOrderTKA(string TableID, string ClientID) { indexControl = 1; flpTKAItem.Controls.Clear(); try { OrderMain = new OrderDateModel(); OrderMain = OrderService.GetOrderByTKA(TableID, ""); OrderMain.isTKA = 1; lblSubTotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount)); if (OrderMain.Seat > 0) { OrderMain.IsLoadFromData = true; //lblSeat.Text = OrderMain.Seat.ToString(); for (int seat = 1; seat <= OrderMain.Seat; seat++) { UCSeat ucSeat = new UCSeat(); ucSeat.lblSeat.Text = "Seat " + seat.ToString(); if (OrderMain.ListOrderDetail.Count > 0) { for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { if (OrderMain.ListOrderDetail[i].Seat == seat) { addOrder(OrderMain.ListOrderDetail[i]); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } else { OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1); int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; } } } else { if (OrderMain.ListOrderDetail.Count > 0) { OrderMain.IsLoadFromData = true; for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { addOrder(OrderMain.ListOrderDetail[i]); indexControl++; for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } else { OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1); int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; } } } catch (Exception ex) { LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }