public static Expression <Func <SalesQuote, SalesQuoteDetailReturn> > SelectDetail() { var key = SelectKey(); var shipment = ShipmentInformationProjectors.SelectDetail(InventoryOrderEnum.Unknown); var facility = FacilityProjectors.Select(false, false); var company = CompanyProjectors.SelectSummary(); var item = SalesQuoteItemProjectors.Select(); return(Projector <SalesQuote> .To(q => new SalesQuoteDetailReturn { SalesQuoteKeyReturn = key.Invoke(q), QuoteNumber = q.QuoteNum, QuoteDate = q.QuoteDate, DateReceived = q.DateReceived, CalledBy = q.CalledBy, TakenBy = q.TakenBy, PaymentTerms = q.PaymentTerms, ShipFromReplace = q.SoldTo, Shipment = shipment.Invoke(q.ShipmentInformation), SourceFacility = new[] { q.SourceFacility }.Where(f => f != null).Select(f => facility.Invoke(f)).FirstOrDefault(), Customer = new[] { q.Customer }.Where(c => c != null).Select(c => company.Invoke(c.Company)).FirstOrDefault(), Broker = new[] { q.Broker }.Where(b => b != null).Select(b => company.Invoke(b)).FirstOrDefault(), Items = q.Items.Select(i => item.Invoke(i)) })); }
private static IEnumerable <Expression <Func <Contract, ContractBaseReturn> > > SelectContractBase() { var key = SelectKey(); var company = CompanyProjectors.SelectSummary(); var warehouse = FacilityProjectors.Select(false, true); return(new[] { Projector <Contract> .To(c => new ContractBaseReturn { ContractKeyReturn = key.Invoke(c), CustomerPurchaseOrder = c.CustomerPurchaseOrder, ContractNumber = c.ContractId, ContractDate = c.ContractDate, TermBegin = c.TermBegin, TermEnd = c.TermEnd, PaymentTerms = c.PaymentTerms, ContactName = c.ContactName, FOB = c.FOB, ContractType = c.ContractType, ContractStatus = c.ContractStatus, DefaultPickFromFacility = warehouse.Invoke(c.DefaultPickFromFacility) }), Projector <Contract> .To(c => new ContractBaseReturn { Customer = company.Invoke(c.Customer.Company), Broker = company.Invoke(c.Broker), }) }); }
internal static Expression <Func <Location, LocationReturn> > SelectLocation() { var locationKey = SelectLocationKey(); var facilityKey = FacilityProjectors.SelectFacilityKey(); return(Projector <Location> .To(l => new LocationReturn { LocationKeyReturn = locationKey.Invoke(l), Description = l.Description, Active = l.Facility.Active, Status = !l.Active ? LocationStatus.InActive : l.Locked ? LocationStatus.Locked : LocationStatus.Available, FacilityKeyReturn = facilityKey.Invoke(l.Facility), FacilityName = l.Facility.Name })); }
private static Expression <Func <InventoryShipmentOrder, InventoryShipmentOrderBaseReturn> > SelectShipmentOrderBase() { var key = SelectKey(); var facility = FacilityProjectors.Select(false, true); return(i => new InventoryShipmentOrderBaseReturn { InventoryShipmentOrderKeyReturn = key.Invoke(i), MoveNum = i.MoveNum, OrderStatus = i.OrderStatus, DateCreated = i.DateCreated, ShipmentDate = i.ShipmentInformation.ShipmentDate, OriginFacility = facility.Invoke(i.SourceFacility), DestinationFacility = new[] { i.DestinationFacility }.Where(f => f != null).Select(f => facility.Invoke(f)).FirstOrDefault() }); }