public bool IsSameVehicle(VehicleEntrance other) { return(this.Board == other.Board && DateTime.Compare(this.DateIn, other.DateIn) == 0 && DateTime.Compare(this.DateOut, other.DateOut) == 0 && this.HourPrice == other.HourPrice && this.PriceCharged == other.PriceCharged); }
public static void Out(string board, DateTime finalDate) { VehicleEntrance ve = GetVehicleInside(board); ve.DateOut = finalDate; VehicleEntranceModel.Update(ve); UpdateListDatesFromDB(); }
public static void Entry(string board, DateTime initialDate) { try { VehicleEntrance tmp = VehicleEntranceModel.Select(board); if (!tmp.InvalidDatetime(tmp.DateOut)) { // veiculo já está no estacionamento throw new VehicleIsInside(); } } catch (NotExecuteCommandSql e) { } VehicleEntrance entrance = new VehicleEntrance(board, initialDate); AddVehicle(entrance); UpdateListDatesFromDB(); }
public static void AddVehicle(VehicleEntrance vehicle) { VehicleEntranceModel.Insert(vehicle); listVehicle.Add(vehicle); }