/// <summary>
        /// Calls the Vendor API DeleteClaim as defined in the Service Reference ServiceReference1
        /// Uses VendorPackage which inherits from IPackage
        /// Currently porting all calls to method that takes Client instead of package
        /// </summary>
        /// <param name="package"></param>
        /// <param name="vendorClaimID"></param>
        /// <returns></returns>
        public static DeletionResults CallDeleteClaimService(VendorPackage package, string[] vendorClaimID)
        {
            var uploader = new ServiceReference1.ClaimImportServiceClient();
            var results  = new DeletionResults();

            ClaimDeletionStatus[] returned = new ClaimDeletionStatus[vendorClaimID.Length];
            for (int i = 0; i < returned.Length; ++i)
            {
                returned[i] = ClaimDeletionStatus.ClaimNotFound;
            }
            Stopwatch sw = new Stopwatch();

            sw.Start();
            try
            {
                for (int i = 0; i < vendorClaimID.Length; i++)
                {
                    returned[i] = uploader.DeleteClaim(package.Client.Username, package.Client.Password, vendorClaimID[i]);
                }
            }
            catch (Exception e)
            {
                results.Exceptions.Add(e);
                results.thrownException = true;
            }
            sw.Stop();
            results.timeToRespond         = sw.Elapsed;
            results.whenUploaded          = DateTime.Now;
            results.client                = package.Client;
            results.document              = package.Document;
            results.claimDeletionStatuses = returned;

            return(results);
        }
Пример #2
0
        public static VendorPackage createPackage(Client client, Document document)
        {
            VendorPackage p = new VendorPackage(client, document);

            return(p);
        }