Skip to content

Commit 054cfb1

Browse files
authored
Merge pull request #171 from docusign/feature/document-generation-update
Dynamic tables update
2 parents b759821 + 6ebd30d commit 054cfb1

File tree

6 files changed

+79
-9
lines changed

6 files changed

+79
-9
lines changed
36.3 KB
Binary file not shown.

launcher-csharp/eSignature/Controllers/DocumentGeneration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public IActionResult Create(
3232
string managerName,
3333
string jobTitle,
3434
string salary,
35+
int rsus,
3536
DateTime startDate)
3637
{
3738
string accessToken = this.RequestItemsService.User.AccessToken;
@@ -57,6 +58,7 @@ public IActionResult Create(
5758
managerName,
5859
jobTitle,
5960
salary,
61+
rsus,
6062
startDate,
6163
this.Config.OfferDocDocx);
6264
}

launcher-csharp/eSignature/Examples/DocumentGeneration.cs

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class DocumentGeneration
2727
/// <param name="managerName">Manager name.</param>
2828
/// <param name="jobTitle">Job title.</param>
2929
/// <param name="salary">Salary for potential candidate.</param>
30+
/// <param name="rsus">Restricted stock units (RSUs) for potential candidate.</param>
3031
/// <param name="startDate">Start date of the offer.</param>
3132
/// <param name="offerDocDocx">String of bytes representing the offer document (pdf).</param>
3233
/// <returns>EnvelopeId for the new envelope.</returns>
@@ -39,6 +40,7 @@ public static string DocumentGenerationExample(
3940
string managerName,
4041
string jobTitle,
4142
string salary,
43+
int rsus,
4244
DateTime startDate,
4345
string offerDocDocx)
4446
{
@@ -76,6 +78,7 @@ public static string DocumentGenerationExample(
7678
managerName,
7779
jobTitle,
7880
salary,
81+
rsus.ToString(),
7982
startDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture));
8083

8184
envelopesApi.UpdateEnvelopeDocGenFormFields(
@@ -138,7 +141,7 @@ public static TemplateTabs PrepareTabs()
138141

139142
DateSigned dateSignedTabs = new DateSigned
140143
{
141-
AnchorString = "Date",
144+
AnchorString = "Date Signed",
142145
AnchorUnits = "pixels",
143146
AnchorYOffset = "-22",
144147
};
@@ -201,6 +204,7 @@ public static DocGenFormFieldRequest FormFields(
201204
string managerName,
202205
string jobTitle,
203206
string salary,
207+
string rsus,
204208
string startDate)
205209
{
206210
return new DocGenFormFieldRequest
@@ -229,13 +233,64 @@ public static DocGenFormFieldRequest FormFields(
229233
},
230234
new DocGenFormField
231235
{
232-
Name = "Salary",
233-
Value = salary,
236+
Name = "Start_Date",
237+
Value = startDate,
234238
},
235239
new DocGenFormField
236240
{
237-
Name = "Start_Date",
238-
Value = startDate,
241+
Name = "Compensation_Package",
242+
Type = "TableRow",
243+
RowValues = new List<DocGenFormFieldRowValue>
244+
{
245+
new DocGenFormFieldRowValue
246+
{
247+
DocGenFormFieldList = new List<DocGenFormField>
248+
{
249+
new DocGenFormField
250+
{
251+
Name = "Compensation_Component",
252+
Value = "Salary",
253+
},
254+
new DocGenFormField
255+
{
256+
Name = "Details",
257+
Value = "$" + salary,
258+
},
259+
},
260+
},
261+
new DocGenFormFieldRowValue
262+
{
263+
DocGenFormFieldList = new List<DocGenFormField>
264+
{
265+
new DocGenFormField
266+
{
267+
Name = "Compensation_Component",
268+
Value = "Bonus",
269+
},
270+
new DocGenFormField
271+
{
272+
Name = "Details",
273+
Value = "20%",
274+
},
275+
},
276+
},
277+
new DocGenFormFieldRowValue
278+
{
279+
DocGenFormFieldList = new List<DocGenFormField>
280+
{
281+
new DocGenFormField
282+
{
283+
Name = "Compensation_Component",
284+
Value = "RSUs",
285+
},
286+
new DocGenFormField
287+
{
288+
Name = "Details",
289+
Value = rsus,
290+
},
291+
},
292+
},
293+
},
239294
},
240295
},
241296
},

launcher-csharp/eSignature/Models/DSConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class DsConfiguration
1212
public string DocPdf = "World_Wide_Corp_lorem.pdf";
1313
public string DocumentTemplatePdf = "World_Wide_Corp_Web_Form.pdf";
1414
public string WebFormConfig = "web-form-config.json";
15-
public string OfferDocDocx = "Offer_Letter_Demo.docx";
15+
public string OfferDocDocx = "Offer_Letter_Dynamic_Table.docx";
1616
public string DocCsv = "UserData.csv";
1717
public string DocHtml = "doc_1.html";
1818
public string ExportUsersPath = @"..\..\..\ExportedUserData.csv";

launcher-csharp/eSignature/Views/DocumentGeneration/eg042.cshtml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
int jobTitleIndex = 3;
88
int salaryIndex = 4;
99
int startDateIndex = 5;
10+
int rsusIndex = 6;
1011
}
1112

1213
<h4>@Html.Raw(ViewBag.CodeExampleText.ExampleName)</h4>
@@ -84,8 +85,7 @@
8485

8586
<select class="form-control" id="jobTitle" name="jobTitle">
8687
<option value="Software Engineer">Software Engineer</option>
87-
<option value="Product Manager">Product Manager</option>
88-
<option value="Sales Representative">Sales Representative</option>
88+
<option value="Account Executive">Account Executive</option>
8989
</select>
9090
</div>
9191

@@ -101,6 +101,19 @@
101101
required />
102102
</div>
103103

104+
<div class="form-group">
105+
<label for="rsus">
106+
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[rsusIndex].InputName)
107+
</label>
108+
<input type="number"
109+
min="0"
110+
class="form-control"
111+
id="rsus"
112+
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[rsusIndex].InputPlaceholder"
113+
name="rsus"
114+
required />
115+
</div>
116+
104117
<div class="form-group">
105118
<label for="startDate">
106119
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[startDateIndex].InputName)

launcher-csharp/launcher-csharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<ItemGroup>
3939
<PackageReference Include="DocuSign.Admin" Version="1.4.0" />
4040
<PackageReference Include="DocuSign.Click" Version="1.2.2" />
41-
<PackageReference Include="DocuSign.eSign.dll" Version="6.6.0" />
41+
<PackageReference Include="DocuSign.eSign.dll" Version="6.9.0-rc1" />
4242
<PackageReference Include="DocuSign.Monitor" Version="1.1.1" />
4343
<PackageReference Include="DocuSign.Maestro" Version="1.0.0-rc1" />
4444
<PackageReference Include="DocuSign.Rooms" Version="1.3.0" />

0 commit comments

Comments
 (0)