Skip to content

Commit be55160

Browse files
committed
fix eg11
1 parent 030ffb5 commit be55160

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

eg-03-csharp-auth-code-grant-core/Controllers/Eg002SigningViaEmailController.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ public IActionResult Create(string signerEmail, string signerName, string ccEmai
3737
RequestItemsService.EgName = EgName;
3838
return Redirect("/ds/mustAuthenticate");
3939
}
40+
EnvelopeSummary results = DoWork(signerEmail, signerName, ccEmail, ccName);
41+
ViewBag.h1 = "Envelope sent";
42+
ViewBag.message = "The envelope has been created and sent!<br />Envelope ID " + results.EnvelopeId + ".";
43+
//return results;
44+
return View("example_done");
45+
}
46+
47+
public EnvelopeSummary DoWork(string signerEmail, string signerName, string ccEmail, string ccName)
48+
{
4049
var session = RequestItemsService.Session;
4150
var user = RequestItemsService.User;
4251
EnvelopeDefinition env = MakeEnvelope(signerEmail, signerName, ccEmail, ccName);
@@ -45,10 +54,7 @@ public IActionResult Create(string signerEmail, string signerName, string ccEmai
4554
EnvelopesApi envelopesApi = new EnvelopesApi(config);
4655
EnvelopeSummary results = envelopesApi.CreateEnvelope(RequestItemsService.Session.AccountId, env);
4756
RequestItemsService.EnvelopeId = results.EnvelopeId;
48-
ViewBag.h1 = "Envelope sent";
49-
ViewBag.message = "The envelope has been created and sent!<br />Envelope ID " + results.EnvelopeId + ".";
50-
//return results;
51-
return View("example_done");
57+
return results;
5258
}
5359

5460
private EnvelopeDefinition MakeEnvelope(string signerEmail, string signerName, string ccEmail, string ccName)

eg-03-csharp-auth-code-grant-core/Controllers/Eg011EmbeddedSendingController.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Eg011EmbeddedSendingController : EgController
1818
public Eg011EmbeddedSendingController(DSConfiguration config, IRequestItemsService requestItemsService)
1919
: base(config, requestItemsService)
2020
{
21-
this.controller2 = new Eg002SigningViaEmailController(Config, requestItemsService);
21+
ViewBag.title = "Embedded Sending";
2222
}
2323

2424
public override string EgName => "eg011";
@@ -43,10 +43,11 @@ public IActionResult Create(string signerEmail, string signerName, string ccEmai
4343
config.AddDefaultHeader("Authorization", "Bearer " + user.AccessToken);
4444
EnvelopesApi envelopesApi = new EnvelopesApi(config);
4545
// Step 1. Make the envelope with "created" (draft) status
46+
// Using eg002 to create the envelope with "created" status
4647
RequestItemsService.Status = "created";
47-
//EnvelopeSummary results = (EnvelopeSummary)controller2.doWork(args, model);
48-
controller2.Create(signerEmail, signerName, ccEmail, ccName);
49-
String envelopeId = RequestItemsService.EnvelopeId;
48+
controller2 = new Eg002SigningViaEmailController(Config, RequestItemsService);
49+
EnvelopeSummary results = controller2.DoWork(signerEmail, signerName, ccEmail, ccName);
50+
String envelopeId = results.EnvelopeId;
5051

5152
// Step 2. create the sender view
5253
// Call the CreateSenderView API

0 commit comments

Comments
 (0)