public Response AddOrder(Order order) { AddOrderRules addOrderRules = new AddOrderRules(); Response response = new Response(); Tax taxObject = new Tax(); Product productObject = new Product(); taxObject = _taxRepository.LoadTaxObject(order.State.ToLower()); productObject = _productRepository.LoadProduct(order.ProductType.ToLower()); response = addOrderRules.AddOrder(order, productObject, taxObject); response.Order.OrderNumber = GetOrderNumber(order.OrderDate); return(response); }
public Response Edit(Order newOrderInfo, Order OldOrderInfo) { Response response = new Response(); AddOrderRules addOrder = new AddOrderRules(); Tax TaxObject = new Tax(); Product ProductObject = new Product(); TaxObject = _taxRepository.LoadTaxObject(newOrderInfo.State); ProductObject = _productRepository.LoadProduct(newOrderInfo.ProductType); response = addOrder.AddOrder(newOrderInfo, ProductObject, TaxObject); if (response.Success == true) { response.Order.OrderDate = OldOrderInfo.OrderDate; response.Order.OrderNumber = OldOrderInfo.OrderNumber; return(response); } return(response); }