public BOrder CreateOrder(BOrder currOrder) { int oId = 0; using (SqlConnection connection = new SqlConnection(_connectionString)) { connection.Open(); using (SqlCommand cmdInsertProd = connection.CreateCommand()) { cmdInsertProd.CommandText = "INSERT INTO BOrder(orderDate) output INSERTED.ID VALUES(@orderDate)"; cmdInsertProd.Parameters.AddWithValue("orderDate", currOrder.DateTime); oId = (int)cmdInsertProd.ExecuteScalar(); } } DBOrderLine dbOrderline = new DBOrderLine(); List <BOrderLine> ols = dbOrderline.SaveOrderLines(oId, currOrder.GetOrderLines()); //currOrder.SetOrderLines(ols); return(currOrder); }
public List <BOrderLine> GetOrderLines() { List <BOrderLine> getOrderLines = currOrder.GetOrderLines(); return(getOrderLines); }