1- using System ;
2- using System . Collections . Generic ;
3- using System . Data ;
1+ using System . Data ;
42
5- namespace BlazorApp_WordProcessing
3+ namespace BlazorApp_WordDocumentAPI
64{
7- class SampleData
5+
6+ public class SampleData
87 {
98 DataTable dataTable ;
9+ public List < Recipient > RecipientList { get ; }
10+ public List < Sender > SenderList { get ; }
1011
1112 public SampleData ( )
1213 {
13- dataTable = new DataTable ( ) ;
14- CreateDataTableColumns ( dataTable ) ;
1514 RecipientList = CreateRecipientList ( ) ;
1615 SenderList = CreateSenderList ( ) ;
16+ dataTable = new DataTable ( ) ;
17+ CreateDataTableColumns ( dataTable ) ;
1718 }
1819
19- public List < Recipient > RecipientList { get ; }
20- public List < Sender > SenderList { get ; }
21-
2220 void CreateDataTableColumns ( DataTable dataTable )
2321 {
2422 dataTable . Columns . Add ( "FirstName" , typeof ( string ) ) ;
@@ -33,32 +31,34 @@ void CreateDataTableColumns(DataTable dataTable)
3331 dataTable . Columns . Add ( "Email" , typeof ( string ) ) ;
3432 }
3533
36- List < Recipient > CreateRecipientList ( )
37- {
38- return new List < Recipient > ( ) {
39- new Recipient ( "Alfreds Futterkiste" , "Maria Anders" , "Sales Representative" ,
40- "Obere Str. 57" , "Berlin" , "12209" , "mariaanders@example.com" ) ,
41- new Recipient ( "Ana Trujillo Emparedados y helados" , "Ana Trujillo" , "Owner" , "Avda. de la Constitucion, 2222" , "Mexico D.F." , "5021" , "anatrujillo@example.com" ) ,
42- new Recipient ( "Antonio Moreno Taqueria" , "Antonio Moreno" , "Owner" , "Mataderos 2312" , "Mexico D.F." , "5023" , "antoniomoreno@example.com" ) ,
43- new Recipient ( "Around the Horn" , "Thomas Hardy" , "Sales Representative" , "120 Hanover Sq." , "London" , "WA1 1DP" , "thomashardy@example.com" ) ,
44- new Recipient ( "Berglunds snabbkop" , "Christina Berglund" , "Order Administrator" , "Berguvsvegen 8" , "Luleе" , "S-958 22" , "christinaberglund@example.com" ) ,
45- new Recipient ( "Blauer See Delikatessen" , "Hanna Moos" , "Sales Representative" , "Forsterstr. 57" , "Mannheim" , "68306" , "hannamoos@example.com" ) ,
46- new Recipient ( "Blondel pure et fils" , "Frederique Citeaux" , "Marketing Manager" , "24 Place Kleber" , "Strasbourg" , "67000" , "frederiqueciteaux@example.com" ) ,
47- new Recipient ( "Bolido Comidas preparadas" , "Martin Sommer" , "Owner" , "C-Araquil, 67" , "Madrid" , "28023" , "martinsommer@example.com" ) ,
48- new Recipient ( "Bon app'" , "Laurence Lebihan" , "Owner" , "12, rue des Bouchers" , "Marseille" , "13008" , "laurencelebihan@example.com" )
49- } ;
50- }
34+ List < Recipient > CreateRecipientList ( ) => new List < Recipient > ( ) {
35+ new Recipient ( "Alfreds Futterkiste" , "Maria Anders" , "Sales Representative" ,
36+ "Obere Str. 57" , "Berlin" , "12209" , "mariaanders@example.com" ) ,
37+ new Recipient ( "Ana Trujillo Emparedados y helados" , "Ana Trujillo" , "Owner" ,
38+ "Avda. de la Constitucion, 2222" , "Mexico D.F." , "5021" , "anatrujillo@example.com" ) ,
39+ new Recipient ( "Antonio Moreno Taqueria" , "Antonio Moreno" , "Owner" ,
40+ "Mataderos 2312" , "Mexico D.F." , "5023" , "antoniomoreno@example.com" ) ,
41+ new Recipient ( "Around the Horn" , "Thomas Hardy" , "Sales Representative" ,
42+ "120 Hanover Sq." , "London" , "WA1 1DP" , "thomashardy@example.com" ) ,
43+ new Recipient ( "Berglunds snabbkop" , "Christina Berglund" , "Order Administrator" ,
44+ "Berguvsvegen 8" , "Lulee" , "S-958 22" , "christinaberglund@example.com" ) ,
45+ new Recipient ( "Blauer See Delikatessen" , "Hanna Moos" , "Sales Representative" ,
46+ "Forsterstr. 57" , "Mannheim" , "68306" , "hannamoos@example.com" ) ,
47+ new Recipient ( "Blondel pure et fils" , "Frederique Citeaux" , "Marketing Manager" ,
48+ "24 Place Kleber" , "Strasbourg" , "67000" , "frederiqueciteaux@example.com" ) ,
49+ new Recipient ( "Bolido Comidas preparadas" , "Martin Sommer" , "Owner" ,
50+ "C-Araquil, 67" , "Madrid" , "28023" , "martinsommer@example.com" ) ,
51+ new Recipient ( "Bon app'" , "Laurence Lebihan" , "Owner" , "12, rue des Bouchers" ,
52+ "Marseille" , "13008" , "laurencelebihan@example.com" )
53+ } ;
5154
52- List < Sender > CreateSenderList ( )
53- {
54- return new List < Sender > ( ) {
55- new Sender ( "Nancy" , "Davolio" , "Sales Representative" ) ,
56- new Sender ( "Andrew" , "Fuller" , "Vice President, Sales" ) ,
57- new Sender ( "Janet" , "Leverling" , "Sales Representative" ) ,
58- new Sender ( "Margaret" , "Peacock" , "Sales Representative" ) ,
59- new Sender ( "Steven" , "Buchanan" , "Sales Manager" )
60- } ;
61- }
55+ List < Sender > CreateSenderList ( ) => new List < Sender > ( ) {
56+ new Sender ( "Nancy" , "Davolio" , "Sales Representative" ) ,
57+ new Sender ( "Andrew" , "Fuller" , "Vice President, Sales" ) ,
58+ new Sender ( "Janet" , "Leverling" , "Sales Representative" ) ,
59+ new Sender ( "Margaret" , "Peacock" , "Sales Representative" ) ,
60+ new Sender ( "Steven" , "Buchanan" , "Sales Manager" )
61+ } ;
6262
6363 public DataTable GetDataSource ( Sender sender , Recipient recipient )
6464 {
@@ -77,6 +77,7 @@ public DataTable GetDataSource(Sender sender, Recipient recipient)
7777 }
7878 }
7979
80+ #region RecipientClass
8081 public class Recipient
8182 {
8283 public Recipient ( string companyName , string contactName , string contactTitle ,
@@ -99,7 +100,9 @@ public Recipient(string companyName, string contactName, string contactTitle,
99100 public string PostalCode { get ; set ; }
100101 public string Email { get ; set ; }
101102 }
103+ #endregion
102104
105+ #region SenderClass
103106 public class Sender
104107 {
105108 public Sender ( string firstName , string lastName , string title )
@@ -114,4 +117,5 @@ public Sender(string firstName, string lastName, string title)
114117 public string Title { get ; set ; }
115118 public string FullName => $ "{ FirstName } { LastName } ";
116119 }
120+ #endregion
117121}
0 commit comments