Exemplo n.º 1
0
        public PayPage(IDijnetBrowser browser, Bill bill)
        {
            this.browser = browser ?? throw new ArgumentNullException(nameof(browser));

            InitializeComponent();
            ViewModel.Bill = bill;
        }
Exemplo n.º 2
0
        public async Task <List <Card> > SelectBillAndGetCardsAsync(Bill bill)
        {
            string script = $"$('tr#r_{bill.ElementId} > td.fizet > div > div > a > span').click()";

            bool success = await NavigateHandler(async() => await InvokeAndWait(webView, script));

            if (!success)
            {
                return(null);
            }

            return(await GetCardsAsync(webView));
        }
        public async Task <List <Card> > SelectBillAndGetCardsAsync(Bill bill)
        {
            await Task.Delay(TimeSpan.FromMilliseconds(500));

            List <Card> cards;

            switch (bill.ElementId % 3)
            {
            case 1:
                cards = new List <Card>
                {
                    new Card {
                        Id = "carda", Name = "Card A"
                    },
                    new Card {
                        Id = "cardb", Name = "Card B", Default = true
                    },
                    new Card {
                        Id = "cardc", Name = "Card C"
                    }
                };
                break;

            case 2:
                cards = new List <Card>
                {
                    new Card {
                        Id = "cardx", Name = "Card X", Default = true
                    }
                };
                break;

            default:
                cards = new List <Card>(0);
                break;
            }

            return(cards);
        }