public async void ClearCart()
        {
            Cart.Clear();
            NotifyPropertyChanged("Total");
            NotifyPropertyChanged("Subtotal");
            NotifyPropertyChanged("Taxes");

            var handler = new WebRequestHandler();
            await handler.Get("http://localhost/ShoppingCartAPI/ShoppingCart/ClearCart");
        }
示例#2
0
        public string CollectDaily()
        {
            if (!_loggedIn)
            {
                Login();
            }
            var response = _webRequestHandler.Get("https://" + Server + ".darkorbit.com/flashAPI/dailyLogin.php?doBook").Content;

            switch (response)
            {
            case "{\"isError\":1,\"error\":{\"message\":\"Already booked today\"}}":
                return("Already booked");

            case "{\"success\":true}":
                return("Booked");
            }

            return("Failed");
        }
示例#3
0
    void TryConnectToServer()
    {
        WebRequestHandler wrh = GetComponent <WebRequestHandler>();

        wrh.serverAddress = serverAddressField.text;

        // show loading circle
        loadingScreen.SetActive(true);
        StartCoroutine(wrh.Get("", (string message) => {
            // success
            loadingScreen.SetActive(false);

            splashScreen.SetActive(false);
            loginScreen.SetActive(true);
        }, (string message) => {
            // fail
            // TODO show some warning
            Debug.Log("Error: " + message);
            loadingScreen.SetActive(false);
        }));
    }