예제 #1
0
        // 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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public VehicleRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
 public PriceGroupItemRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #5
0
 public UserRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
 public BookingReceiptRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #7
0
 public GarageWorkingTimeRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #8
0
 public GarageRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #9
0
 public CategoryRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #10
0
 public ModelRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #11
0
 public LocationRepository(CRPEntities dbContext) : base(dbContext)
 {
 }
예제 #12
0
 public BaseRepository(CRPEntities dbContext)
 {
     this.entites = dbContext;
     this.dbSet   = dbContext.Set <TEntity>();
 }
예제 #13
0
 public BrandRepository(CRPEntities dbContext) : base(dbContext)
 {
 }