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
//copy constructor public CustomerAccountIndividual(CustomerAccountIndividual newCost) { this.accountID = newCost.getAccountID(); this.cardNo = newCost.getCardNo(); this.custEmail = newCost.getCustEmail(); }