Created
February 13, 2022 12:37
-
-
Save Gerhard-ZA/f99159f6002abcbc2f3a756ff0c8431e to your computer and use it in GitHub Desktop.
Creating Log Entry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ProcessDocument(RestService rs, string fileLocation, string fileName, decimal fileSizeMb, string fileStatus, string folder, string uploadedBy) | |
{ | |
string result = ""; | |
string entityAsString = JsonConvert.SerializeObject(new | |
{ | |
FileLocation = new { value = fileLocation.Replace(@"\\", @"\") }, | |
FileName = new { value = fileName }, | |
FileSizeMb = new { value = fileSizeMb }, | |
FileStatus = new { value = fileStatus }, | |
Folder = new { value = folder.Replace(@"\\", @"\") }, | |
UploadedBy = new { value = uploadedBy } | |
}); | |
//Create a sales order with the specified values | |
string serviceResponse = rs.Put("DataFile", entityAsString, null); | |
if (serviceResponse != null) | |
{ | |
try | |
{ | |
JObject purchaseOrderCreated = JObject.Parse(serviceResponse); | |
result = purchaseOrderCreated.GetValue("FileID").Value<string>("value"); | |
string poNumber = result; | |
} | |
catch (Exception e) | |
{ | |
result = e.Message; | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment