private void OrderAliquotsAndTestOnSelectedSpecimen(YellowstonePathology.Business.Test.Model.Test test, bool orderedAsDual)
        {
            YellowstonePathology.Business.Specimen.Model.SpecimenOrderCollection selectedSpecimen = this.m_AliquotAndStainOrderView.GetSelectedSpecimen();
            foreach (YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder in selectedSpecimen)
            {
                for (int i = 0; i < this.m_Aliquots.Value; i++)
                {
                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = null;

                    switch (this.m_Aliquot.AliquotType)
                    {
                    case "Block":
                        aliquotOrder = specimenOrder.AliquotOrderCollection.AddBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                        break;

                    case "FrozenBlock":
                        aliquotOrder = specimenOrder.AliquotOrderCollection.AddFrozenBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                        break;

                    case "CellBlock":
                        aliquotOrder = specimenOrder.AliquotOrderCollection.AddCellBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                        break;

                    case "Slide":
                        aliquotOrder = specimenOrder.AliquotOrderCollection.AddSlide(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                        break;

                    case "Specimen":
                        aliquotOrder = specimenOrder.AliquotOrderCollection.AddSpecimen(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                        break;
                    }

                    specimenOrder.AliquotRequestCount = specimenOrder.AliquotOrderCollection.Count;
                    if (this.Test != null)
                    {
                        YellowstonePathology.Business.Visitor.OrderTestVisitor orderTestVisitor = new Business.Visitor.OrderTestVisitor(this.m_PanelSetOrder.ReportNo, test, test.OrderComment, null, false, aliquotOrder, false, false, this.m_AccessionOrder.TaskOrderCollection);
                        this.m_AccessionOrder.TakeATrip(orderTestVisitor);

                        if ((aliquotOrder.AliquotType == "Block" ||
                             aliquotOrder.AliquotType == "FrozenBlock" ||
                             aliquotOrder.AliquotType == "CellBlock"))
                        {
                            YellowstonePathology.Business.Visitor.AddSlideOrderVisitor addSlideOrderVisitor = new Business.Visitor.AddSlideOrderVisitor(aliquotOrder, orderTestVisitor.TestOrder);
                            this.m_AccessionOrder.TakeATrip(addSlideOrderVisitor);
                        }

                        if (test.NeedsAcknowledgement == true)
                        {
                            this.m_StainAcknowledgementTaskOrderVisitor.AddTestOrder(orderTestVisitor.TestOrder);
                        }

                        this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(this.m_AccessionOrder, this.m_PanelSetOrder);
                    }
                }
            }

            //this.Save(false);
        }
        private void ButtonAddSlideOrder_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Test.Model.TestOrderCollection testOrderCollection = this.m_AliquotAndStainOrderView.GetSelectedTestOrders();
            foreach (YellowstonePathology.Business.Test.Model.TestOrder testOrder in testOrderCollection)
            {
                YellowstonePathology.Business.Test.AliquotOrder            aliquotOrder         = this.m_AccessionOrder.SpecimenOrderCollection.GetAliquotOrder(testOrder.AliquotOrder.AliquotOrderId);
                YellowstonePathology.Business.Visitor.AddSlideOrderVisitor addSlideOrderVisitor = new Business.Visitor.AddSlideOrderVisitor(aliquotOrder, testOrder);
                this.m_AccessionOrder.TakeATrip(addSlideOrderVisitor);
            }

            this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(this.m_AccessionOrder, this.m_PanelSetOrder);
            this.NotifyPropertyChanged("AliquotAndStainOrderView");
        }
        public AliquotAndStainOrderPage(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                                        YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder  = panelSetOrder;

            this.m_EmbeddingInstructionList = new Business.Specimen.Model.EmbeddingInstructionList();

            this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(accessionOrder, panelSetOrder);

            this.m_PageHeaderText = this.m_AccessionOrder.MasterAccessionNo + ": " + this.m_AccessionOrder.PFirstName + " " + this.m_AccessionOrder.PLastName;

            this.m_StainAcknowledgementTaskOrderVisitor = new Business.Visitor.StainAcknowledgementTaskOrderVisitor(this.m_PanelSetOrder);

            InitializeComponent();

            this.DataContext = this;
            this.Loaded     += new RoutedEventHandler(StainOrderPage_Loaded);
            Unloaded        += AliquotAndStainOrderPage_Unloaded;
        }
        public AliquotAndStainOrderPage(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
			YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            this.m_AllTests = YellowstonePathology.Business.Test.Model.TestCollection.GetAllTests();
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder = panelSetOrder;

            this.m_EmbeddingInstructionList = new Business.Specimen.Model.EmbeddingInstructionList();

            this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(accessionOrder, panelSetOrder);

            this.m_PrintMate = new Business.Common.PrintMate();
            this.m_PageHeaderText = this.m_AccessionOrder.MasterAccessionNo + ": " + this.m_AccessionOrder.PFirstName + " " + this.m_AccessionOrder.PLastName;

            this.m_StainAcknowledgementTaskOrderVisitor = new Business.Visitor.StainAcknowledgementTaskOrderVisitor(this.m_PanelSetOrder);

            InitializeComponent();

            this.DataContext = this;
            this.Loaded += new RoutedEventHandler(StainOrderPage_Loaded);
            Unloaded += AliquotAndStainOrderPage_Unloaded;
        }
        private void OrderAliquotsAndTestOnSelectedSpecimen(YellowstonePathology.Business.Test.Model.Test test, bool orderedAsDual)
        {
            YellowstonePathology.Business.Specimen.Model.SpecimenOrderCollection selectedSpecimen = this.m_AliquotAndStainOrderView.GetSelectedSpecimen();
            foreach (YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder in selectedSpecimen)
            {
                for (int i = 0; i < this.m_Aliquots.Value; i++)
                {
                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = null;

                    switch (this.m_Aliquot.AliquotType)
                    {
                        case "Block":
                            aliquotOrder = specimenOrder.AliquotOrderCollection.AddBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                            break;
                        case "FrozenBlock":
                            aliquotOrder = specimenOrder.AliquotOrderCollection.AddFrozenBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                            break;
                        case "CellBlock":
                            aliquotOrder = specimenOrder.AliquotOrderCollection.AddCellBlock(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                            break;
                        case "Slide":
                            aliquotOrder = specimenOrder.AliquotOrderCollection.AddSlide(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                            break;
                        case "Specimen":
                            aliquotOrder = specimenOrder.AliquotOrderCollection.AddSpecimen(specimenOrder, this.m_Aliquot.IdentificationType, this.m_AccessionOrder.AccessionDate.Value);
                            break;
                    }

                    specimenOrder.AliquotRequestCount = specimenOrder.AliquotOrderCollection.Count;
                    if (this.Test != null)
                    {
                        YellowstonePathology.Business.Visitor.OrderTestVisitor orderTestVisitor = new Business.Visitor.OrderTestVisitor(this.m_PanelSetOrder.ReportNo, test, test.OrderComment, null, false, aliquotOrder, false, false, this.m_AccessionOrder.TaskOrderCollection);
                        this.m_AccessionOrder.TakeATrip(orderTestVisitor);

                        if ((aliquotOrder.AliquotType == "Block" ||
                            aliquotOrder.AliquotType == "FrozenBlock" ||
                            aliquotOrder.AliquotType == "CellBlock"))
                        {
                            YellowstonePathology.Business.Visitor.AddSlideOrderVisitor addSlideOrderVisitor = new Business.Visitor.AddSlideOrderVisitor(aliquotOrder, orderTestVisitor.TestOrder);
                            this.m_AccessionOrder.TakeATrip(addSlideOrderVisitor);
                        }

                        if (test.NeedsAcknowledgement == true)
                        {
                            this.m_StainAcknowledgementTaskOrderVisitor.AddTestOrder(orderTestVisitor.TestOrder);
                        }

                        this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(this.m_AccessionOrder, this.m_PanelSetOrder);
                    }
                }
            }

            //this.Save(false);
        }
        private void ButtonAddSlideOrder_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Test.Model.TestOrderCollection testOrderCollection = this.m_AliquotAndStainOrderView.GetSelectedTestOrders();
            foreach (YellowstonePathology.Business.Test.Model.TestOrder testOrder in testOrderCollection)
            {
                YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetAliquotOrder(testOrder.AliquotOrder.AliquotOrderId);
                YellowstonePathology.Business.Visitor.AddSlideOrderVisitor addSlideOrderVisitor = new Business.Visitor.AddSlideOrderVisitor(aliquotOrder, testOrder);
                this.m_AccessionOrder.TakeATrip(addSlideOrderVisitor);
            }

            this.m_AliquotAndStainOrderView = new AliquotAndStainOrderView(this.m_AccessionOrder, this.m_PanelSetOrder);
            this.NotifyPropertyChanged("AliquotAndStainOrderView");
        }