Ejemplo n.º 1
0
        public async Task <Boolean> sendPendingCustomers()
        {
            Boolean         customerCheck = false;
            List <Customer> customers     = dBFacade.getLocalStorageCustomers();

            for (int i = customers.Count - 1; i >= 0; i--)
            {
                if (await dBFacade.getCustomer(customers[i].CustomerNumber) != null)
                {
                    customers.RemoveAt(i);
                }
            }
            customerCheck = await dBFacade.createCustomers(customers);

            if (customerCheck)
            {
                return(dBFacade.removeLocalStorageCustomers());
            }

            return(customerCheck);
        }