Esempio n. 1
0
        public async Task <ApiResponse <List <OpenAccountPostingLine> > > GetCreateReceipt(int pageIndex, int pageSize, string company, string party, DateTime documentDate, decimal documentExchangeRate, string currency, string documentType, DateTime?dueDateFrom = null, DateTime?dueDateUntil = null, string paymentMethod = null, decimal?total = null, string sourceDoc = null)
        {
            var url = $"{EndPoint}/{pageIndex}/{pageSize}?company={company}&party={party}&documentDate={documentDate:yyyy-MM-dd}&documentExchangeRate={documentExchangeRate}&currency={currency}&documentType={documentType}";

            if (dueDateFrom.HasValue)
            {
                url = $"{url}&{dueDateFrom:yyyy-MM-dd}";
            }
            if (dueDateUntil.HasValue)
            {
                url = $"{url}&{dueDateUntil:yyyy-MM-dd}";
            }
            if (!string.IsNullOrEmpty(paymentMethod))
            {
                url = $"{url}&{paymentMethod}";
            }
            if (total.HasValue)
            {
                url = $"{url}&{total}";
            }
            if (!string.IsNullOrEmpty(sourceDoc))
            {
                url = $"{url}&{sourceDoc}";
            }

            var apiCall = new ApiCall <List <OpenAccountPostingLine> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 2
0
        /// <summary>
        /// Searches the asynchronous.
        /// </summary>
        public async void SearchAsync()
        {
            cts           = new CancellationTokenSource();
            Visible       = false;
            RevertVisible = true;


            try
            {
                if (Text == "" || Text == null)
                {
                    Animals = await ApiCall.Get <ObservableCollection <Animal> >($"Animals");
                }
                else
                {
                    Animals = await ApiCall.Get <ObservableCollection <Animal> >($"Animals/Search/{Text}");
                }
            }

            catch (OperationCanceledException ex)
            {
                await Task.Run(() => ReportError.ErrorAsync(ex.Message));
            }

            finally
            {
                Visible       = true;
                RevertVisible = false;
            }
        }
Esempio n. 3
0
        public async Task <ApiResponse <BaseCustomerPartyResource> > GetCustomerPartyWithPartyByIdentifier(string id)
        {
            var url = $"{EndPoint}/{id}";

            var apiCall = new ApiCall <BaseCustomerPartyResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 4
0
        public async Task <ApiResponse <ItemResource> > GetItemByKey(string itemKey)
        {
            var url = $"{EndPoint}/{itemKey}";

            var apiCall = new ApiCall <ItemResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 5
0
        public async Task <ApiResponse <byte[]> > GetPrintReceipt(string id)
        {
            var url = $"{EndPoint}/{id}/print";

            var apiCall = new ApiCall <byte[]>(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 6
0
        public async Task <ApiResponse <List <BasePurchasesItemResource> > > GetPurchasesItemWithItem(int page, int pageSize)
        {
            var url = $"{EndPoint}?page={page}&pageSize={pageSize}";

            var apiCall = new ApiCall <List <BasePurchasesItemResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 7
0
        public async Task <ApiResponse <BasePurchasesItemResource> > GetPurchasesItemWithItemByIdentifier(string id)
        {
            var url = $"{EndPoint}/{id}";

            var apiCall = new ApiCall <BasePurchasesItemResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 8
0
        public async Task <ApiResponse <SupplierDataResource> > GetSupplierByCompanyTaxId(string companyTaxId)
        {
            var url = $"{EndPoint}/getSupplierByCompanyTaxId/{companyTaxId}?companyTaxId={companyTaxId}";

            var apiCall = new ApiCall <SupplierDataResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 9
0
        public async Task <ApiResponse <List <PurchasesItemResource> > > GetPurchasesItems()
        {
            var url = $"{EndPoint}/extension";

            var apiCall = new ApiCall <List <PurchasesItemResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 10
0
        public async Task <ApiResponse <SupplierPartyResource> > GetSupplierPartyByIdentifier(string id)
        {
            var url = $"{EndPoint}/{id}/extension";

            var apiCall = new ApiCall <SupplierPartyResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 11
0
        public async Task <ApiResponse <BaseSupplierPartyResource> > GetSupplierPartyWithPartyByKey(string partyKey)
        {
            var url = $"{EndPoint}/{partyKey}";

            var apiCall = new ApiCall <BaseSupplierPartyResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 12
0
        public async Task <ApiResponse <SupplierPartyResource> > GetSupplierParties(int page, int pageSize)
        {
            var url = $"{EndPoint}/extension?page={page}&pageSize={pageSize}";

            var apiCall = new ApiCall <SupplierPartyResource>(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 13
0
        public async Task <ApiResponse <List <BaseSalesItemResource> > > GetSalesItemWithItem()
        {
            var url = $"{EndPoint}";

            var apiCall = new ApiCall <List <BaseSalesItemResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 14
0
        public async Task <ApiResponse <List <SalesItemResource> > > GetSalesItems(int page, int pageSize)
        {
            var url = $"{EndPoint}/extension?page={page}&pageSize={pageSize}";

            var apiCall = new ApiCall <List <SalesItemResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 15
0
        public async Task <ApiResponse <byte[]> > GetItemImage(string id)
        {
            var url = $"{EndPoint}/{id}/image";

            var apiCall = new ApiCall <byte[]>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 16
0
        public async Task <ApiResponse <byte[]> > GetPrintItemByKey(string itemKey, string template = null)
        {
            var url = $"{EndPoint}/{itemKey}/print{(!string.IsNullOrEmpty(template) ? $"?template={template}" : "")}";

            var apiCall = new ApiCall <byte[]>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 17
0
        public async Task <ApiResponse <CustomerPartyResource> > GetCustomerPartyByKey(string partyKey)
        {
            var url = $"{EndPoint}/{partyKey}/extension";

            var apiCall = new ApiCall <CustomerPartyResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 18
0
        public async Task <ApiResponse <PartyResource> > GetPartyByKey(string partyKey)
        {
            var url = $"{EndPoint}/{partyKey}";

            var apiCall = new ApiCall <PartyResource>(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 19
0
        public async Task <ApiResponse <PartyDataResource> > GetPartyByCompanyTaxId(string companyTaxId)
        {
            var url = $"{EndPoint}/getPartyByCompanyTaxId?companyTaxId={companyTaxId}";

            var apiCall = new ApiCall <PartyDataResource>(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 20
0
        public async Task <ApiResponse <List <PartyResource> > > GetParties()
        {
            var url = $"{EndPoint}";

            var apiCall = new ApiCall <List <PartyResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 21
0
        public async Task <ApiResponse <List <PartyResource> > > GetParties(int page, int pageSize)
        {
            var url = $"{EndPoint}?page={page}&pageSize={pageSize}";

            var apiCall = new ApiCall <List <PartyResource> >(Logger);

            return(await apiCall.Get(url));
        }
Esempio n. 22
0
        public async Task <ApiResponse <InvoiceResource> > GetInvoiceByKey(string companyKey, string documentType, string serie, int seriesNumber)
        {
            var url = $"{EndPoint}/{companyKey}/{documentType}/{serie}/{seriesNumber}";

            var apiCall = new ApiCall <InvoiceResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 23
0
        public async Task <ApiResponse <InvoiceResource> > GetInvoiceByIdentifier(string id)
        {
            var url = $"{EndPoint}/{id}";

            var apiCall = new ApiCall <InvoiceResource>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 24
0
        /// <summary>
        /// Gets the full hunted animal list asynchronous.
        /// </summary>
        public async void GetFullHuntedAnimalListAsync()
        {
            HuntedAnimals = await ApiCall.Get <ObservableCollection <HuntedAnimal> >("HuntedAnimal/Hunter/1");

            if (HuntedAnimals != null)
            {
                Error = false;
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Starts the asynchronous. Send Get call to database.
        /// </summary>
        public async void StartAsync()
        {
            Animals = await ApiCall.Get <ObservableCollection <Animal> >("Animals");

            if (Animals != null)
            {
                Error = false;
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Gets the highest bullet count button asynchronous.
        /// </summary>
        public async void GetHighestBulletCountButtonAsync()
        {
            HuntedAnimals = await ApiCall.Get <ObservableCollection <HuntedAnimal> >("HuntedAnimal/Hunter/1");

            if (HuntedAnimals == null)
            {
                Error = true;
            }
            else
            {
                HuntedAnimals = GetHuntedAnimalHighest(HuntedAnimals.ToArray(), GetHuntedAnimalBulletCount);
            }
        }
Esempio n. 27
0
        public async Task <ApiResponse <byte[]> > GetPrintInvoiceByKey(string companyKey, string documentType, string serie, int seriesNumber, string template = null)
        {
            var url = $"{EndPoint}/{companyKey}/{documentType}/{serie}/{seriesNumber}/print";

            if (!string.IsNullOrEmpty(template))
            {
                url = $"{url}?template={template}";
            }

            var apiCall = new ApiCall <byte[]>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 28
0
        public async Task <ApiResponse <byte[]> > GetPrintInvoiceByIdentifier(string id, string template = null)
        {
            var url = $"{EndPoint}/{id}/print";

            if (!string.IsNullOrEmpty(template))
            {
                url = $"{url}?template={template}";
            }

            var apiCall = new ApiCall <byte[]>(Logger);

            return(await apiCall.Get(url, true));
        }
Esempio n. 29
0
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            var animalList = await ApiCall.Get <ObservableCollection <Animal> >("HuntedAnimal/Hunter/1");


            if (animalList == null)
            {
                animalList = await ApiCall.Get <ObservableCollection <Animal> >("HuntedAnimal/Hunter/1");

                if (animalList == null)
                {
                    await Task.Run(() => ReportError.ErrorAsync("User cannot connect"));
                }
            }

            else
            {
                await NavigationService.NavigateAsync(typeof(Views.HunterPage));
            }
            // TODO: add your long-running task here
        }
Esempio n. 30
0
        /// <summary>
        /// Starts the asynchronous.
        /// </summary>
        public async void StartAsync()
        {
            Error = true;
            HttpClient client = new HttpClient();

            //Convert to parent or child from a json string
            try
            {
                HuntedAnimals.Clear();

                var jArray = JArray.Parse(await client.GetStringAsync(new Uri("http://localhost:61604/api/HuntedAnimal/Hunter/1")));

                for (var i = 0; i < jArray.Count; i++)
                {
                    if ((bool)jArray[i]["Animal"]["IsPointsAnimal"])
                    {
                        HuntedAnimals.Add((jArray[i] as JObject).ToObject <HuntedAnimalPoints>());
                    }
                    else
                    {
                        HuntedAnimals.Add((jArray[i] as JObject).ToObject <HuntedAnimal>());
                    }
                }
            }

            //Send the Excepetion to a file
            catch (Exception ex)
            {
                await Task.Run(() => ReportError.ErrorAsync(ex.Message));
            }

            //Get animal
            Animals = await ApiCall.Get <ObservableCollection <Animal> >("Animals");

            if (HuntedAnimals != null && Animals != null)
            {
                Error       = false;
                TotalLength = HuntedAnimals.Count();
            }
        }