private void hóaĐơnToolStripMenuItem_Click(object sender, EventArgs e) { FormHoaDon frmHoadon = new FormHoaDon(); frmHoadon.frmMain = this; frmHoadon.ShowDialog(); }
private void trảPhòngToolStripMenuItem_Click(object sender, EventArgs e) { if (lsvMain.SelectedItems.Count <= 0) { MessageBox.Show("chon mot phong!!!"); return; } PhongDTO pDTO = client.getPhongByID(lsvMain.SelectedItems[0].Text); if (pDTO.Danhan == true) { string mpt = ""; IList <ChiTietDatPhongDTO> listctdp = client1.getListChiTietDatPhongByName(pDTO.Maphong); foreach (ChiTietDatPhongDTO ctdp in listctdp) { PhieuDatPhongDTO pdp = client2.getPhieuDatPhongByID(ctdp.Maphieudat); IList <PhieuThuePhongDTO> ptp = client3.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; } }
private void trảPhòngToolStripMenuItem_Click(object sender, EventArgs e) { if (lsvMain.SelectedItems.Count <= 0) { MessageBox.Show("chon mot phong!!!"); return; } PhongDTO pDTO = client.getPhongByID(lsvMain.SelectedItems[0].Text); if (pDTO.Danhan == true) { string mpt = ""; IList<ChiTietDatPhongDTO> listctdp = client1.getListChiTietDatPhongByName(pDTO.Maphong); foreach (ChiTietDatPhongDTO ctdp in listctdp) { PhieuDatPhongDTO pdp = client2.getPhieuDatPhongByID(ctdp.Maphieudat); IList<PhieuThuePhongDTO> ptp = client3.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; } }