Пример #1
0
        private async Task SearchByAmount()
        {
            ClearError();
            FindButton.Enabled = false;
            ResultsDataGridView.DataSource = null;
            ResultsDataGridView.Rows.Clear();
            ResultsDataGridView.Columns.Clear();

            StartCountLoadingEffect();

            string userSearchText = FindTextBox.Text.TrimEnd();
            var success = Decimal.TryParse(userSearchText, out decimal result);
            if (success)
            {
                List<Invoice> invoices = await service.GetInvoicesByTranAmtAsync(result, (int)LimitNumeric.Value);

                PopulateDataGridView(invoices);
            }
            else
            {
                ErrorOccured("Error - Cannot convert input into number");

                FindTextBox.Focus();
                FindTextBox.Select(0, FindTextBox.Text.Length);

                CountLabel.Text = "0";
            }

            FindButton.Enabled = true;
        }
Пример #2
0
        public void TestInvoiceRepositoryMethods()
        {
            var service        = new ARResearchService();
            var tranNoInvoices = service.GetInvoicesByTranNoAsync("0000010085").Result;
            var poNoInvoices   = service.GetInvoicesByPONumberAsync("DONALDS").Result;
            var amtInvoices    = service.GetInvoicesByTranAmtAsync(100).Result;

            Assert.IsTrue(tranNoInvoices.Count > 0);
            Assert.IsTrue(poNoInvoices.Count > 0);
            Assert.IsTrue(amtInvoices.Count > 0);
        }