Пример #1
0
        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);
        }
Пример #2
0
        public List <BOrderLine> GetOrderLines()
        {
            List <BOrderLine> getOrderLines = currOrder.GetOrderLines();

            return(getOrderLines);
        }