public static String XuatChuoi(PHIEUTHUE P) { String kq = "Ho ten: " + P.HoTen + "\n"; kq = kq + "So ngay thue: " + P.SoNgay + "\n"; kq = kq + "Loai phong thue: " + P.LoaiPhong.Ten; return(kq); }
public static Double TinhTien(LOAIPHONG P, PHIEUTHUE Phieu) { Double kq = 0; if (SoSanh(P, Phieu.LoaiPhong)) { kq = (Double)(P.DonGia * Phieu.SoNgay); } return(kq); }
public static Double TinhTien(KHACHSAN P, PHIEUTHUE Phieu) { Double kq = 0; for (int i = 0; kq == 0 && i < P.PhongThue.Length; i++) { kq = XuLyLoaiPhong.TinhTien(P.PhongThue[i], Phieu); } if (Phieu.SoNgay > P.MucGiam) { kq = kq - kq * P.TyLeGiam / 100; } return(kq); }
static void Main(string[] args) { KHACHSAN KS = XuLyKhachSan.Doc("ThuePhong.txt"); String Chuoi = "Du lieu khong hop le"; if (KS.PhongThue != null) { XuLyChuoi.Xuat(XuLyKhachSan.XuatChuoi(KS)); Console.WriteLine(); PHIEUTHUE Phieu = XuLyPhieuThue.Nhap(KS, "Nhap thong tin cua phieu thue phong:\n"); Double kq = XuLyKhachSan.TinhTien(KS, Phieu); Chuoi = "So tien phai tra la: " + XuLySoThuc.XuatChuoi(kq); } XuLyChuoi.Xuat(Chuoi); }