public StopData GetStopData(string id)
        {
            var decryptedId = Encryption.EncryptDecryptQueryString.Decrypt(id, "r0b1nr0y");
            var stops       = new DatamanagementDLL.Repository.OrderStopRepository().GetOrderStopsByQuoteOrderLineId(decryptedId.ToInt());
            var bmtStop     = stops.FirstOrDefault(s => s.EventCode == "BMT");
            var firstStop   = stops.OrderBy(s => s.StopSequence).FirstOrDefault(s => s.EventCode != "BMT" && (s.EventCode == "LUL" || s.EventCode == "HLT"));
            var lastStop    = stops.OrderByDescending(s => s.StopSequence).FirstOrDefault(s => s.EventCode != "BMT" && (s.EventCode == "LLD" || s.EventCode == "DLT"));
            var bmtCity     = bmtStop == null ? null : new DatamanagementDLL.Repository.CityRepository().GetCityById(bmtStop.CityId.ToInt());

            return(new StopData
            {
                BMTCity = bmtCity,
                BMTStopDate = bmtStop == null ? (DateTime?)null : bmtStop.ArrivalDate,
                EstimatedArrivalDate = lastStop.ArrivalDate,
                Stops = stops.OrderBy(s => s.StopSequence).ToList()
            });
        }
Exemplo n.º 2
0
        public List <CityDropdown> GetBMTCitiesByLineId(string id)
        {
            var decryptedId = Encryption.EncryptDecryptQueryString.Decrypt(id, "r0b1nr0y").ToInt();
            var stops       = new DatamanagementDLL.Repository.OrderStopRepository().GetOrderStopsByQuoteOrderLineId(decryptedId);
            var lldStop     = stops.OrderBy(s => s.StopSequence).FirstOrDefault(s => s.EventCode == "LLD" || s.EventCode == "HLT");

            return(new DatamanagementDLL.Repository.CityRepository().GetCitiesByStateId(lldStop.City == null ? 0 : lldStop.City.StateID.ToInt())
                   .Where(c => c.UseCityForDupCitySTZip3Ind == true)
                   .Select(c => new CityDropdown
            {
                CityId = c.CityID,
                CityStateZip = c.CityStateZip
            })
                   .ToList());
        }