public void Insert(SalesOrder salesOrder) { if (salesOrder != null) { Database.SalesOrders.Add(salesOrder); } }
private static SalesOrderViewModel ConvertToViewSalesOrder(SalesOrder order) { var view = new SalesOrderViewModel() { SalesOrderId = order.SalesOrderId, CustomerName = order.CustomerName, PONumber = order.PONumber, Another = "From ViewModel" }; return view; }
public void Update(SalesOrder salesOrder) { if (salesOrder != null) { SalesOrder orderFromDB = GetSalesOrder(salesOrder.SalesOrderId); if (orderFromDB != null) { orderFromDB.PONumber = salesOrder.PONumber; orderFromDB.CustomerName = salesOrder.CustomerName; } } }