Ejemplo n.º 1
0
        public static List <Product> GetAllProduct()
        {
            List <Product> productList = new List <Product>();
            GetDataLogic   product     = new GetDataLogic();

            productList = product.GetAllProducts();
            return(productList);
        }
Ejemplo n.º 2
0
        public async void searchStats(string usernameText)
        {
            search.IsEnabled            = false;
            activityIndicator.IsRunning = true;
            var id = await GetDataLogic.GetID(usernameText);

            publicid = id;
            activityIndicator.IsRunning = false;

            if (id.uid == "error")
            {
                await DisplayAlert("Error", "Could not find username: "******"OK");

                search.IsEnabled = true;
                return;
            }
            else if (id.uid == "errornointernet")
            {
                await DisplayAlert("Error", "Could not connect to the Internet. Please check your connection and try again.", "OK");

                search.IsEnabled = true;
                return;
            }
            else
            {
                if (id.platforms.Count > 1)
                {
                    platformselect.ItemsSource = publicid.platforms.ToList();
                    //we have to show alert to choose platform and then call get user stats.
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (platformselect.IsFocused)
                        {
                            platformselect.Unfocus();
                        }

                        platformselect.Focus();
                    });
                }
                else
                {
                    //we call it without asking because there is only one platform.
                    var userstats = await GetDataLogic.GetStats(id, 0);

                    await Navigation.PushAsync(new Stats(userstats, favorites));
                }


                var resultsearch = recents.Contains(id.username);
                if (!resultsearch)
                {
                    recents.Add(id.username);
                    DependencyService.Get <IGetLists>().SetRecents(recents);
                }
            }
        }
Ejemplo n.º 3
0
        private async void Platformselect_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (platformselect.SelectedIndex == -1)
            {
                return;
            }
            //the second time it doesnt show the picker and it automatically enters -1... it returns null exception. Has to be investigated.
            var userstats = await GetDataLogic.GetStats(publicid, platformselect.SelectedIndex);

            await Navigation.PushAsync(new Stats(userstats, favorites));
        }
Ejemplo n.º 4
0
        public void InsertOrder(Order order)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.SaveOrder(order);
        }
Ejemplo n.º 5
0
        public Order GetOrderById(int id)
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetOrderById(id));
        }
Ejemplo n.º 6
0
        public List <Order> GetAllOrders()
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetAllOrders());
        }
Ejemplo n.º 7
0
        public List <Education> GetAllEducations()
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetAllEducation());
        }
Ejemplo n.º 8
0
        public void UpdateCustomers(Customer customer)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.UpdateCustomer(customer);
        }
Ejemplo n.º 9
0
        public void InsertCustomer(Customer customer)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.SaveCustomer(customer);
        }
Ejemplo n.º 10
0
        public Customer GetCustomerById(int id)
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetCustomerById(id));
        }
Ejemplo n.º 11
0
        public List <Customer> GetAllCustomers()
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetAllCustomers());
        }
Ejemplo n.º 12
0
        public void UpdateProducts(Product product)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.UpdateProduct(product);
        }
Ejemplo n.º 13
0
        public void InsertProduct(Product product)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.SaveProduct(product);
        }
Ejemplo n.º 14
0
        public Product GetProductById(int id)
        {
            GetDataLogic logic = new GetDataLogic();

            return(logic.GetProductById(id));
        }
Ejemplo n.º 15
0
 public List <Product> GetAllProducts()
 {
     Business_Logic.GetDataLogic logic = new GetDataLogic();
     return(logic.GetAllProducts());
 }
Ejemplo n.º 16
0
        public void UpdateOrders(Order order)
        {
            GetDataLogic logic = new GetDataLogic();

            logic.UpdateOrder(order);
        }