/// <summary>
 /// Performs complete request by checkin trip operation.
 /// </summary>
 internal void Complete()
 {
     AppServices.Save(Model);
     Vehicle.Checkin();
 }
Example #2
0
 /// <summary>
 /// Performs save model operation.
 /// </summary>
 protected virtual void Save()
 {
     AppServices.Save(Model);
     Confirmation();
     IsNew = false;
 }
Example #3
0
 /// <summary>
 /// Deletes the given model instance.
 /// </summary>
 internal void Delete()
 {
     AppServices.Delete(Model);
 }
Example #4
0
 /// <summary>
 /// Performs sign in operation based on provided user credentials.
 /// </summary>
 /// <param name="login">User login.</param>
 /// <param name="password">Password.</param>
 /// <returns>True, if the user with specified credential exists and authenticated;
 /// otherwise, false.</returns>
 public static bool SignIn(string login, string password)
 {
     CurrentUser = AppServices.GetUser(login);
     return(CurrentUser != null && !CurrentUser.isLocked() && CurrentUser.authenticate(password));
 }
Example #5
0
 /// <summary>
 /// Creates and returns a collection of trip view model items.
 /// </summary>
 /// <returns>A collection of trip view models.</returns>
 protected override IEnumerable <TripViewModel> GetItems() =>
 from trip in AppServices.Get <Trip>() select new TripViewModel(trip);
Example #6
0
 /// <summary>
 /// Creates and returns a collection of vehicle view model items.
 /// </summary>
 /// <returns>A collection of vehicle view models.</returns>
 protected override IEnumerable <VehicleViewModel> GetItems() =>
 from vehicle in AppServices.Get <OwnedVehicle>() select new VehicleViewModel(vehicle);
        /// <summary>
        /// Checks in the vehicle.
        /// </summary>
        internal void Checkin()
        {
            IsAvailable = true;
//         Model.setMileage(Model.getMileage() + actualMileage);
            AppServices.Save(Model);
        }
 /// <summary>
 /// Checks out the vehicle.
 /// </summary>
 internal void Checkout()
 {
     IsAvailable = false;
     AppServices.Save(Model);
 }