private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression grossExamBindingExpression = this.CheckBoxGrossExam.GetBindingExpression(CheckBox.IsCheckedProperty);

            YellowstonePathology.Business.Validation.ValidationResult grossExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsGrossExamDataTypeValid(this.CheckBoxGrossExam.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(grossExamDataTypeValidationResult, grossExamBindingExpression, clientOrderDetailClone.IsGrossExamDomainValid));

            BindingExpression cytogeneticsBindingExpression = this.CheckBoxCytogenetics.GetBindingExpression(CheckBox.IsCheckedProperty);

            YellowstonePathology.Business.Validation.ValidationResult cytogeneticsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsCytogeneticsDataTypeValid(this.CheckBoxCytogenetics.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(cytogeneticsDataTypeValidationResult, cytogeneticsBindingExpression, clientOrderDetailClone.IsCytogeneticsDomainValid));

            BindingExpression completeExamBindingExpression = this.CheckBoxCompleteExam.GetBindingExpression(CheckBox.IsCheckedProperty);

            YellowstonePathology.Business.Validation.ValidationResult completeExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsCompleteExamDataTypeValid(this.CheckBoxCompleteExam.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(completeExamDataTypeValidationResult, completeExamBindingExpression, clientOrderDetailClone.IsCompleteExamDomainValid));

            BindingExpression otherExamBindingExpression = this.TextBoxOtherExam.GetBindingExpression(TextBox.TextProperty);

            YellowstonePathology.Business.Validation.ValidationResult otherExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsOtherExamDataTypeValid(this.TextBoxOtherExam.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(otherExamDataTypeValidationResult, otherExamBindingExpression, clientOrderDetailClone.IsOtherExamDomainValid));

            return(dataValidator);
        }
 private void ButtonNext_Click(object sender, RoutedEventArgs e)
 {
     YellowstonePathology.Business.Validation.DataValidator dataValidator = this.CreateDataValidator(this.m_PlacentaClientOrderDetail);
     dataValidator.UpdateValidBindingSources();
     YellowstonePathology.Business.Validation.ValidationResult validationResult = dataValidator.ValidateDataTypes();
     if (validationResult.IsValid == false)
     {
         MessageBox.Show("A Pathology Test Order must be selected.");
     }
     else
     {
         validationResult = dataValidator.ValidateDomain();
         if (validationResult.IsValid == false)
         {
             MessageBox.Show("A Pathology Test Order must be selected.");
         }
         else
         {
             if (this.m_PlacentaClientOrderDetail.DateSubmitted.HasValue == false)
             {
                 this.m_PlacentaClientOrderDetail.DateSubmitted = DateTime.Now;
                 this.m_PlacentaClientOrderDetail.SubmittedBy   = YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.DisplayName;
             }
             YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs args = new YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs(YellowstonePathology.YpiConnect.Client.PageNavigationDirectionEnum.Next, null);
             Return(this, args);
         }
     }
 }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression containerIdBindingExpression = this.TextBlockContainerId.GetBindingExpression(TextBox.TextProperty);

            //YellowstonePathology.Shared.ValidationResult containerIdDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsContainerIdDataTypeValid(this.TextBlockContainerId.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(containerIdDataTypeValidationResult, containerIdBindingExpression, clientOrderDetailClone.IsContainerIdDomainValid));

            return(dataValidator);
        }
Exemple #4
0
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression collectionDateBindingExpression = this.TextBoxCollectionDate.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult collectionDateDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsCollectionDateDataTypeValid(this.TextBoxCollectionDate.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(collectionDateDataTypeValidationResult, collectionDateBindingExpression, clientOrderDetailClone.IsCollectionDateDomainValid));

            return(dataValidator);
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression specialInstructionsBindingExpression = this.ComboBoxSpecialInstructions.GetBindingExpression(ComboBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult specialInstructionsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsSpecialInstructionsDataTypeValid(this.ComboBoxSpecialInstructions.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(specialInstructionsDataTypeValidationResult, specialInstructionsBindingExpression, clientOrderDetailClone.IsSpecialInstructionsDomainValid));

            return(dataValidator);
        }
