public bool UpdateDeliveryStatus(int deliveryId, string newDeliveryStatus, [FromBody] string verificationImage)
        {
            bool result = false;

            try
            {
                Delivery oldDelivery = _deliveryManager.RetrieveDeliveryById(deliveryId);
                Delivery newDelivery = _deliveryManager.RetrieveDeliveryById(deliveryId);
                newDelivery.StatusId = newDeliveryStatus;
                try
                {
                    byte[] verificationAsBytes = Encoding.ASCII.GetBytes(verificationImage);
                    newDelivery.Verification = verificationAsBytes;
                }
                catch
                {
                    byte[] verificationAsBytes = null;
                    newDelivery.Verification = verificationAsBytes;
                }

                if (_deliveryManager.UpdateDelivery(oldDelivery, newDelivery))
                {
                    result = true;
                }
                else
                {
                    result = false;
                }

                List <Delivery> ordersDeliveries = _deliveryManager.RetrieveDeliveriesByOrderId((int)oldDelivery.OrderId);
                bool            allDelivered     = true;
                foreach (Delivery d in ordersDeliveries)
                {
                    if (d.StatusId != "Delivered")
                    {
                        allDelivered = false;
                    }
                }

                if (allDelivered)
                {
                    ProductOrder oldOrder = _orderManager.retrieveProductOrderDetails((int)oldDelivery.OrderId);
                    ProductOrder newOrder = _orderManager.retrieveProductOrderDetails((int)oldDelivery.OrderId);
                    newOrder.OrderStatusId = "Delivered";
                    newOrder.HasArrived    = true;
                    _orderManager.UpdateProductOrder(oldOrder, newOrder);
                }
            }
            catch
            {
                result = false;
            }

            return(result);
        }