コード例 #1
0
        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);
        }
コード例 #2
0
        //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);
        }
コード例 #3
0
        //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);
        }