public void OnNavigatedTo(NavigationContext navigationContext) { AuthenticatedUser = (!string.IsNullOrEmpty((string)navigationContext.Parameters["AuthenticatedUser"]) ? (string)navigationContext.Parameters["AuthenticatedUser"] : string.Empty); var grid = GetRequestedGRID(navigationContext); if (grid.HasValue) { this.GoodReceive = GRServices.GetGR(grid.Value); if (GoodReceive.QtyReceived == null) { GoodReceive.Ok = false; } else { if (GoodReceive.QtyReceived == GoodReceive.Quantity) { GoodReceive.Ok = true; } else if (GoodReceive.QtyReceived < GoodReceive.Quantity) { GoodReceive.Ok = null; } } this.EventAggregator.GetEvent <GRUserSelectedEvent>().Publish(grid.Value); } this.navigationJournal = navigationContext.NavigationService.Journal; }
private void ConsumeItemMessage(GRItemMessage msg) { if (msg == null) { return; } if (msg.HasValue) { ProgressValue = msg.PercentageValue; if (msg.State == "Completed") { #region refresh grid foreach (var obj in grCollection) { var gr = grServices.GetGR(obj.ID); obj.Ok = gr.Ok.GetValueOrDefault(); obj.Quantity = gr.Quantity; obj.QtyReceived = gr.QtyReceived; if (obj.QtyReceived == null) { obj.Ok = false; } else { if (obj.QtyReceived == obj.Quantity) { obj.Ok = true; } else if (obj.QtyReceived < obj.Quantity) { obj.Ok = null; } } obj.Ok2 = obj.Ok; obj.Quantity2 = obj.Quantity; obj.QtyReceived2 = obj.QtyReceived; if (OkFilter.All(x => x.Item.BoolOk != gr.Ok)) { OkFilter.Add(new CheckedListItem <OkCategory> { IsChecked = true, Item = new OkCategory { BoolOk = gr.Ok, TextOk = gr.Ok == null ? " - Partial" : (gr.Ok.ToString() == "False") ? " - NOT OK" : " - OK" } }); } } CollectionViewSource.GetDefaultView(ListBoxOk).Refresh(); #endregion refresh grid StopTimer(); ExecuteTimer(); } } }