// Handler for TryBookingApi // Remove booking if it is still pending upon called private static void CheckPendingBooking(int bookingID) { var dbContext = new CRPEntities(); var bookingService = new BookingReceiptService(new UnitOfWork(dbContext), new BookingReceiptRepository(dbContext)); var bookingReceipt = bookingService.Get(bookingID); if (bookingReceipt != null && bookingReceipt.IsPending) { bookingService.Delete(bookingReceipt); } }
private void CheckProviderEndDate() { var dbContext = new CRPEntities(); DateTime current = DateTime.Now; var userService = new UserService(new UnitOfWork(dbContext), new UserRepository(dbContext)); var listUser = userService.Get(q => q.AspNetRoles.Any(r => r.Name == "Provider") && q.IsProviderUntil < current); foreach (var user in listUser) { var userRole = user.AspNetRoles.Where(q => q.Name == "Provider").FirstOrDefault(); user.AspNetRoles.Remove(userRole); } dbContext.SaveChanges(); //AlertToNextProvider(); var next3Days = new DateTime(current.Year, current.Month, current.Day + 3, current.Hour, current.Minute, current.Second); var next2Days = new DateTime(current.Year, current.Month, current.Day + 2, current.Hour, current.Minute, current.Second); var userEndInNext3Days = userService.Get(q => q.AspNetRoles.Any(r => r.Name == "Provider") && q.IsProviderUntil <next3Days && q.IsProviderUntil> next2Days); foreach (var user in userEndInNext3Days) { SendExpiredAlertEmailToProvider(user); } }
public VehicleRepository(CRPEntities dbContext) : base(dbContext) { }
public PriceGroupItemRepository(CRPEntities dbContext) : base(dbContext) { }
public UserRepository(CRPEntities dbContext) : base(dbContext) { }
public BookingReceiptRepository(CRPEntities dbContext) : base(dbContext) { }
public GarageWorkingTimeRepository(CRPEntities dbContext) : base(dbContext) { }
public GarageRepository(CRPEntities dbContext) : base(dbContext) { }
public CategoryRepository(CRPEntities dbContext) : base(dbContext) { }
public ModelRepository(CRPEntities dbContext) : base(dbContext) { }
public LocationRepository(CRPEntities dbContext) : base(dbContext) { }
public BaseRepository(CRPEntities dbContext) { this.entites = dbContext; this.dbSet = dbContext.Set <TEntity>(); }
public BrandRepository(CRPEntities dbContext) : base(dbContext) { }