public List <EventCustomerRegistrationViewData> GetEventCustomerOrdersForEvent(EventCustomerFilterMode eventCustomerFilterMode, long eventId) { var customerOrderBasicInfoTypedView = new CustomerOrderBasicInfoTypedView(); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { var linqMetaData = new LinqMetaData(myAdapter); var eventCustomerIds = linqMetaData.EventCustomers.Where(ec => ec.EventId == eventId).Select(ec => ec.EventCustomerId); // Hack: This is done to minimize the fetch time for the query. var fieldCompareRangePredicate = new FieldCompareRangePredicate(CustomerOrderBasicInfoFields.EventCustomerId, null, eventCustomerIds); var bucket = new RelationPredicateBucket(fieldCompareRangePredicate); //var bucket = new RelationPredicateBucket(CustomerOrderBasicInfoFields.EventId == eventId); //var predicates = _eventCustomerFilterPredicateFactory.CreatePredicate(eventCustomerFilterMode); //foreach (var predicate in predicates) //{ // bucket.PredicateExpression.AddWithAnd(predicate); //} myAdapter.FetchTypedView(customerOrderBasicInfoTypedView, bucket, false); IEnumerable <CustomerOrderBasicInfoRow> customerOrderBasicInfoRows = _eventCustomerFilterPredicateFactory.GetFilteredData(eventCustomerFilterMode, customerOrderBasicInfoTypedView); return(_factory.Create(customerOrderBasicInfoRows, _physicianAssignmentService.GetPhysicianAssignments(eventId, eventCustomerIds))); } }
public List<CustomerEventRegistrationViewData> GetCustomerEventRegistrationViewData(long customerId) { var customerOrderBasicInfoTypedView = new CustomerOrderBasicInfoTypedView(); var bucket = new RelationPredicateBucket(CustomerOrderBasicInfoFields.CustomerId == customerId); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.FetchTypedView(customerOrderBasicInfoTypedView, bucket, false); } return _customerEventRegistrationViewDataFactory.Create(customerOrderBasicInfoTypedView); }
public EventCustomerRegistrationViewData GetEventCustomerOrders(long customerId, long eventId) { var customerOrderBasicInfoTypedView = new CustomerOrderBasicInfoTypedView(); var bucket = new RelationPredicateBucket(CustomerOrderBasicInfoFields.EventId == eventId); bucket.PredicateExpression.AddWithAnd(CustomerOrderBasicInfoFields.CustomerId == customerId); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.FetchTypedView(customerOrderBasicInfoTypedView, bucket, false); } return(_factory.Create(customerOrderBasicInfoTypedView, null).FirstOrDefault()); }
public List <EventCustomerRegistrationViewData> GetEventCustomerOrders(List <long> eventCustomerIds) { var customerOrderBasicInfoTypedView = new CustomerOrderBasicInfoTypedView(); var fieldCompareRangePredicate = new FieldCompareRangePredicate(CustomerOrderBasicInfoFields.EventCustomerId, null, eventCustomerIds); var bucket = new RelationPredicateBucket(fieldCompareRangePredicate); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.FetchTypedView(customerOrderBasicInfoTypedView, bucket, false); } return(_factory.Create(customerOrderBasicInfoTypedView, null)); }
public List <EventCustomerRegistrationViewData> GetEventCustomerOrdersForEvent(long eventId) { var customerOrderBasicInfoTypedView = new CustomerOrderBasicInfoTypedView(); var bucket = new RelationPredicateBucket(CustomerOrderBasicInfoFields.EventId == eventId); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.CommandTimeOut = CommandTimeOut; myAdapter.FetchTypedView(customerOrderBasicInfoTypedView, bucket, false); } var eventCustomerIds = customerOrderBasicInfoTypedView.Select(vw => vw.EventCustomerId).ToArray(); return(_factory.Create(customerOrderBasicInfoTypedView, _physicianAssignmentService.GetPhysicianAssignments(eventId, eventCustomerIds))); }
public List <CustomerEventRegistrationViewData> Create(CustomerOrderBasicInfoTypedView customerOrderBasicInfoTypedView) { var customerEventRegistrationViewData = new List <CustomerEventRegistrationViewData>(); foreach (var orderBasicInfoTypedView in customerOrderBasicInfoTypedView) { var customerEventRegistrationViewDatum = new CustomerEventRegistrationViewData(); _eventCustomerViewDataFactory.Create(customerEventRegistrationViewDatum, orderBasicInfoTypedView); //customerEventRegistrationViewDatum.AAATestEvaluationState = // (TestResultStateNumber) orderBasicInfoTypedView.AaatestEvaluation; //customerEventRegistrationViewDatum.ASITestEvaluationState = // (TestResultStateNumber) orderBasicInfoTypedView.AsitestEvaluation; //customerEventRegistrationViewDatum.CarotidTestEvaluationState = // (TestResultStateNumber) orderBasicInfoTypedView.CarotidTestEvaluation; //customerEventRegistrationViewDatum.EKGTestEvaluationState = // (TestResultStateNumber) orderBasicInfoTypedView.EkgtestEvaluation; //customerEventRegistrationViewDatum.FraminghamTestEvaluationState = // (TestResultStateNumber) orderBasicInfoTypedView.FraminghamTestEvaluation; //customerEventRegistrationViewDatum.LipidTestEvaluationState = // (TestResultStateNumber)orderBasicInfoTypedView.LipidTestEvaluation; //customerEventRegistrationViewDatum.LiverTestEvaluationState = // (TestResultStateNumber)orderBasicInfoTypedView.LiverTestEvaluation; //customerEventRegistrationViewDatum.OsteoTestEvaluationState = // (TestResultStateNumber)orderBasicInfoTypedView.OsteoTestEvaluation; //customerEventRegistrationViewDatum.PADTestEvaluationState = // (TestResultStateNumber)orderBasicInfoTypedView.PadtestEvaluation; customerEventRegistrationViewDatum.FranchiseeName = orderBasicInfoTypedView.FranchiseeName; customerEventRegistrationViewDatum.HostOrganizationName = orderBasicInfoTypedView.OrganizationName; //customerEventRegistrationViewDatum.IsAAAPartial = orderBasicInfoTypedView.AaapartialState; //customerEventRegistrationViewDatum.IsASIPartial = orderBasicInfoTypedView.AsipartialState; //customerEventRegistrationViewDatum.IsCarotidPartial = orderBasicInfoTypedView.CarotidPartialState; //customerEventRegistrationViewDatum.IsEKGPartial = orderBasicInfoTypedView.EkgpartialState; //customerEventRegistrationViewDatum.IsFraminghamPartial = orderBasicInfoTypedView.FraminghamPartialState; //customerEventRegistrationViewDatum.IsLipidPartial = orderBasicInfoTypedView.LipidPartialState; //customerEventRegistrationViewDatum.IsLiverPartial = orderBasicInfoTypedView.LiverPartialState; //customerEventRegistrationViewDatum.IsOsteoPartial = orderBasicInfoTypedView.OsteoPartialState; //customerEventRegistrationViewDatum.IsPADPartial = orderBasicInfoTypedView.PadpartialState; customerEventRegistrationViewData.Add(customerEventRegistrationViewDatum); } return(customerEventRegistrationViewData.OrderByDescending(cerv => cerv.EventSignupDate).ToList()); }
public IEnumerable <CustomerOrderBasicInfoRow> GetFilteredData(EventCustomerFilterMode eventCustomerFilterMode, CustomerOrderBasicInfoTypedView customerOrderBasicInfoTypedView) { switch (eventCustomerFilterMode) { case EventCustomerFilterMode.Actual: { return(customerOrderBasicInfoTypedView.Where(q => q.IsTestAttended == 1)); } case EventCustomerFilterMode.Cash: { return(customerOrderBasicInfoTypedView.Where(q => q.Cash != 0m)); } case EventCustomerFilterMode.Check: { return(customerOrderBasicInfoTypedView.Where(q => q.Check != 0m)); } case EventCustomerFilterMode.CreditCard: { return(customerOrderBasicInfoTypedView.Where(q => q.CreditCard != 0m)); } case EventCustomerFilterMode.ECheck: { return(customerOrderBasicInfoTypedView.Where(q => q.Echeck != 0m)); } case EventCustomerFilterMode.NoShow: { return(customerOrderBasicInfoTypedView.Where(q => q.Noshow == false)); } case EventCustomerFilterMode.Paid: { return(customerOrderBasicInfoTypedView.Where(q => q.IsPaid == 1)); } case EventCustomerFilterMode.Registered: { return(customerOrderBasicInfoTypedView); } case EventCustomerFilterMode.UnPaid: { return(customerOrderBasicInfoTypedView.Where(q => q.IsPaid == 0)); } case EventCustomerFilterMode.UnPaidNoShowExcluded: { return(customerOrderBasicInfoTypedView.Where(q => q.IsPaid == 0 && q.Noshow == false)); } case EventCustomerFilterMode.LeftWithoutScreening: { return(customerOrderBasicInfoTypedView.Where(q => q.LeftWithoutScreeningReasonId > 0)); } default: throw new NotSupportedException(string.Format("The FilterMode {0} is not yet supported.", eventCustomerFilterMode)); } }