Esempio n. 1
0
        public string OrderUpdate([FromQuery] updateOrders UpdateData, [FromBody] UpdateOrderDetails UpdateDetailData)
        {
            //required information
            if (UpdateData.OrderID == 0)
            {
                return("Please input OrderID");
            }
            string result, updateOrder, updateOrderDetial;
            var    Update = new DataUpdate();

            //Determine if Order need to update
            if (UpdateData.CustomerID != null || UpdateData.CustomerID != null || UpdateData.EmployeeID != null || UpdateData.OrderDate != null || UpdateData.RequiredDate != null || UpdateData.ShipVia != null ||
                UpdateData.Freight != null || UpdateData.ShipName != null || UpdateData.ShipAddress != null || UpdateData.ShipCity != null || UpdateData.ShipRegion != null || UpdateData.ShipPostalCode != null || UpdateData.ShipCountry != null)
            {
                updateOrder = Update.UpdateOrderData(UpdateData);
            }
            else
            {
                updateOrder = "Order not Edit";
            }
            //Determine if Order Detail need to update & ProductID is required information
            if (UpdateDetailData.ProductID != null & (UpdateDetailData.Quantity != null || UpdateDetailData.UnitPrice != null || UpdateDetailData.Discount != null))
            {
                updateOrderDetial = Update.UpdateOrderDetailData(UpdateDetailData, UpdateData.OrderID);
            }
            else
            {
                updateOrderDetial = "Order Detail not Edit";
            }
            result = updateOrder + " & " + updateOrderDetial;
            return(result);
        }