Exemplo n.º 1
0
    public void Cart2()
    {
        functions db = GetComponent <functions>();

        db.Conn();
        string validator = "";

        int session_id = PlayerPrefs.GetInt("Id");

        int quantity = int.Parse(product3.text);

        db.CheckCart(ProductName2, session_id);
        Debug.Log(Checkif);
        if (Checkif == 0)
        {
            //update
            db.UpdateCart(session_id, ProductName2, quantity);
        }
        else
        {
            //insert

            db.AddCart(session_id, ProductName2, quantity);
            Debug.Log("Product Added to Cart");
        }
    }
Exemplo n.º 2
0
    public void LoginUser()
    {
        functions db = GetComponent <functions>();

        db.Conn();
        string validator = "";

        if (name.text == validator && password.text == validator)
        {
            errorhandler.text = "All Fields must be answered";
        }
        else
        {
            db.LoginUser(name.text, password.text);
            errorhandler.text = result;
        }
    }
Exemplo n.º 3
0
    public void RegisterUser()
    {
        functions db = GetComponent <functions>();

        db.Conn();
        string validator = "";

        if (name.text == validator && password.text == validator && password2.text == validator)
        {
            errorhandler.text = "All Fields must be answered";
        }
        else
        {
            if (password.text == password2.text)
            {
                db.Register(name.text, password.text);
                Debug.Log("Succesfully registered");
            }
            else
            {
                errorhandler.text = "Password didn't match";
            }
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        functions db = GetComponent <functions>();

        db.Conn();
    }