Example #1
0
        private void FrmBanHang_FormClosed(object sender, FormClosedEventArgs e)
        {
            _Instance = null;

            frmDatMon frmDM = new frmDatMon();

            frmDM.MdiParent = this.MdiParent;
            frmDM.Dock      = DockStyle.Fill;

            frmDM.Show();
            frmDM.TaoHDBanHang();
        }
Example #2
0
 private void btnThanhToan_Click(object sender, EventArgs e)
 {
     if (CTHDBanHangBUS.SoLuongMonAnCTHD(hdBH.MaHD) > 0)
     {
         this.Hide();
         frmBanHang frmBH = new frmBanHang(hdBH);
         frmBH.MdiParent = this.MdiParent;
         frmBH.Dock      = DockStyle.Fill;
         frmBH.Show();
     }
     else
     {
         MessageBox.Show("Bạn cần ít nhất 1 món ăn để thanh toán!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #3
0
        // MDI frmBanHang
        void MoFormBanHang()
        {
            Form frm = KiemTraFormTonTai(typeof(frmBanHang));

            if (frm != null)
            {
                frm.Activate();
            }
            else
            {
                frmBanHang m_frmHoaDonThanhToan = frmBanHang.Instance;
                m_frmHoaDonThanhToan.MdiParent = this;
                m_frmHoaDonThanhToan.Dock      = DockStyle.Fill;
                m_frmHoaDonThanhToan.Show();
            }
        }
Example #4
0
        public void HienHDBanHang(int maHD)
        {
            List <rptHDBanHangDTO> lsHDBanHang = rptHDBanHangBUS.ReportLayHDBanHang(maHD);
            string tienMat  = "";
            string tienThua = "";

            rpvBaoCao.LocalReport.ReportEmbeddedResource = s + "rptHDBanHang.rdlc";
            rptCTHDBanHangDTO rptCTHD = rptCTHDBanHangBUS.ReportLaySoLuongCTHDBH(maHD);

            rpvBaoCao.LocalReport.SetParameters(new ReportParameter("paSoLuong", rptCTHD.TongSoLuong.ToString()));
            frmBanHang frmBH = new frmBanHang();

            if (!string.IsNullOrEmpty(_tienMat) && !string.IsNullOrEmpty(_tienThua))
            {
                tienMat  = String.Format("{0:#,##0 VND}", _tienMat);
                tienThua = _tienThua;
            }
            rpvBaoCao.LocalReport.SetParameters(new ReportParameter("paTienMat", tienMat));
            rpvBaoCao.LocalReport.SetParameters(new ReportParameter("paTienThua", tienThua));
            rpvBaoCao.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing3);
            rpvBaoCao.LocalReport.DataSources.Add(new ReportDataSource("DSHDBanHang", lsHDBanHang));
            rpvBaoCao.RefreshReport();
        }