Created
April 17, 2012 10:59
-
-
Save WaYdotNET/2405302 to your computer and use it in GitHub Desktop.
Nustache
This file contains hidden or 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
var listaFatture = new List<Fatture>(); | |
listaFatture.Add(new Fatture(15, "Fattura fittizzia", DateTime.Now)); | |
listaFatture.Add(new Fatture(0, "Fattura FOOOO", DateTime.Now)); | |
listaFatture.Add(new Fatture(35000, "BAAARRRRR", DateTime.Now)); | |
var obb = new obbligatori(); | |
obb.Descrizione = "descrizione sommaria"; | |
obb.Nome = "che bel nome : fooo {{foo}}"; | |
obb.Fattures = listaFatture; | |
Render.FileToFile("template.txt", obb, "out.html"); |
This file contains hidden or 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
class Fatture | |
{ | |
public int IdFattura { get; set; } | |
public string NomeFattura { get; set; } | |
public DateTime DataFattura { get; set; } | |
public Fatture(int id_fattura, string nome_fattura, DateTime data_fattura) | |
{ | |
IdFattura = id_fattura; | |
NomeFattura = nome_fattura; | |
DataFattura = data_fattura; | |
} | |
} | |
class obbligatori | |
{ | |
public string Nome { get; set; } | |
public string Descrizione { get; set; } | |
public List<Fatture> Fattures { get; set; } | |
public obbligatori(){} | |
public obbligatori(string nome, string descrizione, List<Fatture> fattures ) | |
{ | |
Nome = nome; | |
Descrizione = descrizione; | |
Fattures = fattures; | |
} | |
} |
This file contains hidden or 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
Questo template di obbligatori funziona!! | |
infatti la descrizione � "descrizione sommaria" | |
Il nome del documento. che bel nome : fooo {{foo}} ... bello come nome, non trovi ??? | |
Mentre la lista delle fattura che vengono passate sono | |
----------------------------------------- | |
|-- Data : 17/04/2012 12:56:23 , Numero: 15 | |
| Fattura fittizzia | |
------------------------------------------- | |
----------------------------------------- | |
|-- Data : 17/04/2012 12:56:23 , Numero: 0 | |
| Fattura FOOOO | |
------------------------------------------- | |
----------------------------------------- | |
|-- Data : 17/04/2012 12:56:23 , Numero: 35000 | |
| BAAARRRRR | |
------------------------------------------- |
This file contains hidden or 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
Questo template di obbligatori funziona!! | |
infatti la descrizione è "{{Descrizione}}" | |
Il nome del documento. {{Nome}} ... bello come nome, non trovi ??? | |
Mentre la lista delle fattura che vengono passate sono | |
{{#Fattures}} | |
----------------------------------------- | |
|-- Data : {{DataFattura}} , Numero: {{IdFattura}} | |
| {{NomeFattura}} | |
------------------------------------------- | |
{{/Fattures}} |
Dictionary<string, string>
"art_0": "cod_codificato_con_id_mws_id_art_id_user"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Email generata pre invio
{{User}}
{{art_0}
{{art_1}
{{art_n}}