public void TestReservationCheckInDataAccess()
        {
            var mfe           = GetMainFilterExample();
            var resCarFilterQ = new ReservationsFilterCar();
            var resFilterQ    = new ReservationsSiteFilter();
            var reqCi         = new ResActualCIQueryable();
            var resCiSiteQ    = new ResSiteCIQueryable();
            var resCiFleetQ   = new PoolingCheckInReservations();

            List <DayActualEntity> dayActuals;
            List <DayActualEntity> site;
            List <DayActualEntity> fleet;

            using (var db = new PoolingDataClassesDataContext())
            {
                var q2And3 = resCarFilterQ.FilterByCarParameters(db, mfe, true);
                q2And3 = resFilterQ.FilterByReturnLocation(q2And3, mfe);

                mfe.Branch = "";
                site       = resCiSiteQ.GetQueryableCI(q2And3, mfe, Enums.DayActualTime.THREE, db);
                mfe.Branch = "GELEJ50";
                fleet      = resCiFleetQ.GetFleetReservationsWithLabels(q2And3, mfe, Enums.DayActualTime.THREE, db);

                dayActuals = reqCi.GetQueryable(q2And3, mfe, Enums.DayActualTime.THREE);
            }


            TestResultComparison.CheckAllPoolingValues(dayActuals, fleet, site, "GELEJ50");
        }
        public static List <DayActualEntity> GetPoolingCheckInData(IMainFilterEntity mfe, bool hourlyTimeSlots
                                                                   , PoolingDataClassesDataContext db)
        {
            var q2And3 = CarParametersFilter.FilterByCarParameters(db, mfe, true);

            q2And3 = SiteParametersFilter.FilterByReturnLocation(q2And3, mfe);


            var checkinData = _reqCi.GetQueryable(q2And3, mfe,
                                                  hourlyTimeSlots ? Enums.DayActualTime.THREE : Enums.DayActualTime.THIRTY);

            var returned = checkinData.ToList();

            return(returned);
        }
Пример #3
0
 IList <DayActualEntity> GetPoolingCIData(IMainFilterEntity mfe)
 {
     using (var db = new PoolingDataClassesDataContext())
     {
         IList <DayActualEntity> l = new List <DayActualEntity>();
         try
         {
             IQueryable <App.Classes.DAL.Pooling.PoolingDataContext.Reservation> q2And3 = _resCarFilterQ.FilterByCarParameters(db, mfe, true);
             q2And3 = _resFilterQ.FilterByReturnLocation(q2And3, mfe);
             l      = _reqCi.GetQueryable(q2And3, mfe, _time).ToList();
         }
         catch (SqlException ex)
         {
             //ILog _logger = LogManager.GetLogger("Pooling");
             //if (_logger != null) _logger.Error(" SQL Exception thrown in DayActualRepository accessing Reservations table, message : " + ex.Message);
         }
         return(l);
     }
 }