Esempio n. 1
0
 private void ButtonRemoveSurgicalDiagnosis_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewSpecimenSurgicalDiagnosis.SelectedItem != null)
     {
         YellowstonePathology.Business.View.SpecimenSurgicalDiagnosisView specimenSurgicalDiagnosisView = (YellowstonePathology.Business.View.SpecimenSurgicalDiagnosisView) this.ListViewSpecimenSurgicalDiagnosis.SelectedItem;
         if (specimenSurgicalDiagnosisView.SurgicalDiagnosisIsOrdered == true)
         {
             if (string.IsNullOrEmpty(specimenSurgicalDiagnosisView.SurgicalSpecimen.Diagnosis) == true)
             {
                 YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder panelSetOrderSurgical = this.m_AccessionOrder.PanelSetOrderCollection.GetSurgical();
                 panelSetOrderSurgical.SurgicalSpecimenCollection.Remove(specimenSurgicalDiagnosisView.SurgicalSpecimen);
                 this.m_SpecimenSurgicalDiagnosisViewCollection.Refresh(this.m_AccessionOrder);
                 this.NotifyPropertyChanged("SpecimenSurgicalDiagnosisViewCollection");
                 MessageBox.Show("The surgical diagnosis has been removed.");
             }
             else
             {
                 MessageBox.Show("The diagnosis cannot be removed because it has text in it.");
             }
         }
         else
         {
             MessageBox.Show("A surgical diagnosis is not currently ordered.");
         }
     }
 }
Esempio n. 2
0
        private void ButtonAddSurgicalDiagnosis_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewSpecimenSurgicalDiagnosis.SelectedItem != null)
            {
                YellowstonePathology.Business.View.SpecimenSurgicalDiagnosisView specimenSurgicalDiagnosisView = (YellowstonePathology.Business.View.SpecimenSurgicalDiagnosisView) this.ListViewSpecimenSurgicalDiagnosis.SelectedItem;
                YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder    panelSetOrderSurgical         = this.m_AccessionOrder.PanelSetOrderCollection.GetSurgical();

                if (panelSetOrderSurgical.SurgicalSpecimenCollection.SpecimenOrderExists(specimenSurgicalDiagnosisView.SpecimenOrder.SpecimenOrderId) == false)
                {
                    YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen = panelSetOrderSurgical.SurgicalSpecimenCollection.GetNextItem(panelSetOrderSurgical.ReportNo);
                    surgicalSpecimen.SpecimenOrderId = specimenSurgicalDiagnosisView.SpecimenOrder.SpecimenOrderId;
                    surgicalSpecimen.DiagnosisId     = specimenSurgicalDiagnosisView.SpecimenOrder.SpecimenNumber;
                    panelSetOrderSurgical.SurgicalSpecimenCollection.Add(surgicalSpecimen);
                }

                this.m_SpecimenSurgicalDiagnosisViewCollection.Refresh(this.m_AccessionOrder);
                this.NotifyPropertyChanged("SpecimenSurgicalDiagnosisViewCollection");
                MessageBox.Show("The surgical diagnosis has been added.");
            }
        }
        private void HyperLinkDeleteSpecimen_Click(object sender, RoutedEventArgs e)
        {
            Hyperlink hyperlink = (Hyperlink)e.Source;

            YellowstonePathology.Business.Specimen.Model.SpecimenOrder       specimenOrder = (YellowstonePathology.Business.Specimen.Model.SpecimenOrder)hyperlink.Tag;
            YellowstonePathology.Business.View.SpecimenSurgicalDiagnosisView specimenSurgicalDiagnosisView = Business.View.SpecimenSurgicalDiagnosisView.Parse(specimenOrder, this.m_AccessionOrder);

            if (specimenSurgicalDiagnosisView.SurgicalDiagnosisIsOrdered == false)
            {
                if (specimenOrder.AliquotOrderCollection.Count == 0)
                {
                    this.m_AccessionOrder.SpecimenOrderCollection.Remove(specimenOrder);
                }
                else
                {
                    MessageBox.Show("Cannot delete the Specimen because aliquots exist.");
                }
            }
            else
            {
                MessageBox.Show("Cannot delete the specimen because a Surgical Diagnosis for this specimen exists.");
            }
        }