guides:sample_updatemoucoirequest_snippet
Differences
This shows you the differences between two versions of the page.
| guides:sample_updatemoucoirequest_snippet [2024/01/12 20:24] – created brett.zamora | guides:sample_updatemoucoirequest_snippet [2024/01/12 20:31] (current) – brett.zamora | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| <code C#> | <code C#> | ||
| - | | + | private void updateMOUCOIRequest() |
| - | { | + | { |
| - | string strUpdateRequestID = " | + | string strUpdateRequestID = " |
| - | | + | |
| - | RestRequest request = null; | + | RestRequest request = null; |
| - | IRestResponse response = null; | + | IRestResponse response = null; |
| - | | + | |
| - | | + | |
| - | // New convention uses a Salt value from the user record | + | // New convention uses a Salt value from the user record |
| - | | + | |
| - | string strPassword = tbPassword.Password.ToString(); | + | string strPassword = tbPassword.Password.ToString(); |
| - | | + | |
| - | | + | |
| - | strParms += tbUserName.Text; | + | strParms += tbUserName.Text; |
| - | strParms += " | + | strParms += " |
| - | strParms += strHashedPassword; | + | strParms += strHashedPassword; |
| - | strParms += " | + | strParms += " |
| - | | + | |
| - | request = new RestRequest(Method.POST); | + | request = new RestRequest(Method.POST); |
| - | | + | |
| - | request.AddHeader(" | + | request.AddHeader(" |
| - | | + | |
| - | response = client.Execute(request); | + | response = client.Execute(request); |
| - | | + | |
| - | { | + | { |
| - | var jsonResult1 = JsonConvert.DeserializeObject< | + | var jsonResult1 = JsonConvert.DeserializeObject< |
| - | string token = jsonResult1.access_token; | + | string token = jsonResult1.access_token; |
| - | | + | |
| - | client = null; | + | client = null; |
| - | request = null; | + | request = null; |
| - | response = null; | + | response = null; |
| - | | + | |
| - | | + | |
| - | { | + | { |
| - | strURL = strURL + "?" | + | strURL = strURL + "?" |
| - | } | + | } |
| - | else | + | else |
| - | { | + | { |
| - | strURL = strURL + "?" | + | strURL = strURL + "?" |
| - | } | + | } |
| - | | + | |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | strURL = strURL + "&" | + | strURL = strURL + "&" |
| - | if ((bool)cbUpdateMOU.IsChecked) | + | |
| - | { | + | |
| - | strURL = strURL + "&" | + | { |
| - | } | + | strURL = strURL + "&" |
| - | else | + | } |
| - | { | + | else |
| - | strURL = strURL + "&" | + | { |
| - | } | + | strURL = strURL + "&" |
| - | if ((bool)cbUpdateCOI.IsChecked) | + | } |
| - | { | + | if ((bool)cbUpdateCOI.IsChecked) |
| - | strURL = strURL + "&" | + | { |
| - | } | + | strURL = strURL + "&" |
| - | else | + | } |
| - | { | + | else |
| - | strURL = strURL + "&" | + | { |
| - | } | + | strURL = strURL + "&" |
| + | } | ||
| - | | + | |
| - | request = new RestRequest(Method.POST); | + | request = new RestRequest(Method.POST); |
| + | |||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | response = client.Execute(request); | ||
| - | request.AddHeader(" | + | if (response.IsSuccessful) |
| - | request.AddHeader(" | + | { |
| - | | + | var jsonResult2 = JsonConvert.DeserializeObject< |
| - | | + | |
| - | | + | strUpdateRequestID = jsonResult2.result; |
| - | { | + | tbRequestID.Text = strUpdateRequestID; |
| - | var jsonResult2 = JsonConvert.DeserializeObject< | + | |
| + | | ||
| + | { | ||
| + | // Increase the test count below to validate that runaway calls are being protected. | ||
| - | strUpdateRequestID | + | int testCtr |
| - | tbRequestID.Text = strUpdateRequestID; | + | |
| - | if ((bool)cbUpdateMOU.IsChecked) | + | for (testCtr = 0; testCtr < 1; testCtr++) |
| - | { | + | { |
| - | // Increase | + | // Note the following syntax |
| + | sendPDFFile(" | ||
| + | } | ||
| + | } | ||
| - | int testCtr = 0; | + | if ((bool)cbUpdateCOI.IsChecked) |
| - | + | { | |
| - | for (testCtr = 0; testCtr < 1; testCtr++) | + | // Increase |
| - | { | + | |
| - | // Note the following syntax | + | |
| - | sendPDFFile(" | + | |
| - | } | + | |
| - | } | + | |
| - | if ((bool)cbUpdateCOI.IsChecked) | + | int testCtr = 0; |
| - | { | + | |
| - | // Increase the test count below to validate that runaway calls are being protected. | + | |
| - | int testCtr = 0; | + | |
| - | + | { | |
| - | | + | // Note the following syntax |
| - | { | + | sendPDFFile(" |
| - | // Note the following syntax | + | |
| - | sendPDFFile(" | + | |
| - | } | + | |
| - | } | + | |
| } | } | ||
| } | } | ||
| - | |||
| - | return; | ||
| } | } | ||
| + | } | ||
| + | |||
| + | return; | ||
| + | } | ||
| </ | </ | ||
guides/sample_updatemoucoirequest_snippet.1705091056.txt.gz · Last modified: by brett.zamora
