private void loadInfoOrder(BillSell billSell) { fORDER f1 = Application.OpenForms.OfType <fORDER>().FirstOrDefault(); if (f1 != null) { if (billSell == null) { f1.lbCount.Text = 0.ToString(); f1.lbTotal.Text = String.Format("{0:0,00} VNĐ", 0.0); return; } DetailBillSellService detailBillSellService = new DetailBillSellService(new CoffeShopContext()); f1.lbCount.Text = detailBillSellService.GetCountDetail(billSell).ToString(); BillSellService bsService = new BillSellService(new CoffeShopContext()); var detail = detailBillSellService.GetDetailBillSell(billSell); if (detail.Count == 0) { f1.lbCount.Text = detailBillSellService.GetCountDetail(billSell).ToString(); f1.lbTotal.Text = String.Format("{0:0,00} VNĐ", 0.0); return; } bsService.SetTotal(detail, billSell); f1.lbTotal.Text = String.Format("{0:0,00} VNĐ", bsService.GetTotal(billSell)); } }
private void reloadProductOrder(DetailBillSell detailBillSell) { fORDER f1 = Application.OpenForms.OfType <fORDER>().FirstOrDefault(); if (f1 != null) { if (fORDER.staticBill != null) { f1.loadInfoOrder(fORDER.staticBill); } } }
private void btnDelete_Click(object sender, EventArgs e) { DetailBillSellService detailBillSell = new DetailBillSellService(new CoffeShopContext()); detailBillSell.DeleteDetailBillSell(_DetailBillSell); this.Controls.Remove(this); fORDER f1 = Application.OpenForms.OfType <fORDER>().FirstOrDefault(); if (f1 != null) { f1.refreshFLPOrdered(_DetailBillSell); reloadProductOrder(_DetailBillSell); } }
private void reloadProducts() { loadInfoOrder(_billSell); DetailBillSellService detailBillSellService = new DetailBillSellService(new CoffeShopContext()); var listDetail = detailBillSellService.GetDetailBillSell(_billSell); fORDER f1 = Application.OpenForms.OfType <fORDER>().FirstOrDefault(); if (f1 != null) { if (checkOrderd) { f1.orderProducts(_billSell); f1.showListProductOrder(listDetail); } else { f1.flpOrdered.Controls.Clear(); uc_AreaNormal.Instance.preLoad(); uc_AreaVIP.Instance.preLoad(); } } }
private void label1_Click(object sender, EventArgs e) { fORDER.checkStatus = true; fORDER.staticTable = table; fORDER f1 = Application.OpenForms.OfType <fORDER>().FirstOrDefault(); if (f1 != null) { f1.showTableInMenu(table, index); if (_billSell != null) { BillSellService billSellService = new BillSellService(new CoffeShopContext()); DetailBillSellService detailBillSellService = new DetailBillSellService(new CoffeShopContext()); var listDetail = detailBillSellService.GetDetailBillSell(_billSell); f1.showListProductOrder(listDetail); } else { f1.flpOrdered.Controls.Clear(); } } loadInfoOrder(_billSell); }