public int AddCustomer(Customer newCustomer) { _customerTable.Add(newCustomer); int id = _db.Insert($"insert into Customer values (null, '{newCustomer.FirstName}','{newCustomer.LastName}','{newCustomer.StreetAddress}','{newCustomer.City}','{newCustomer.State}','{newCustomer.Zip}','{newCustomer.Phone}') "); return(id); }
//Passing the product info, and then the activeCustomer's id , so the product is created for the active customer public int AddProductToSell(Product product) { products.Add(product); int id = _db.Insert($"insert into Product values (null, '{product.Title}', '{product.Description}', '{product.Price}', '{product.Quantity}', '{product.Category}', '{product.CustomerId}', '{product.DateCreated}') "); return(id); }
//Method to add a new invoice and return InvoiceId # public int AddInvoice(Invoice invoice) { int id = _db.Insert($"insert into Invoice values (null, '{invoice.CustomerPaymentId}', '{invoice.CustomerId}', '{invoice.InvoiceDate}') "); return(id); }