public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            YellowstonePathology.UI.MainWindow mainWindow = Application.Current.MainWindow as YellowstonePathology.UI.MainWindow;
            UserControl userControl = null;

            if (((TabItem)mainWindow.TabControlLeftWorkspace.SelectedItem).Content.GetType().Name == "CytologyWorkspace")
            {
                userControl = mainWindow.CytologyWorkspace.CytologyResultsWorkspace;
            }
            else if (((TabItem)mainWindow.TabControlLeftWorkspace.SelectedItem).Content.GetType().Name == "PathologistWorkspace")
            {
                //userControl = mainWindow.PathologistWorkspace.PathologistWorkspaceUI.CytologyResultsWorkspace;
                userControl = mainWindow.PathologistWorkspace.CytologyResultsWorkspace;
            }

            if (item != null)
            {
                YellowstonePathology.Business.Test.PanelOrder panelOrder = (YellowstonePathology.Business.Test.PanelOrder)item;
                switch (panelOrder.PanelId)
                {
                case 39:
                    return(userControl.FindResource("AcidWashPanelOrderDataTemplate") as DataTemplate);

                case 38:
                    YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology cytologyPanelOrder = (YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology)panelOrder;
                    if (cytologyPanelOrder.ScreeningType.ToUpper() == "DOT REVIEW")
                    {
                        return(userControl.FindResource("CytologyDotReviewDataTemplate") as DataTemplate);
                    }
                    return(userControl.FindResource("CytologyPanelOrderDataTemplate") as DataTemplate);
                }
            }
            return(userControl.FindResource("CytologyPanelOrderDataTemplate") as DataTemplate);
        }
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item != null)
            {
                YellowstonePathology.UI.MainWindow mainWindow = Application.Current.MainWindow as YellowstonePathology.UI.MainWindow;
                YellowstonePathology.Business.PanelSet.Model.PanelSet panelSet = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll().GetPanelSet(((YellowstonePathology.Business.Test.PanelSetOrder)item).PanelSetId);
                if (panelSet.ResultDocumentSource == Business.PanelSet.Model.ResultDocumentSourceEnum.PublishedDocument ||
                    panelSet.ResultDocumentSource == Business.PanelSet.Model.ResultDocumentSourceEnum.RetiredTestDocument)
                {
                    return(mainWindow.LabWorkspace.FindResource("DataTemplatePublishedDocument") as DataTemplate);
                }
                else
                {
                    switch (panelSet.PanelSetId)
                    {
                    case 15:                             //PanelSetOrderCytology
                        return(mainWindow.LabWorkspace.FindResource("DataTemplateCytologyResult") as DataTemplate);

                    default:
                        return(mainWindow.LabWorkspace.FindResource("DataTemplateResultPath") as DataTemplate);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
 private void CytologySlideScanReceived(YellowstonePathology.Business.BarcodeScanning.CytycBarcode cytycBarcode)
 {
     this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                            new Action(
                                delegate()
     {
         YellowstonePathology.UI.MainWindow mainWindow = Application.Current.MainWindow as YellowstonePathology.UI.MainWindow;
         if (((TabItem)mainWindow.TabControlLeftWorkspace.SelectedItem).Tag.ToString() == "Cytology")
         {
             if (cytycBarcode.IsValidated == true)
             {
                 if (this.m_CytologyUI.SetAccessionOrderByReportNo(cytycBarcode.ReportNo))
                 {
                     this.m_CytologyResultsWorkspace.ReportNo = cytycBarcode.ReportNo;
                 }
             }
             else
             {
                 System.Windows.MessageBox.Show("The scanner did not read the label correctly.", "Scan not successful.", MessageBoxButton.OK, MessageBoxImage.Exclamation);
             }
         }
     }));
 }