public int requestorder(string item, int quantity, double totalprice, string accountid)
            {
                int result = 0;
                //if -1 : not approved
                //if 0 : account not found (either no account on the store or n

                CustomerAccountIndividual costumer = CostList.ReadAccountInfo(accountid);

                if (costumer != null) //costumer found
                {
                    result = BankInterface.authorize(costumer.getCardNo(), out uint authorizationNo);

                    if (result == 1) //approved
                    {
                        DeliverOrderTable.createOrder(item, quantity, totalprice, accountid, authorizationNo);
                        this.CustEmail = costumer.getCustEmail();
                        Email.emailConfirmation(this.CustEmail);
                    }
                }
                else
                {
                    Console.WriteLine("Costumer was not found. Try again.");
                    Console.WriteLine();
                }
                return(result);
                //if -1 : not approved
                //if 0 : not found
                //if 1 : not approved
            } //end of requestorder
Esempio n. 2
0
    void Start()
    {
        //string t = ""
        //cost = JsonUtility.FromJson<Cost>;

        /*LoginUrl += string.Format("?username={0}", userid);
         * www = new WWW(LoginUrl);
         * yield return www;
         */


        userid = "{\"list\":" + DownloadText(LoginUrl) + "}";
        costs  = JsonUtility.FromJson <CostList>(userid);
        size   = costs.list.Count;

        Debug.Log(size);
        Debug.Log(costs.list [0].Component);
    }