/// <summary> /// Gets the product with the specified identifier /// </summary> public void GetProductById(ProductDS productDS, int productId) { try { ProductDALC productDALC = new ProductDALC(); productDALC.GetProductById(productDS, productId); } catch (Exception e) { throw new ApplicationException(ResourceManager.GetString("RES_ExceptionGetProduct"), e); } }
/// <summary> /// Creates a new order with the specified params /// </summary> public int CreateOrderFromCart(int customerId, CartDS.CartItemsDataTable items) { OrderDALC orderDALC = new OrderDALC(); ProductDALC productDALC = new ProductDALC(); int orderId = orderDALC.CreateOrder(customerId, DateTime.Now, DateTime.Now.AddDays(2)); foreach (CartDS.CartItem item in items) { ProductDS productDS = new ProductDS(); productDALC.GetProductById(productDS, item.ProductId); orderDALC.CreateOrderItem(orderId, item.ProductId, productDS.Products[0].UnitCost, item.Quantity); } return(orderId); }