public void AddNewBill(Bill bill) { try { bill_DAO.DB_AddNewBill(bill); } catch (Exception e) { Console.WriteLine(e.Message); throw; } }
public void AddOrder(Order order) { try { billDAO.DB_AddNewBill(new Bill(0)); Bill lastBill = billDAO.DB_GetLastBill(); order.BillID = lastBill.BillID; orderAndOrderItemDAO.DB_AddOrder(order); foreach (OrderItem orderItem in order.orderItems) { AddOrderItem(orderItem); } } catch (Exception e) { Console.WriteLine($"Failure to add order to db. Error: {e.Message}"); throw; } }