Exemple #6
0
 private void ButtonBack_Click(object sender, RoutedEventArgs e)
 {
     YellowstonePathology.Business.Validation.DataValidator dataValidator = this.CreateDataValidator(this.m_ClientOrderDetailClone);
     dataValidator.UpdateValidBindingSources();
     YellowstonePathology.Business.Validation.ValidationResult validationResult = dataValidator.ValidateDataTypes();
     if (validationResult.IsValid == false)
     {
         MessageBox.Show(validationResult.Message);
     }
     else
     {
         YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs args = new YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs(YellowstonePathology.YpiConnect.Client.PageNavigationDirectionEnum.Back, null);
         Return(this, args);
     }
 }
        private void SetContainerIdValidity(bool showMessage)
        {
            bool result = true;

            if (this.ContainerExists() == true)
            {
                result = false;
                if (showMessage == true)
                {
                    MessageBox.Show("The container ID is a duplicate.");
                }
                this.TextBlockContainerId.Focus();
                this.TextBlockContainerId.Select(0, this.TextBlockContainerId.Text.Length);
            }
            else
            {
                YellowstonePathology.Business.Validation.DataValidator dataValidator = this.CreateDataValidator(this.m_ClientOrderDetailClone);
                dataValidator.UpdateValidBindingSources();
                YellowstonePathology.Business.Validation.ValidationResult validationResult = dataValidator.ValidateDataTypes();
                if (validationResult.IsValid == false)
                {
                    result = false;
                    if (showMessage == true)
                    {
                        MessageBox.Show(validationResult.Message);
                    }
                    this.TextBlockContainerId.Focus();
                    this.TextBlockContainerId.Select(0, this.TextBlockContainerId.Text.Length);
                }
                else
                {
                    validationResult = dataValidator.ValidateDomain();
                    if (validationResult.IsValid == false)
                    {
                        result = false;
                        if (showMessage == true)
                        {
                            MessageBox.Show(validationResult.Message);
                        }
                        this.TextBlockContainerId.Focus();
                        this.TextBlockContainerId.Select(0, this.TextBlockContainerId.Text.Length);
                    }
                }
            }
            this.ContainerIdValid = result;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrder clientOrder)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression reportCopyToBindingExpression = this.TextBoxReportCopyTo.GetBindingExpression(TextBox.TextProperty);

            YellowstonePathology.Business.Validation.ValidationResult reportCopyToDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrder.IsReportCopyToDataTypeValid(this.TextBoxReportCopyTo.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(reportCopyToDataTypeValidationResult, reportCopyToBindingExpression, clientOrder.IsReportCopyToDomainValid));

            BindingExpression clinicalHistoryBindingExpression = this.TextBoxClinicalHistory.GetBindingExpression(TextBox.TextProperty);

            YellowstonePathology.Business.Validation.ValidationResult clinicalHistoryDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrder.IsClinicalHistoryDataTypeValid(this.TextBoxClinicalHistory.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(clinicalHistoryDataTypeValidationResult, clinicalHistoryBindingExpression, clientOrder.IsClinicalHistoryDomainValid));

            BindingExpression preOpDiagnosisBindingExpression = this.TextBoxPreOpDiagnosis.GetBindingExpression(TextBox.TextProperty);

            YellowstonePathology.Business.Validation.ValidationResult preOpDiagnosisDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrder.IsPreOpDiagnosisDataTypeValid(this.TextBoxPreOpDiagnosis.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(preOpDiagnosisDataTypeValidationResult, preOpDiagnosisBindingExpression, clientOrder.IsPreOpDiagnosisDomainValid));

            return(dataValidator);
        }
