void ucMenuOfGroup_Click(object sender, EventArgs e) { try { if (OrderMain.Status == 1) { OrderCompleted(); } else { ucMenuOfGroup = (UCMenuOfGroup)sender; OrderDetailModel item = new OrderDetailModel(); if (seat > 0) item.Seat = seat; ProductionModel itemProduct = (ProductionModel)ucMenuOfGroup.Tag; colorName = itemProduct.Color; item.ProductName = itemProduct.ProductNameSort; item.Price = Convert.ToDouble(itemProduct.CurrentPrice); item.ProductID = itemProduct.ProductID; item.Qty = 1; item.OrderID = OrderMain.OrderID; if (flagUcSeatClick == 1) item.Seat = numSeat; if (OrderMain.IsLoadFromData) item.ChangeStatus = 1; //ProductionModel itemPrint = new ProductionModel(); //itemPrint = ProductService.GetPrinterType(itemProduct.ProductID); //if (itemPrint != null) //{ // item.Printer = itemPrint.Printer; // item.PrintJob = itemPrint.PrinterJob; //} //else //{ // itemPrint = ProductService.GetPrinterTypeByCate(itemProduct.CategoryID); // if (itemPrint != null) // {; // item.Printer = itemPrint.Printer; // item.PrintJob = itemPrint.PrinterJob; // } //} var dataPrint = ProductService.GetListPrintJob(itemProduct.ProductID); foreach (PrinteJobDetailModel itemPrint in dataPrint) { PrinteJobDetailModel p = new PrinteJobDetailModel(); p.ProductID = itemPrint.ProductID; p.PrinterID = itemPrint.PrinterID; item.ListPrintJob.Add(p); } OrderMain.addItemToList(item); addOrder(item); lblSubtotal.Text = "$" + money.Format2(OrderMain.SubTotal().ToString()); ucMenuOfGroup.lblNameMenuOfGroup.BackColor = Color.FromArgb(0, 122, 204); timeChangeColor.Enabled = true; timeChangeColor.Start(); } } catch (Exception ex) { LogPOS.WriteLog("ucMenuOfGroup_Click:::::::::::::::::::::::::::::" + ex.Message); } }
private void LoadItemOfGroup(int CategoryId, int PageSki) { try { this.flowLayoutPanel1.Controls.Clear(); this.AddButtonBackItem(); int keyItem = 1; var dataPrduct = ProductService.GetProdutcByCategory(CategoryId, PageSki); int RowCount = 1; foreach (ProductionModel itemProductionModel in dataPrduct) { keyItem++; RowCount++; UCMenuOfGroup ucMenuOfGroup = new UCMenuOfGroup(); ucMenuOfGroup.lblNameMenuOfGroup.Text = itemProductionModel.ProductNameSort; ucMenuOfGroup.Tag = itemProductionModel; ucMenuOfGroup.lblNameMenuOfGroup.BackColor = Color.FromName(itemProductionModel.Color); ucMenuOfGroup.Click += ucMenuOfGroup_Click; flowLayoutPanel1.Controls.Add(ucMenuOfGroup); } CalculateTotalPages(RowCount); this.AddButtonOpenItemItem(); this.AddButtonBackItemPage(); this.AddButtonMextItemPage(); } catch (Exception ex) { LogPOS.WriteLog("LoadItemOfGroup:::::::::::::::::::::::::::::::::::::::::" + ex.Message); } }