private async Task <bool> SendForApprovals(int docstatus, int containerstatus)
        {
            string desc = string.Empty;

            if (docstatus == 1)
            {
                desc = String.Format("Document {0} is Approved by {1}", selectedItem.Document, txtUserName.Text);
            }
            else
            {
                desc = String.Format("Document {0} is Rejected by {1}", selectedItem.Document, txtUserName.Text);
            }
            ApprovalsDetails approvalRequest = new ApprovalsDetails()
            {
                DocId           = selectedItem.DocId,
                Document        = selectedItem.Document,
                Id              = selectedItem.Id,
                Url             = selectedItem.Url,
                _status         = docstatus,
                TransactionTime = DateTime.Now.ToString()
            };
            await APICall.UpdateApprovalStatus(approvalRequest.Id, approvalRequest);

            ShipmentDetails shipmentRequest = new ShipmentDetails()
            {
                Id            = Container.Id,
                ContainerName = Container.ContainerName,
                Weight        = Convert.ToInt32(Container.Weight),
                _status       = containerstatus,
                Desc          = desc,
                Source        = Container.Source,
                Destination   = Container.Destination
            };
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            prg.Visibility     = Visibility.Collapsed;
            btnSave.IsEnabled  = true;
            btnClose.IsEnabled = true;

            return(true);
        }
        private async Task <bool> InitateShipment()
        {
            string url1 = "http://idtp376/Pdf/GST_B2B_INVOICE_CASES-CF.pdf";
            string url2 = "http://idtp376/Pdf/Ethereum%20Multi-Member%20Consortium%20Network.pdf";
            string url3 = "http://idtp376/Pdf/ASF-VGM-Declaration-Form.pdf";
            string url4 = "http://idtp376/Pdf/Ethereum%20Consortium%20Blockchain%20in%20Azure%20Marketplace.pdf";

            ShipmentDetailForPayment shipmentDetailrequest = new ShipmentDetailForPayment()
            {
                ContainerId   = detail.txtContainerId.Text,
                ContainerName = detail.txtContainerName.Text,
                Quantity      = Convert.ToInt32(detail.txtQuantity.Text),
                SupplierName  = string.Empty
            };
            await APICall.AddShipmentDetail(shipmentDetailrequest.ContainerId, shipmentDetailrequest);

            ShipmentDetails shipmentRequest = new ShipmentDetails()
            {
                Id            = detail.txtContainerId.Text,
                ContainerName = detail.txtContainerName.Text,
                Weight        = Convert.ToInt32(detail.txtContainerWeight.Text),
                _status       = 9,
                Desc          = string.Format("Container {0} is initiated successfully at {1} from {2} to {3}", detail.txtContainerName.Text, DateTime.Now.ToString(), detail.txtSource.Text, detail.txtDestination.Text),
                Source        = detail.txtSource.Text,
                Destination   = detail.txtDestination.Text
            };
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            ApprovalsDetails approvalRequest = new ApprovalsDetails()
            {
                DocId           = 1,
                Document        = "Excise Form",
                Id              = detail.txtContainerId.Text,
                Url             = url1,
                _status         = 0,
                TransactionTime = DateTime.Now.ToString()
            };
            await APICall.UpdateApprovalStatus(approvalRequest.Id, approvalRequest);

            shipmentRequest.Desc = string.Format("Excise Form for Container {0} is uploaded successfully at {1}", detail.txtContainerName.Text, DateTime.Now.ToString());
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            approvalRequest = new ApprovalsDetails()
            {
                DocId           = 2,
                Document        = "Packaging List",
                Id              = detail.txtContainerId.Text,
                Url             = url2,
                _status         = 0,
                TransactionTime = DateTime.Now.ToString()
            };
            await APICall.UpdateApprovalStatus(approvalRequest.Id, approvalRequest);

            shipmentRequest.Desc = string.Format("Packaging List for Container {0} is uploaded successfully at {1}", detail.txtContainerName.Text, DateTime.Now.ToString());
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            approvalRequest = new ApprovalsDetails()
            {
                DocId           = 3,
                Document        = "VGM",
                Id              = detail.txtContainerId.Text,
                Url             = url3,
                _status         = 0,
                TransactionTime = DateTime.Now.ToString()
            };
            await APICall.UpdateApprovalStatus(approvalRequest.Id, approvalRequest);

            shipmentRequest.Desc = string.Format("VGM for Container {0} is uploaded successfully at {1}", detail.txtContainerName.Text, DateTime.Now.ToString());
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            approvalRequest = new ApprovalsDetails()
            {
                DocId           = 4,
                Document        = "Custom Form",
                Id              = detail.txtContainerId.Text,
                Url             = url4,
                _status         = 0,
                TransactionTime = DateTime.Now.ToString()
            };
            await APICall.UpdateApprovalStatus(approvalRequest.Id, approvalRequest);

            shipmentRequest.Desc    = string.Format("Custom Form for Container {0} is uploaded successfully at {1}", detail.txtContainerName.Text, DateTime.Now.ToString());
            shipmentRequest._status = 11;
            await APICall.AddShipmentStatus(shipmentRequest.Id, shipmentRequest);

            return(true);
        }