Пример #1
0
        private TableInfo GetTableInfoFromConstructorArguments(ArchivalTableLoadInfo toAttemptToDisplay, List <TableInfo> potentialTableInfos, ICheckNotifier checkNotifier)
        {
            checkNotifier.OnCheckPerformed(new CheckEventArgs("Table user is attempting to view updates/inserts for is called " + toAttemptToDisplay.TargetTable, CheckResult.Success));

            string runtimeName = new MicrosoftQuerySyntaxHelper().GetRuntimeName(toAttemptToDisplay.TargetTable);

            checkNotifier.OnCheckPerformed(new CheckEventArgs("The runtime name of the table is " + runtimeName, CheckResult.Success));

            checkNotifier.OnCheckPerformed(
                new CheckEventArgs(
                    "The following TableInfos were given to us to pick from " +
                    string.Join(",", potentialTableInfos), CheckResult.Success));

            var candidates = potentialTableInfos.Where(t => t.GetRuntimeName().Equals(runtimeName)).ToArray();

            if (!candidates.Any())
            {
                checkNotifier.OnCheckPerformed(new CheckEventArgs("Could not find an appropriate TableInfo from those mentioned above", CheckResult.Fail));
                return(null);
            }

            if (candidates.Count() > 1)
            {
                checkNotifier.OnCheckPerformed(new CheckEventArgs("Found multiple TableInfos (mentioned above) with the runtime name " + runtimeName + " I don't know which one you want to view", CheckResult.Fail));
                return(null);
            }

            checkNotifier.OnCheckPerformed(new CheckEventArgs("Found the correct TableInfo!", CheckResult.Success));

            return(candidates.Single());
        }
Пример #2
0
        public ViewInsertsAndUpdatesDialog(ArchivalTableLoadInfo toAttemptToDisplay, List <TableInfo> potentialTableInfos)
        {
            InitializeComponent();

            if (toAttemptToDisplay == null)
            {
                return;
            }

            _dataLoadRunID        = toAttemptToDisplay.Parent.ID;
            _toInterrogate        = GetTableInfoFromConstructorArguments(toAttemptToDisplay, potentialTableInfos, checksUI1);
            tbBatchSizeToGet.Text = "20";
            _batchSizeToGet       = 20;//technically redundant since text changed will fire but nvm
            tbTimeout.Text        = "30";
            _timeout = 30;
        }