Пример #1
0
        private void PhieuThuePhongToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormPhieuThuePhong frmPhieuThuePhong = new FormPhieuThuePhong();

            frmPhieuThuePhong.frmMain = this;
            frmPhieuThuePhong.ShowDialog();
        }
Пример #2
0
        private void DichVuToolStripMenuItem1_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;
                        }
                    }
                }
                FormPhieuThuePhong frmPTP = new FormPhieuThuePhong();
                frmPTP.frmMain     = this;
                frmPTP.maphong     = pDTO.Maphong;
                frmPTP.maphieuthue = mpt;
                frmPTP.ShowDialog();
            }
            else
            {
                MessageBox.Show("Phòng chưa có người!");
                return;
            }
        }