private void addModifreToOrder(UCItemModifierOfMenu ucMdifireOfMenu, OrderDetailModifireModel modifier, FlowLayoutPanel flp) { try { ucMdifireOfMenu.lblNameItenModifierMenu.Text = modifier.ModifireName; //ucMdifireOfMenu.lblPriceItenModifierMenu.Text = "1"; ucMdifireOfMenu.Width = flpOldTable.Width; flp.Controls.Add(ucMdifireOfMenu); } catch (Exception ex) { LogPOS.WriteLog("addModifreToOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
private void addModifreToOrder(UCItemModifierOfMenu ucMdifireOfMenu, OrderDetailModifireModel modifier) { try { ucMdifireOfMenu.lblNameItenModifierMenu.Text = modifier.ModifireName; ucMdifireOfMenu.lblPriceItenModifierMenu.Text = money.Format2(modifier.Price.ToString()); ucMdifireOfMenu.lblQtyItenModifierMenu.Text = modifier.Qty.ToString(); ucMdifireOfMenu.Width = flowLayoutPanel1.Width; flowLayoutPanel1.Controls.Add(ucMdifireOfMenu); flowLayoutPanel1.Controls.SetChildIndex(ucMdifireOfMenu, indexControl + 1); } catch (Exception ex) { SystemLog.LogPOS.WriteLog("addModifreToOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
private void RefeshOrderMain(OrderDateModel OrderRefesh, FlowLayoutPanel flp) { flp.Controls.Clear(); if (OrderRefesh.ListOrderDetail.Count > 0) { for (int i = 0; i < OrderRefesh.ListOrderDetail.Count; i++) { addOrder(OrderRefesh.ListOrderDetail[i], flp); for (int j = 0; j < OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire[j]; //uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire[j], flp); } } } }
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()); this.lblTax.Text = "N/A"; this.lblTotal.Text = money.Format2(OrderMain.SubTotal()); } catch (Exception ex) { SystemLog.LogPOS.WriteLog("POS::frmCustomerDisplay:::::::::::::::::::" + 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 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 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); } }
private void addModifreToOrder(UCItemModifierOfMenu ucMdifireOfMenu, OrderDetailModifireModel modifier,FlowLayoutPanel flp) { try { ucMdifireOfMenu.lblNameItenModifierMenu.Text = modifier.ModifireName; //ucMdifireOfMenu.lblPriceItenModifierMenu.Text = "1"; ucMdifireOfMenu.Width = flpOldTable.Width; flp.Controls.Add(ucMdifireOfMenu); } catch (Exception ex) { LogPOS.WriteLog("addModifreToOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
void btnOpenItemSubItem_Click(object sender, EventArgs e) { try { frmOpenItem frm = new frmOpenItem(1); if (frmOpacity.ShowDialog(this, frm) == System.Windows.Forms.DialogResult.OK) { //Order.Item itemTemp = new Order.Item(); OrderDetailModel itemTemp = new OrderDetailModel(); OrderOpenItemModel OpenItem = new OrderOpenItemModel(); OpenItem.ItemNameDesc = frm.items.ProductName; OpenItem.ItemNameShort = frm.items.ProductName; OpenItem.UnitPrice = Convert.ToInt32(frm.items.Price); int resul = OrderService.InsertOpenItem(OpenItem); if (resul == 1) { frm.items.DynID = OrderService.LastDynID(); frm.items.OrderID = OrderMain.OrderID; frm.items.Qty = 1; if (seat > 0) frm.items.Seat = seat; if (flagUcSeatClick == 1) frm.items.Seat = numSeat; itemTemp = frm.items; OrderDetailModifireModel modifierTemp = new OrderDetailModifireModel(); modifierTemp.ModifireName = itemTemp.ProductName; modifierTemp.Price = itemTemp.Price; modifierTemp.OrderID = itemTemp.OrderID; modifierTemp.ProductID = itemTemp.ProductID; modifierTemp.DynID = itemTemp.DynID; modifierTemp.Seat = itemTemp.Seat; modifierTemp.ChangeStatus = 1; OrderMain.addModifierToList(modifierTemp, keyItemTemp); UCItemModifierOfMenu ucItemModifierOfMenu = new UCItemModifierOfMenu(); this.addModifreToOrder(ucItemModifierOfMenu, modifierTemp); } //Order.Modifier modifierTemp = new Order.Modifier(); } } catch (Exception ex) { LogPOS.WriteLog("btnOpenItemSubItem_Click::::::::::::::::::::::::::" + ex.Message); } }
public void LoadOrderTKA(string TableID, int ClientID) { indexControl = 1; 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(); ucSeat.Click += ucSeat_Click; flpOrder.Controls.Add(ucSeat); indexControl = flpOrder.Controls.Count; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } else { OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1); if (ClientID > 0) OrderMain.ClientID = ClientID; else OrderMain.ClientID = 0; OrderMain.ShiftID = UserLoginModel.ShiffID; OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID; OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } else { OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1); OrderMain.ClientID = ClientID; OrderMain.ShiftID = UserLoginModel.ShiffID; OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID; OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID; int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; } } } catch (Exception ex) { LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
public void LoadOrderPrev(int orderID) { indexControl = 1; try { OrderMain = new OrderDateModel(); OrderMain = OrderService.GetListOrderPrevOrder("", orderID, DateTime.Now.Date); lblSubtotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount)); if (OrderMain.Seat > 0) { OrderMain.IsLoadFromData = true; lblSeat.Text = OrderMain.Seat.ToString(); lblStatus.Text = "OLD"; for (int seat = 1; seat <= OrderMain.Seat; seat++) { UCSeat ucSeat = new UCSeat(); ucSeat.lblSeat.Text = "Seat " + seat.ToString(); ucSeat.Click += ucSeat_Click; flpOrder.Controls.Add(ucSeat); indexControl = flpOrder.Controls.Count; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } } } else { if (OrderMain.ListOrderDetail.Count > 0) { OrderMain.IsLoadFromData = true; lblStatus.Text = "OLD"; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } } catch (Exception ex) { LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
void ucModifierOfMenu_Click(object sender, EventArgs e) { try { UCModifierOfMenu ucModifierOfMenu = (UCModifierOfMenu)sender; OrderDetailModifireModel modifier = new OrderDetailModifireModel(); ModifireModel itemsModifre = (ModifireModel)ucModifierOfMenu.Tag; modifier.ModifireName = itemsModifre.ModifireName; if (modifier.Price > 0) { modifier.Price = 0; } else { modifier.Price = Convert.ToDouble(itemsModifre.CurrentPrice); } modifier.ModifireID = itemsModifre.ModifireID; modifier.OrderID = OrderMain.OrderID; modifier.Qty = 1; if (OrderMain.IsLoadFromData) modifier.ChangeStatus = 1; OrderMain.addModifierToList(modifier, keyItemTemp); UCItemModifierOfMenu ucItemModifierOfMenu = new UCItemModifierOfMenu(); ucItemModifierOfMenu.Tag = modifier; ucItemModifierOfMenu.Click += ucItemModifierOfMenu_Click; addModifreToOrder(ucItemModifierOfMenu, modifier); lblSubtotal.Text = money.Format2(OrderMain.SubTotal()); } catch (Exception ex) { LogPOS.WriteLog("ucModifierOfMenu_Click:::::::::::::::::::::::::" + ex.Message); } }
public void LoadOrder(string TableID, int orderID) { indexControl = 1; try { OrderMain = new OrderDateModel(); OrderMain = OrderService.GetOrderByTable(TableID, 0); OrderMain.ListOrderDetail = OrderMain.ListOrderDetail.OrderBy(x => x.OrderDetailID).ToList(); if (OrderMain.TotalAmount > 0) { lblSubtotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount)); } else { lblSubtotal.Text = "0.0"; } if (OrderMain.ListSeatOfOrder.Count > 0) { OrderMain.IsLoadFromData = true; lblSeat.Text = OrderMain.Seat.ToString(); lblStatus.Text = "OLD"; 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; ucSeat.Click += ucSeat_Click; flpOrder.Controls.Add(ucSeat); indexControl = flpOrder.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]; uc.Click += ucItemModifierOfMenu_Click; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } } } else { OrderMain.FloorID = TableID; OrderMain.ShiftID = UserLoginModel.ShiffID; OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID; OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID; int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; lblStatus.Text = "NEW"; } } } else { if (OrderMain.ListOrderDetail.Count > 0) { OrderMain.IsLoadFromData = true; lblStatus.Text = "OLD"; 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]; uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]); indexControl++; } } } else { OrderMain.FloorID = TableID; OrderMain.ShiftID = UserLoginModel.ShiffID; OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID; OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID; int OrderID = OrderService.CountOrder() + 1; OrderMain.OrderID = OrderID; lblStatus.Text = "NEW"; } } } catch (Exception ex) { LogPOS.WriteLog("frmOrder:::::::::::::::::::::::LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message); } }
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); } }
private void RefeshOrderMain(OrderDateModel OrderRefesh,FlowLayoutPanel flp) { flp.Controls.Clear(); if (OrderRefesh.ListOrderDetail.Count > 0) { for (int i = 0; i < OrderRefesh.ListOrderDetail.Count; i++) { addOrder(OrderRefesh.ListOrderDetail[i], flp); for (int j = 0; j < OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { UCItemModifierOfMenu uc = new UCItemModifierOfMenu(); uc.Tag = OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire[j]; //uc.Click += ucItemModifierOfMenu_Click; addModifreToOrder(uc, OrderRefesh.ListOrderDetail[i].ListOrderDetailModifire[j],flp); } } } }