private void mbtnPurchare_Click(object sender, EventArgs e) { try { OrdersObj o = new OrdersObj(); o.CustomerIDObj = userID; o.OrderDateObj = DateTime.Now; o.EmployeeIDObj = 1; int id = businessRuleOrder.AddOrder(o); foreach (ProductsObj p in cart) { OrderDetailsObj od = new OrderDetailsObj(); od.OrderIDObj = id; od.ProductIDObj = p.ProductIDObj; od.QuantityObj = 1; od.UnitPriceObj = p.UnitPriceObj; businessRuleOrder.AddOrderDetail(od); } cart = new List <ProductsObj>(); MessageBox.Show("Order Success!"); } catch { } }
public void AddOrderDetail(OrderDetailsObj orderdetail) { OrderDetail o = new OrderDetail(); o.OrderID = orderdetail.OrderIDObj; o.ProductID = orderdetail.ProductIDObj; o.Quantity = orderdetail.QuantityObj; o.UnitPrice = orderdetail.UnitPriceObj; data.OrderDetails.InsertOnSubmit(o); data.SubmitChanges(); }
public void AddOrderDetail(OrderDetailsObj o) { obj.AddOrderDetail(o); }
public void AddOrderDetail(OrderDetailsObj o) { crudOrders.AddOrderDetail(o); }