예제 #1
0
 public string CloseJob(string jobId)
 {
     var jobInfo = new JobInfo {State = "Closed"};
     var submitBatchUrl = String.Format(Urls["CloseJob"], AuthenticationClient.AuthToken.InstanceUrl, jobId);
     var jobResponse = BulkUploadDataToSalesforce(submitBatchUrl, jobInfo.SerializeToSalesforceXml());
     return jobResponse;
 }
예제 #2
0
 public JobInfo CreateBulkUpsertJob(JobObject jobObject, string externalIdFieldName)
 {
     var jobInfo = new JobInfo
     {
         ContentType = ContentType.XML,
         Operation = Operation.upsert,
         JobObject = jobObject,
         ExternalIdFieldName = externalIdFieldName
     };
     var jobResponse = CreateJob(jobInfo);
     return jobResponse;
 }
예제 #3
0
 public string UploadString(string address, string method, string data)
 {
     switch (address)
     {
         case "CreateBulkJob":
             var jobInfo = new JobInfo { JobId = "JobId" };
             return jobInfo.SerializeToSalesforceXml();
         case "UploadBatch":
             var batchInfo = new BatchInfo { JobId = "JobId", BatchId = "BatchId" };
             return batchInfo.SerializeToSalesforceXml();
     }
     return null;
 }
예제 #4
0
 public string DownloadString(string address)
 {
     switch (address)
     {
         case "CloseJob":
             var jobInfo = new JobInfo
             {
                 JobId = "JobId",
                 State = "Completed"
             };
             return jobInfo.SerializeToSalesforceXml();
         case "GetBatchResults":
             return SalesforceReturnData;
     }
     return null;
 }
예제 #5
0
 private JobInfo CreateJob(JobInfo jobInfo)
 {
     var createJobUrl = String.Format(Urls["CreateBulkJob"], AuthenticationClient.AuthToken.InstanceUrl);
     var xmlString = jobInfo.SerializeToSalesforceXml();
     var jobResponse = BulkUploadDataToSalesforce(createJobUrl, xmlString);
     return jobResponse.DeSerializeToSalesforceObject<JobInfo>();
 }