public ActionResult Edit(int OrderID)
        {
            var model = new Control.UI.Models.PedidoCompraViewModel();

            context = new DALContext();

            PurchaseOrder retorno = new PurchaseOrder();

            try
            {
                retorno = context.PurchaseOrders.All().Include("Items").ToList().Find(p => p.Id == OrderID);

                model.PurchaseOrder       = retorno;
                model.PurchaseOrder.Items = retorno.Items;

                foreach (var item in model.PurchaseOrder.Items)
                {
                    item.ProductItem = new Product();
                    item.ProductItem = context.Products.Find(x => x.Id == item.ProductID);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(View("Create", model));
        }
        public ActionResult Conferencia(int OrderID)
        {
            var model = new Control.UI.Models.PedidoCompraViewModel();

            context = new DALContext();
            try
            {
                var retorno = context.PurchaseOrders.Find(p => p.Id == OrderID);
                model.PurchaseOrder = retorno;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(View(model));
        }