private void CancelAction(object obj) { PackingListSimulation = null; PenjualanTemporaty.Clear(); PenjualanTemporaryView.Refresh(); Destination = 0; Origin = 0; Agent = null; PortType = PortType.None; }
private void BrowseManifestCommandAction() { var view = new Contents.ManifestOutgoing.BrowseSTT(); var dlg = new ModernWindow() { Title = "Simulasi Manifest Outgoing", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, Content = view, }; if (this.PackingListSimulation == null) { this.PackingListSimulation = new Models.PackingListSimulation(this.SourceFromDatabase); } var vm = new Contents.ManifestOutgoing.BrowseSTTVM(PackingListSimulation) { CloseWindow = dlg.Close }; view.DataContext = vm; dlg.ShowDialog(); if (PackingListSimulation.Packs.Count > 0) { this.PackingList = new List <packinglist>(); PenjualanTemporaty.Clear(); foreach (var item in SourceFromDatabase.Where(O => O.IsSelected == true)) { var a = new PenjualanView { Reciver = item.Reciver, Shiper = item.Shiper, STT = item.STT }; foreach (var pack in PackingListSimulation.Packs) { foreach (var cly in pack.PackingLists) { if (item.STT == cly.STT) { PackingList.Add(new packinglist { PenjualanId = item.Id, CollyId = cly.Id, CollyNumber = cly.CollyNumber, PackNumber = pack.PackNumber, STT = item.STT, Weight = cly.Weight }); a.Details.Add(cly); a.Pcs++; a.Weight += cly.Weight; } } } if (a.Pcs > 0) { PenjualanTemporaty.Add(a); } } this.PenjualanTemporaryView.Refresh(); } else { this.PackingListSimulation = null; } }