//{ // if (!ViewSettings.CanShowFilterDate()) // { // RouteSimulators.Clear(); // XElement xml = new XElement("DATA", SelectedManifests.Select(i => new XElement("MANIFEST", // new XElement("ID", i.manifestId), // new XElement("EXTERNAL_MANIFEST_ID", i.externalManifestId), // new XElement("IS_EXTERNAL", i.isExternal) // ))); // SimulatorDetails = UnitOfWork.GetManifestDetailByXML(xml); // SimulateManifests(); // } // else // { // SimulatorDetails = UnitOfWork.GetManifestDetailByListId(ListManifest); // SimulateManifests(); // } //} public void SaveAndCloseEntity() { try { if (RouteSimulators.Count <= 0) { return; } Entity.CreatedDate = DateTime.Now; Entity.QuantityDelivery = SelectedManifests.Count(); Entity.QuantityManifest = RouteSimulators.Select(x => x.ManifestId).Distinct().Count(); Entity.DistanceToTravel = RouteSimulators.Sum(x => x.DistanceToTravel).Value; Entity.QuantityVehicles = RouteSimulators.Select(x => x.VehicleId).Distinct().Count(); base.SaveAndClose(); } catch (Exception ex) { MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.SaveError) + ex.Message, ex.Message, MessageButton.OK, MessageIcon.Error); } }
public bool CanSimulateRoute() { return(SelectedManifests.Count() > 0 || ListManifest != null); }