Exemple #9
0
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression specialInstructionsBindingExpression = this.ComboBoxSpecialInstructions.GetBindingExpression(ComboBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult specialInstructionsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsSpecialInstructionsDataTypeValid(this.ComboBoxSpecialInstructions.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(specialInstructionsDataTypeValidationResult, specialInstructionsBindingExpression, clientOrderDetailClone.IsSpecialInstructionsDomainValid));

            //BindingExpression collectionDateBindingExpression = this.TextBoxCollectionDate.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult collectionDateDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsCollectionDateDataTypeValid(this.TextBoxCollectionDate.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(collectionDateDataTypeValidationResult, collectionDateBindingExpression, clientOrderDetailClone.IsCollectionDateDomainValid));

            if (this.m_ClientOrderDetailClone.OrderTypeCode == "SRGCL")
            {
                BindingExpression immediateExamBindingExpression = this.ListBoxOrderType.GetBindingExpression(ListBox.SelectedValueProperty);
                bool?valueToValidate = null;
                if (this.ListBoxOrderType.SelectedItem != null)
                {
                    SurgicalOrderType surgicalOrderType = (SurgicalOrderType)this.ListBoxOrderType.SelectedItem;
                    valueToValidate = surgicalOrderType.Value;
                }
                Business.Validation.ValidationResult immediateExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsOrderImmediateExamDataTypeValid(valueToValidate);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(immediateExamDataTypeValidationResult, immediateExamBindingExpression, clientOrderDetailClone.IsOrderImmediateExamDomainValid));

                BindingExpression frozenSectionBindingExpression = this.CheckBoxOrderFrozenSection.GetBindingExpression(CheckBox.IsCheckedProperty);
                Business.Validation.ValidationResult frozenSectionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsOrderFrozenSectionDataTypeValid(this.CheckBoxOrderFrozenSection.IsChecked);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(frozenSectionDataTypeValidationResult, frozenSectionBindingExpression, clientOrderDetailClone.IsOrderFrozenSectionDomainValid));

                BindingExpression callbackNumberBindingExpression = this.TextBoxCallbackNumber.GetBindingExpression(TextBox.TextProperty);
                Business.Validation.ValidationResult callbackNumberDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsCallbackNumberDataTypeValid(this.TextBoxCallbackNumber.Text);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(callbackNumberDataTypeValidationResult, callbackNumberBindingExpression, clientOrderDetailClone.IsCallbackNumberDomainValid));
            }
            return(dataValidator);
        }
        private void ButtonBack_Click(object sender, RoutedEventArgs e)
        {
            if (this.ContainerExists() == true)
            {
                this.TextBlockContainerId.TextChanged -= this.TextBlockContainerId_TextChanged;
                this.TextBlockContainerId.Text         = this.m_ClientOrderDetailClone.ContainerId;
                this.TextBlockContainerId.TextChanged += this.TextBlockContainerId_TextChanged;
            }

            YellowstonePathology.Business.Validation.DataValidator dataValidator = this.CreateDataValidator(this.m_ClientOrderDetailClone);
            dataValidator.UpdateValidBindingSources();
            YellowstonePathology.Business.Validation.ValidationResult validationResult = dataValidator.ValidateDataTypes();
            if (validationResult.IsValid == false)
            {
                MessageBox.Show(validationResult.Message);
                this.TextBlockContainerId.Focus();
                this.TextBlockContainerId.Select(0, this.TextBlockContainerId.Text.Length);
            }
            else
            {
                YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs args = new YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs(YellowstonePathology.YpiConnect.Client.PageNavigationDirectionEnum.Back, null);
                Return(this, args);
            }
        }
