private void ButtonUpdateScans_Click(object sender, RoutedEventArgs e) { if (this.m_MaterialTrackingBatch.ToFacilityId != null) { this.m_MaterialTrackingLogViewCollection.Clear(); bool anItemCouldNotBeFound = false; foreach (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog in this.m_MaterialTrackingBatch.MaterialTrackingLogCollection) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingScannedItemView materialTrackingScannedItemView = null; switch (materialTrackingLog.MaterialType) { case "PSLD": case "NGYNSLD": case "FNASLD": case "Aliquot": case "Block": case "FrozenBlock": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewByAliquotOrderId(materialTrackingLog.MaterialId); break; case "Slide": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewBySlideOrderId(materialTrackingLog.MaterialId); break; case "Container": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewByContainerId(materialTrackingLog.MaterialId); break; } YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new Business.MaterialTracking.Model.MaterialTrackingLogView(); if (materialTrackingScannedItemView != null) { materialTrackingLogView.FromScannedItemView(materialTrackingScannedItemView, materialTrackingLog); materialTrackingLog.Update(materialTrackingScannedItemView); } else { anItemCouldNotBeFound = true; materialTrackingLogView.PFirstName = "Not Found"; materialTrackingLogView.PLastName = "Not Found"; } this.m_MaterialTrackingLogViewCollection.Add(materialTrackingLogView); } if (anItemCouldNotBeFound == true) { MessageBox.Show("One or more scanned items could not be found in the database."); } this.UpdateLocation(); } else { MessageBox.Show("A To Facility is required."); } }
private void HistologySlideScanReceived(YellowstonePathology.Business.BarcodeScanning.Barcode barcode) { this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { if (this.m_MaterialTrackingLogViewCollection.MaterialIdExists(barcode.ID) == false) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = this.AddMaterialTrackingLogScan(barcode.ID, "Slide", this.m_MaterialTrackingBatch.MaterialTrackingBatchId); YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new Business.MaterialTracking.Model.MaterialTrackingLogView(); materialTrackingLogView.FromScannedItemView(materialTrackingLog); this.m_MaterialTrackingLogViewCollection.Add(materialTrackingLogView); this.NotifyPropertyChanged("MaterialCount"); } else { this.SelectMaterialTrackingLogView(barcode.ID); } })); }
private void HistologySlideScanReceived(YellowstonePathology.Business.BarcodeScanning.Barcode barcode) { this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { if (this.m_MaterialTrackingLogViewCollection.MaterialIdExists(barcode.ID) == false) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = this.AddMaterialTrackingLogScan(barcode.ID, "Slide", this.m_MaterialTrackingBatch.MaterialTrackingBatchId); YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new Business.MaterialTracking.Model.MaterialTrackingLogView(); materialTrackingLogView.FromScannedItemView(materialTrackingLog); this.m_MaterialTrackingLogViewCollection.Add(materialTrackingLogView); this.NotifyPropertyChanged("MaterialCount"); } else { this.SelectMaterialTrackingLogView(barcode.ID); } })); }
private void ButtonPrintUpdateScans_Click(object sender, RoutedEventArgs e) { this.m_MaterialTrackingLogViewCollection.Clear(); bool anItemCouldNotBeFound = false; foreach (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog in this.m_MaterialTrackingLogCollection) { YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingScannedItemView materialTrackingScannedItemView = null; switch (materialTrackingLog.MaterialType) { case "PSLD": case "NGYNSLD": case "FNASLD": case "Aliquot": case "Block": case "FrozenBlock": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewByAliquotOrderId(materialTrackingLog.MaterialId); break; case "Slide": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewBySlideOrderId(materialTrackingLog.MaterialId); break; case "Container": materialTrackingScannedItemView = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetMaterialTrackingScannedItemViewByContainerId(materialTrackingLog.MaterialId); break; } YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogView materialTrackingLogView = new Business.MaterialTracking.Model.MaterialTrackingLogView(); if (materialTrackingScannedItemView != null) { materialTrackingLogView.FromScannedItemView(materialTrackingScannedItemView, materialTrackingLog); materialTrackingLog.Update(materialTrackingScannedItemView); } else { anItemCouldNotBeFound = true; materialTrackingLogView.PFirstName = "Not Found"; materialTrackingLogView.PLastName = "Not Found"; } this.m_MaterialTrackingLogViewCollection.Add(materialTrackingLogView); } if (anItemCouldNotBeFound == true) { MessageBox.Show("One or more scanned items could not be found in the database."); } }