Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        public static void Out(string board, DateTime finalDate)
        {
            VehicleEntrance ve = GetVehicleInside(board);

            ve.DateOut = finalDate;
            VehicleEntranceModel.Update(ve);
            UpdateListDatesFromDB();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
 public static void AddVehicle(VehicleEntrance vehicle)
 {
     VehicleEntranceModel.Insert(vehicle);
     listVehicle.Add(vehicle);
 }