public virtual DepartureMonitorDetailViewResult TranslateFromResultToResult(DepartureMonitorOverviewViewResult fromViewResult, string valueBinding) { DepartureMonitorDetailViewResult toViewResult = null; if (fromViewResult != null) { toViewResult = new DepartureMonitorDetailViewResult(); toViewResult.DepartureId = fromViewResult.DepartureId; toViewResult.PlannedDepartureTime = fromViewResult.PlannedDepartureTime; toViewResult.RouteId = fromViewResult.RouteId; toViewResult.RouteDescription = fromViewResult.RouteDescription; toViewResult.ForwarderId = fromViewResult.ForwarderId; toViewResult.NumOfNotComposedOrders = fromViewResult.NumOfNotComposedOrders; toViewResult.NumOfNotReceivedTransits = fromViewResult.NumOfNotReceivedTransits; Type fromViewResultType = fromViewResult.GetType(); toViewResult.OnShipLoc = ((decimal?)fromViewResultType.GetProperty(valueBinding + "OnShipLoc").GetValue(fromViewResult, null)).GetValueOrDefault(); toViewResult.PickNotOnShipLoc = ((decimal?)fromViewResultType.GetProperty(valueBinding + "PickNotOnShipLoc").GetValue(fromViewResult, null)).GetValueOrDefault(); toViewResult.PallNotOnShipLoc = ((decimal?)fromViewResultType.GetProperty(valueBinding + "PallNotOnShipLoc").GetValue(fromViewResult, null)).GetValueOrDefault(); toViewResult.TransNotOnShipLoc = ((decimal?)fromViewResultType.GetProperty(valueBinding + "TransNotOnShipLoc").GetValue(fromViewResult, null)).GetValueOrDefault(); toViewResult.OtherNotOnShipLoc = ((decimal?)fromViewResultType.GetProperty(valueBinding + "OtherNotOnShipLoc").GetValue(fromViewResult, null)).GetValueOrDefault(); } return(toViewResult); }
private void DepartureHyperLinkClicked(object sender, RoutedEventArgs e) { string departureId = (string)((Imi.Framework.Wpf.Controls.HyperLink)(e.Source)).Content; DepartureMonitorOverviewViewResult currentDeparture = _currentData.Where(r => r.DepartureId == departureId).FirstOrDefault(); if (currentDeparture != null) { CurrentItem = currentDeparture; HyperLinkClicked(sender, e); presenter.OnViewUpdated(_currentData); } }
private void CleraZeroValues(DepartureMonitorOverviewViewResult result) { if (result.NoCarsOnShipLoc.GetValueOrDefault() == 0 && result.NoCarsPickNotOnShipLoc.GetValueOrDefault() == 0 && result.NoCarsPallNotOnShipLoc.GetValueOrDefault() == 0 && result.NoCarsTransNotOnShipLoc.GetValueOrDefault() == 0 && result.NoCarsOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.NoCarsOnShipLoc = null; result.NoCarsPickNotOnShipLoc = null; result.NoCarsPallNotOnShipLoc = null; result.NoCarsTransNotOnShipLoc = null; result.NoCarsOtherNotOnShipLoc = null; } if (result.NoPaksOnShipLoc.GetValueOrDefault() == 0 && result.NoPaksPickNotOnShipLoc.GetValueOrDefault() == 0 && result.NoPaksPallNotOnShipLoc.GetValueOrDefault() == 0 && result.NoPaksTransNotOnShipLoc.GetValueOrDefault() == 0 && result.NoPaksOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.NoPaksOnShipLoc = null; result.NoPaksPickNotOnShipLoc = null; result.NoPaksPallNotOnShipLoc = null; result.NoPaksTransNotOnShipLoc = null; result.NoPaksOtherNotOnShipLoc = null; } if (result.CarSizeOnShipLoc.GetValueOrDefault() == 0 && result.CarSizePickNotOnShipLoc.GetValueOrDefault() == 0 && result.CarSizePallNotOnShipLoc.GetValueOrDefault() == 0 && result.CarSizeTransNotOnShipLoc.GetValueOrDefault() == 0 && result.CarSizeOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.CarSizeOnShipLoc = null; result.CarSizePickNotOnShipLoc = null; result.CarSizePallNotOnShipLoc = null; result.CarSizeTransNotOnShipLoc = null; result.CarSizeOtherNotOnShipLoc = null; } if (result.LoadMOnShipLoc.GetValueOrDefault() == 0 && result.LoadMPickNotOnShipLoc.GetValueOrDefault() == 0 && result.LoadMPallNotOnShipLoc.GetValueOrDefault() == 0 && result.LoadMTransNotOnShipLoc.GetValueOrDefault() == 0 && result.LoadMOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.LoadMOnShipLoc = null; result.LoadMPickNotOnShipLoc = null; result.LoadMPallNotOnShipLoc = null; result.LoadMTransNotOnShipLoc = null; result.LoadMOtherNotOnShipLoc = null; } if (result.WeightOnShipLoc.GetValueOrDefault() == 0 && result.WeightPickNotOnShipLoc.GetValueOrDefault() == 0 && result.WeightPallNotOnShipLoc.GetValueOrDefault() == 0 && result.WeightTransNotOnShipLoc.GetValueOrDefault() == 0 && result.WeightOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.WeightOnShipLoc = null; result.WeightPickNotOnShipLoc = null; result.WeightPallNotOnShipLoc = null; result.WeightTransNotOnShipLoc = null; result.WeightOtherNotOnShipLoc = null; } if (result.VolumeOnShipLoc.GetValueOrDefault() == 0 && result.VolumePickNotOnShipLoc.GetValueOrDefault() == 0 && result.VolumePallNotOnShipLoc.GetValueOrDefault() == 0 && result.VolumeTransNotOnShipLoc.GetValueOrDefault() == 0 && result.VolumeOtherNotOnShipLoc.GetValueOrDefault() == 0) { result.VolumeOnShipLoc = null; result.VolumePickNotOnShipLoc = null; result.VolumePallNotOnShipLoc = null; result.VolumeTransNotOnShipLoc = null; result.VolumeOtherNotOnShipLoc = null; } }