示例#1
0
        private void HoaDonToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormHoaDon frmHoadon = new FormHoaDon();

            frmHoadon.frmMain = this;
            frmHoadon.ShowDialog();
        }
示例#2
0
        private void TraPhongToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lsvMain.SelectedItems.Count <= 0)
            {
                MessageBox.Show("Vui lòng chọn 1 phòng!!!");
                return;
            }
            pBUS = new PhongBUS();
            PhongDTO pDTO = pBUS.getPhongByID(lsvMain.SelectedItems[0].Text);

            if (pDTO.Danhan == true)
            {
                string mpt = "";
                ctdpBUS = new ChiTietDatPhongBUS();
                IList <ChiTietDatPhongDTO> listctdp = ctdpBUS.getListChiTietDatPhongByName(pDTO.Maphong);
                foreach (ChiTietDatPhongDTO ctdp in listctdp)
                {
                    pdpBUS = new PhieuDatPhongBUS();
                    ptpBUS = new PhieuThuePhongBUS();
                    PhieuDatPhongDTO          pdp = pdpBUS.getPhieuDatPhongByID(ctdp.Maphieudat);
                    IList <PhieuThuePhongDTO> ptp = ptpBUS.getListPhieuThuePhongByMaPhieuDat(pdp.Maphieudat);
                    if (ptp != null)
                    {
                        foreach (PhieuThuePhongDTO pt in ptp)
                        {
                            mpt = pt.Maphieuthue;
                        }
                    }
                }
                FormHoaDon frmHD = new FormHoaDon();
                frmHD.frmMain     = this;
                frmHD.maphieuthue = mpt;
                frmHD.ShowDialog();
            }
            else
            {
                MessageBox.Show("Phòng chưa có người!");
                return;
            }
        }