public Xe(Xe x) { this.maPhieu = x.maPhieu; this.color = x.color; this.choDeXe = x.choDeXe; this.phiDichVu = 0; this.time = DateTime.Now; }
public static object xacNhanMatThe(User person, Xe x, Database db) { if (db.truyVanKhiMatTheXe(x, person) == true) { db.doanhSo += 50000; return("Kiểm tra hợp lệ" + "\nĐền thẻ 50000"); } return("Sai thông tin"); }
public static object thaoTacCheckIn(Xe x, User a, Database db) { if (db.check_in(x, a) == true) { db.chiDuong += huongDan; x.choDeXe.soXeHienTai++; return("Check_in thành công" + x.inThongTin() + "\nHướng dẫn vào: " + db.thucHienChiDuong(x.choDeXe)); } return("Check_in thất bại"); }
public bool check_in(Xe x, User person) { if (person.phuongTien == x) { x.nguoiDung = person; person.maPhieu = x.maPhieu; listXe.Add(x); return(true); } return(false); }
public static object thaoTacCheckOut(Xe x, User a, Database db) { if (db.truyVan(a, x) == true) { x.eventTinhTien += thaoTacTinhTien; double tien = (double)x.thucHienTinhTien(x, a); db.doanhSo += tien; x.choDeXe.soXeHienTai--; return("Thông tin chính xác: Check_out thành công" + "\nTiền gửi xe: " + tien + x.inThongTin() + "\nPhí dịch vụ: " + x.phiDichVu); } return("Sai thông tin"); }
public static object thaoTacTinhTien(Xe x, User a) { double tien; if (DateTime.Now.Hour == x.time.Hour) { tien = x.tienTheoGio(); } else { tien = (DateTime.Now.Hour - x.time.Hour) * x.tienTheoGio(); } return(tien); }
public bool truyVanKhiMatTheXe(Xe x, User a) { var xe = from chiecXe in listXe where a.hinhAnh == chiecXe.nguoiDung.hinhAnh select chiecXe; foreach (var chiecXe in xe) { if (chiecXe == x && chiecXe.color == x.color) { listXe.Remove(chiecXe); return(true); } } return(false); }
public bool truyVan(User person, Xe x) { var xe = from chiecXe in listXe where person.maPhieu == chiecXe.maPhieu select chiecXe; foreach (var chiecXe in xe) { Console.WriteLine(chiecXe.maPhieu); if (x.maPhieu == chiecXe.maPhieu && chiecXe.nguoiDung.hinhAnh == person.hinhAnh && chiecXe == x) { listXe.Remove(chiecXe); return(true); } } return(false); }
public object thucHienCheckOut(Xe x, User person, Database db) { return(chupRa?.Invoke(x, person, db)); }
public object thuTucMatThe(User person, Xe x, Database db) { return(nhanDien?.Invoke(person, x, db)); }
public User(string hinhAnh, Xe phuongTien) { this.hinhAnh = hinhAnh; this.phuongTien = phuongTien; }
private static object diRuaXe(Xe x) { x.phiDichVu += 30000; return("Đã rửa xe xong"); }
public static object diSuaXe(Xe x) { x.phiDichVu += 20000; return("Sửa xe xong"); }
public object thucHienTinhTien(Xe x, User a) { return(eventTinhTien?.Invoke(x, a)); }
public User(User x) { this.hinhAnh = x.hinhAnh; this.phuongTien = x.phuongTien; }
public object thucHienRuaXe(Xe x) { return(dichVu?.Invoke(x)); }
public void themXe(Xe x) { listXe.Add(x); }