private void Form_ThuTien_Load(object sender, EventArgs e) { try { if (ca.getCart().Count > 0) { double sum = ca.tinhTong(); lbl_TongTien.Text = sum + ""; //lbl_TongTien.Text = mc.convertCurrency(sum); } else if (ca.getCart2().Count == 0) { tblHoaDon h = hd.getMaHDTheoBan(ca.getMaBan()); List <tblChiTietHD> lstCT = (List <tblChiTietHD>)ct.getCTByMaHD(h.MaHD); lbl_TongTien.Text = lstCT.Sum(t => t.TongTien) + ""; //lbl_TongTien.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien)); } else if (ca.getCart2().Count > 0) { tblHoaDon h = hd.getMaHDTheoBan(ca.getMaBan()); List <tblChiTietHD> lstCT = (List <tblChiTietHD>)ct.getCTByMaHD(h.MaHD); double sum = ca.tinhTong2(); lbl_TongTien.Text = ((double)lstCT.Sum(t => t.TongTien) + sum) + ""; //lbl_TongTien.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien) + sum); } } catch (Exception ee) { } }
public Form_GoiMon(String a) { InitializeComponent(); loadUserControl(); ca.setFlag(1); tblHoaDon h = hd.getMaHDTheoBan(ca.getMaBan()); lstCT = ct.getCTByMaHD(h.MaHD).ToList <tblChiTietHD>(); loadListOrder2(); }
private void lbl_TenBan_Click(object sender, EventArgs e) { try { if (chuyen == 0) { ca.setMaBan(int.Parse(lbl_TenBan.Tag + "")); if ((Program.frmGM == null || Program.frmGM.IsDisposed) && lbl_TrangThai.Tag.ToString().Equals("False")) { Program.frmGM = new Form_GoiMon(); } else if ((Program.frmGM == null || Program.frmGM.IsDisposed) && lbl_TrangThai.Tag.ToString().Equals("True")) { Program.frmGM = new Form_GoiMon("a"); } Program.frmCNC.Visible = false; Program.frmGM.Show(); } else if (chuyen == 1) { if (lbl_TrangThai.Tag.ToString().Equals("False")) { int maBanMoi = int.Parse(lbl_TenBan.Tag + ""); int maBanCu = maBan; //xu li tblHoaDon h = hd.getMaHDTheoBan(maBanCu); hd.suaHoaDonMaBan(h.MaHD, maBanMoi); b.updateTTBan(maBanCu); Program.frmCNC.load2(); chuyen = 0; } else { MessageBox.Show("Mời chọn 1 bàn khác"); } } else if (chuyen == 2) { if (lbl_TrangThai.Tag.ToString().Equals("True") && maBan != int.Parse(lbl_TenBan.Tag + "")) { int maBanMoi = int.Parse(lbl_TenBan.Tag + ""); int maBanCu = maBan; //xu li b.gopBan(maBanCu, maBanMoi); Program.frmCNC.load2(); chuyen = 0; } else { MessageBox.Show("Mời chọn 1 bàn khác"); } } } catch (Exception ee) { } }
private void Form_ThanhToan_Load(object sender, EventArgs e) { try { if (ca.getCart().Count > 0) { load1(); //lbl_ThanhTien.Text = ca.tinhTong() + ""; //lbl_TongThanhToan.Text = ca.tinhTong() + ""; lbl_ThanhTien.Text = mc.convertCurrency(ca.tinhTong()) + ""; lbl_TongThanhToan.Text = mc.convertCurrency(ca.tinhTong()) + ""; lbl_TenBan.Text = "Bàn số: " + ca.getMaBan(); lbl_ThoiGianVao.Text = DateTime.Now + ""; } else if (ca.getCart2().Count == 0) { load2(); tblHoaDon h = hd.getMaHDTheoBan(ca.getMaBan()); List <tblChiTietHD> lstCT = (List <tblChiTietHD>)ct.getCTByMaHD(h.MaHD); //lbl_TongThanhToan.Text = lstCT.Sum(t => t.TongTien) + ""; lbl_ThanhTien.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien)) + ""; lbl_TongThanhToan.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien)) + ""; lbl_TenBan.Text = "Bàn số: " + ca.getMaBan(); lbl_ThoiGianVao.Text = h.TGVao + ""; } else if (ca.getCart2().Count > 0) { load3(); tblHoaDon h = hd.getMaHDTheoBan(ca.getMaBan()); List <tblChiTietHD> lstCT = (List <tblChiTietHD>)ct.getCTByMaHD(h.MaHD); double sum = ca.tinhTong2(); //lbl_ThanhTien.Text = ((double)lstCT.Sum(t => t.TongTien)+sum) + ""; //lbl_TongThanhToan.Text = ((double)lstCT.Sum(t => t.TongTien)+sum) + ""; lbl_ThanhTien.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien) + sum) + ""; lbl_TongThanhToan.Text = mc.convertCurrency((double)lstCT.Sum(t => t.TongTien) + sum) + ""; lbl_TenBan.Text = "Bàn số: " + ca.getMaBan(); lbl_ThoiGianVao.Text = h.TGVao + ""; } } catch (Exception ee) { } }