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); }
public void TestReservationCheckOutDataAccess() { var mfe = GetMainFilterExample(); var resCarFilterQ = new ReservationsFilterCar(); var resFilterQ = new ReservationsSiteFilter(); var reqCo = new PoolingCheckOutReservations(); var resCOSiteQ = new ResSiteCOQueryable(); var resCOFleetQ = new PoolingCheckOutReservationsWithLabels(); List <DayActualEntity> dayActuals; List <DayActualEntity> fleet; List <DayActualEntity> site; using (var db = new PoolingDataClassesDataContext()) { var q2And3 = resCarFilterQ.FilterByCarParameters(db, mfe, false); q2And3 = resFilterQ.FilterByRentalLocation(q2And3, mfe); mfe.Branch = ""; site = resCOSiteQ.GetQueryableCO(q2And3, mfe, Enums.DayActualTime.THREE).ToList(); mfe.Branch = "GELEJ50"; fleet = resCOFleetQ.GetQueryable(q2And3, mfe, Enums.DayActualTime.THREE).ToList(); dayActuals = reqCo.GetReservationsWithoutLabels(q2And3, mfe, Enums.DayActualTime.THREE).ToList(); } TestResultComparison.CheckAllPoolingValues(dayActuals, fleet, site, "GELEJ50"); }
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 IList <IReservationDetailsEntity> getList(IMainFilterEntity filter, IReservationDetailsFilterEntity rdfe, string sortExpression, string sortDirection) { using (var db = new PoolingDataClassesDataContext()) { //db.Log = new DebugTextWriter(); IQueryable <Mars.App.Classes.DAL.Pooling.PoolingDataContext.Reservation> q = _resCarFilterQ.FilterByCarParameters(db, filter); if (rdfe.CheckInOut == CHECKIN) { q = _resFilterQ.FilterByReturnLocation(q, filter); q = _resCIQueryable.GetQueryable(q, rdfe, filter); } else { q = _resFilterQ.FilterByRentalLocation(q, filter); q = _resCOQueryable.GetQueryable(q, rdfe, filter); } q = _resBFQ.GetQueryable(q, rdfe); q = _resSortQ.getQueryable(sortExpression, sortDirection, q); _list = _resDetQ.getQueryable(db, q).ToList(); var ss = _list.Count(); return(_list); } }
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); } }
IList <DayActualEntity> GetPoolingCIData(Enums.DayActualTime tme) { using (PoolingDataClassesDataContext db = new PoolingDataClassesDataContext()) { IList <DayActualEntity> l = new List <DayActualEntity>(); try { IQueryable <App.Classes.DAL.Pooling.PoolingDataContext.Reservation> q2And3 = _resCarFilterQ.FilterByCarParameters(db, Filter, true); q2And3 = _resFilterQ.FilterByReturnLocation(q2And3, Filter); l = _resFleetCIQ.GetFleetReservationsWithLabels(q2And3, Filter, tme, db).ToList(); } catch (SqlException ex) { // ILog _logger = log4net.LogManager.GetLogger("Pooling"); // if (_logger != null) _logger.Error(" SQL Exception thrown in SiteComparisonRepository accessing Reservations table, message : " + ex.Message); } return(l); } }
IList <AlertTempEntity> GetPoolingCIData() { using (var db = new PoolingDataClassesDataContext()) { var l = new List <AlertTempEntity>(); try { IQueryable <App.Classes.DAL.Pooling.PoolingDataContext.Reservation> q1 = _resCarFilterQ.FilterByCarParameters(db, Filter, true); q1 = _resFilterQ.FilterByReturnLocation(q1, Filter); l = _resQCi.GetQueryable(q1, DateSelected).ToList(); //l = l.OrderByDescending(d => d.Amnt).ToList(); } catch (SqlException ex) { // ILog _logger = log4net.LogManager.GetLogger("Pooling"); // if (_logger != null) _logger.Error(" SQL Exception thrown in AlertsRepository accessing Reservations table, message : " + ex.Message); } return(l); } }