public void ThenTheSampleWithWrongLocationDontAddToSorting() { MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW); string command1 = $@"select TOP(1) s.TEXT_ID from test t with (nolock) inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER where t.status='I' and t.ANALYSIS='HELICOBACTER_PYLORI_ДНК' and s.TEMPLATE = 'smp_in' and s.status='I' and s.LOCATION = 'HELIX-SPB' "; var result_spb = _msBDConnectorLW.QueryExecutorScalar(command1); string command2 = $@"select TOP(1) s.TEXT_ID from test t with (nolock) inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER where t.status='I' and t.ANALYSIS='HELICOBACTER_PYLORI_ДНК' and s.TEMPLATE = 'smp_in' and s.status='I' and s.LOCATION = 'HELIX-MSK' "; var result_msk = _msBDConnectorLW.QueryExecutorScalar(command2); BDSortingPage sortingPage = new BDSortingPage(); sortingPage.IsSampleCodeFieldActive(); // Добавление образца с локацией Санкт-Петербург sortingPage.CodeInputField.SendKeys(result_spb); sortingPage.CodeInputField.SendKeys(Keys.Enter); sortingPage.IsSampleCodeFieldActive(); // Добавление образца с локацией Москва sortingPage.CodeInputField.SendKeys(result_msk); sortingPage.CodeInputField.SendKeys(Keys.Enter); sortingPage.IsSampleCodeFieldActive(); sortingPage.EndBatch(); }
public void ThenIFill_OutTheSorting_PlanchetBySamplesOfTest(int count, string testname) { MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW); string command = $@"select TOP({count}) s.TEXT_ID from test t with (nolock) inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER where t.status='I' and t.ANALYSIS='{testname}' and s.TEMPLATE = 'smp_in' and s.status='I' and s.LOCATION = 'HELIX-SPB' "; var result = _msBDConnectorLW.QueryExecutor(command); BDSortingPage sortingPage = new BDSortingPage(); sortingPage.IsSampleCodeFieldActive(); foreach (string i in result) { sortingPage.CodeInputField.SendKeys(i); sortingPage.CodeInputField.SendKeys(Keys.Enter); sortingPage.IsSampleCodeFieldActive(); } }