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
 //copy constructor
 public CustomerAccountIndividual(CustomerAccountIndividual newCost)
 {
     this.accountID = newCost.getAccountID();
     this.cardNo    = newCost.getCardNo();
     this.custEmail = newCost.getCustEmail();
 }
Esempio n. 3
0
 public void addNewCostumerAccount(CustomerAccountIndividual newCost)
 {
     this.CostumerAccountsList.Add(newCost.getAccountID(), newCost);
 }
Esempio n. 4
0
        public void addNewCostumerAccount(string accountID, string cardNo, string custEmail)
        {
            CustomerAccountIndividual newCost = new CustomerAccountIndividual(accountID, cardNo, custEmail);

            this.addNewCostumerAccount(newCost);
        }
Esempio n. 5
0
 //constructors / helpers
 public CustomerAccount(CustomerAccountIndividual newCost)
 {
     this.addNewCostumerAccount(newCost);
 }