Ejemplo n.º 1
0
 private void ValidateFacilities(Facility requirement, Facility submitted)
 {
     if (requirement != null && submitted != null)
     {
         ActivityStatus = "Validation in progress";
         var f = new cobieUKValidation.FacilityValidator();
         ValidationFacility = f.Validate(requirement, submitted);
         ActivityStatus     = "Validation completed";
         ExportValidatedFacility();
     }
     else
     {
         ActivityStatus = "Invalid facilities.";
     }
 }
Ejemplo n.º 2
0
        private void ValidateLoadedFacilities()
        {
            if (RequirementFacility == null && SubmissionFacility != null)
            {
                // I want to save the cobie here.
                var filters = new List <string>
                {
                    "COBie excel|*.xlsx",
                    "COBie binary excel|*.xls"
                };

                FileSelector.Filter = string.Join("|", filters.ToArray());
                FileSelector.Title  = "Select destination file";

                var ret = FileSelector.ShowDialog();
                if (ret != DialogResult.OK)
                {
                    return;
                }

                string msg;
                SubmissionFacility.WriteCobie(FileSelector.FileName, out msg);
                if (OpenOnExported && File.Exists(FileSelector.FileName))
                {
                    Process.Start(FileSelector.FileName);
                }
            }
            else if (RequirementFacility != null && SubmissionFacility != null)
            {
                ActivityStatus = "Validation in progress";
                var f = new cobieUKValidation.FacilityValidator();
                ValidationFacility = f.Validate(RequirementFacility, SubmissionFacility);
                ActivityStatus     = "Validation completed";
                if (ExportOnValidated)
                {
                    ExportValidatedFacility();
                }
            }
        }