Exemple #11
0
 public void UpdateBindingSources()
 {
     YellowstonePathology.Business.Validation.DataValidator dataValidator = this.CreateDataValidator(this.m_ClientOrderDetailClone);
     dataValidator.UpdateValidBindingSources();
 }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression specialInstructionsBindingExpression = this.ComboBoxSpecialInstructions.GetBindingExpression(ComboBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult specialInstructionsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsSpecialInstructionsDataTypeValid(this.ComboBoxSpecialInstructions.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(specialInstructionsDataTypeValidationResult, specialInstructionsBindingExpression, clientOrderDetailClone.IsSpecialInstructionsDomainValid));

            return dataValidator;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression grossExamBindingExpression = this.CheckBoxGrossExam.GetBindingExpression(CheckBox.IsCheckedProperty);
            YellowstonePathology.Business.Validation.ValidationResult grossExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsGrossExamDataTypeValid(this.CheckBoxGrossExam.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(grossExamDataTypeValidationResult, grossExamBindingExpression, clientOrderDetailClone.IsGrossExamDomainValid));

            BindingExpression cytogeneticsBindingExpression = this.CheckBoxCytogenetics.GetBindingExpression(CheckBox.IsCheckedProperty);
            YellowstonePathology.Business.Validation.ValidationResult cytogeneticsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsCytogeneticsDataTypeValid(this.CheckBoxCytogenetics.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(cytogeneticsDataTypeValidationResult, cytogeneticsBindingExpression, clientOrderDetailClone.IsCytogeneticsDomainValid));

            BindingExpression completeExamBindingExpression = this.CheckBoxCompleteExam.GetBindingExpression(CheckBox.IsCheckedProperty);
            YellowstonePathology.Business.Validation.ValidationResult completeExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsCompleteExamDataTypeValid(this.CheckBoxCompleteExam.IsChecked.Value);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(completeExamDataTypeValidationResult, completeExamBindingExpression, clientOrderDetailClone.IsCompleteExamDomainValid));

            BindingExpression otherExamBindingExpression = this.TextBoxOtherExam.GetBindingExpression(TextBox.TextProperty);
            YellowstonePathology.Business.Validation.ValidationResult otherExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.PlacentaClientOrderDetail.IsOtherExamDataTypeValid(this.TextBoxOtherExam.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(otherExamDataTypeValidationResult, otherExamBindingExpression, clientOrderDetailClone.IsOtherExamDomainValid));

            return dataValidator;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression specialInstructionsBindingExpression = this.ComboBoxSpecialInstructions.GetBindingExpression(ComboBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult specialInstructionsDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsSpecialInstructionsDataTypeValid(this.ComboBoxSpecialInstructions.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(specialInstructionsDataTypeValidationResult, specialInstructionsBindingExpression, clientOrderDetailClone.IsSpecialInstructionsDomainValid));

            //BindingExpression collectionDateBindingExpression = this.TextBoxCollectionDate.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult collectionDateDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsCollectionDateDataTypeValid(this.TextBoxCollectionDate.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(collectionDateDataTypeValidationResult, collectionDateBindingExpression, clientOrderDetailClone.IsCollectionDateDomainValid));

            if(this.m_ClientOrderDetailClone.OrderTypeCode == "SRGCL")
            {
                BindingExpression immediateExamBindingExpression = this.ListBoxOrderType.GetBindingExpression(ListBox.SelectedValueProperty);
                bool? valueToValidate = null;
                if (this.ListBoxOrderType.SelectedItem != null)
                {
                    SurgicalOrderType surgicalOrderType = (SurgicalOrderType)this.ListBoxOrderType.SelectedItem;
                    valueToValidate = surgicalOrderType.Value;
                }
                Business.Validation.ValidationResult immediateExamDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsOrderImmediateExamDataTypeValid(valueToValidate);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(immediateExamDataTypeValidationResult, immediateExamBindingExpression, clientOrderDetailClone.IsOrderImmediateExamDomainValid));

                BindingExpression frozenSectionBindingExpression = this.CheckBoxOrderFrozenSection.GetBindingExpression(CheckBox.IsCheckedProperty);
                Business.Validation.ValidationResult frozenSectionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsOrderFrozenSectionDataTypeValid(this.CheckBoxOrderFrozenSection.IsChecked);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(frozenSectionDataTypeValidationResult, frozenSectionBindingExpression, clientOrderDetailClone.IsOrderFrozenSectionDomainValid));

                BindingExpression callbackNumberBindingExpression = this.TextBoxCallbackNumber.GetBindingExpression(TextBox.TextProperty);
                Business.Validation.ValidationResult callbackNumberDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrderDetail.IsCallbackNumberDataTypeValid(this.TextBoxCallbackNumber.Text);
                dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(callbackNumberDataTypeValidationResult, callbackNumberBindingExpression, clientOrderDetailClone.IsCallbackNumberDomainValid));
            }
            return dataValidator;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression containerIdBindingExpression = this.TextBlockContainerId.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult containerIdDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsContainerIdDataTypeValid(this.TextBlockContainerId.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(containerIdDataTypeValidationResult, containerIdBindingExpression, clientOrderDetailClone.IsContainerIdDomainValid));

            return dataValidator;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetailClone)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            //BindingExpression descriptionBindingExpression = this.TextBoxSpecimenDescription.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult descriptionDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsDescriptionDataTypeValid(this.TextBoxSpecimenDescription.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(descriptionDataTypeValidationResult, descriptionBindingExpression, clientOrderDetailClone.IsDescriptionDomainValid));

            //BindingExpression collectionDateBindingExpression = this.TextBoxCollectionDate.GetBindingExpression(TextBox.TextProperty);
            //YellowstonePathology.Shared.ValidationResult collectionDateDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail.IsCollectionDateDataTypeValid(this.TextBoxCollectionDate.Text);
            //dataValidator.Add(new YellowstonePathology.Shared.DataValidatorItem(collectionDateDataTypeValidationResult, collectionDateBindingExpression, clientOrderDetailClone.IsCollectionDateDomainValid));

            return dataValidator;
        }
        private YellowstonePathology.Business.Validation.DataValidator CreateDataValidator(YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrder clientOrder)
        {
            YellowstonePathology.Business.Validation.DataValidator dataValidator = new YellowstonePathology.Business.Validation.DataValidator();

            BindingExpression reportCopyToBindingExpression = this.TextBoxReportCopyTo.GetBindingExpression(TextBox.TextProperty);
            YellowstonePathology.Business.Validation.ValidationResult reportCopyToDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrder.IsReportCopyToDataTypeValid(this.TextBoxReportCopyTo.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(reportCopyToDataTypeValidationResult, reportCopyToBindingExpression, clientOrder.IsReportCopyToDomainValid));

            BindingExpression clinicalHistoryBindingExpression = this.TextBoxClinicalHistory.GetBindingExpression(TextBox.TextProperty);
            YellowstonePathology.Business.Validation.ValidationResult clinicalHistoryDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.ClientOrder.IsClinicalHistoryDataTypeValid(this.TextBoxClinicalHistory.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(clinicalHistoryDataTypeValidationResult, clinicalHistoryBindingExpression, clientOrder.IsClinicalHistoryDomainValid));

            BindingExpression preOpDiagnosisBindingExpression = this.TextBoxPreOpDiagnosis.GetBindingExpression(TextBox.TextProperty);
            YellowstonePathology.Business.Validation.ValidationResult preOpDiagnosisDataTypeValidationResult = YellowstonePathology.Business.ClientOrder.Model.SurgicalClientOrder.IsPreOpDiagnosisDataTypeValid(this.TextBoxPreOpDiagnosis.Text);
            dataValidator.Add(new YellowstonePathology.Business.Validation.DataValidatorItem(preOpDiagnosisDataTypeValidationResult, preOpDiagnosisBindingExpression, clientOrder.IsPreOpDiagnosisDomainValid));

            return dataValidator;
        }