private void HyperlinkReceiveMaterial_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Location fromLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location toLocation = toFacility.Locations.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, null, fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
        private void HyperlinkSendMaterial_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Location toLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location fromLocation = fromFacility.Locations.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, null, fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
        public virtual string GetLocationPerformedComment()
        {
            StringBuilder result = new StringBuilder();

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.Facility technicalComponentFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Facility professionalComponentFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();

            if (this.HasTechnicalComponent == true)
            {
                technicalComponentFacility = facilityCollection.GetByFacilityId(this.m_TechnicalComponentFacilityId);
            }

            if (this.HasProfessionalComponent == true)
            {
                professionalComponentFacility = facilityCollection.GetByFacilityId(this.m_ProfessionalComponentFacilityId);
            }

            if (technicalComponentFacility.CLIALicense.LicenseNumber == professionalComponentFacility.CLIALicense.LicenseNumber)
            {
                if (this.HasTechnicalComponent == true && this.HasProfessionalComponent == false)
                {
                    result.Append("Technical component(s) performed at ");
                    result.Append(technicalComponentFacility.CLIALicense.GetAddressString());
                }
                else if (this.HasProfessionalComponent == true && this.HasTechnicalComponent == false)
                {
                    if (result.Length != 0) result.Append(" ");
                    result.Append("Professional component(s) performed at ");
                    result.Append(professionalComponentFacility.CLIALicense.GetAddressString());
                }
                else if (this.HasProfessionalComponent == true && this.HasTechnicalComponent == true)
                {
                    result.Append("Technical and professional component(s) performed at ");
                    result.Append(professionalComponentFacility.CLIALicense.GetAddressString());
                }
            }
            else
            {
                if (this.HasTechnicalComponent == true)
                {
                    result.Append("Technical component(s) performed at ");
                    result.Append(technicalComponentFacility.CLIALicense.GetAddressString());
                }

                if (this.HasProfessionalComponent == true)
                {
                    if (result.Length != 0) result.Append(" ");
                    result.Append("Professional component(s) performed at ");
                    result.Append(professionalComponentFacility.CLIALicense.GetAddressString());
                }
            }

            return result.ToString();
        }