Created
September 4, 2019 15:26
-
-
Save juanch0x/835eb19bc4e400e946b709bfe3726fe1 to your computer and use it in GitHub Desktop.
Ejemplo Rotativa
This file contains 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
public ActionResult ImprimirDetalleDistribucion(string CodigoDelfos, int Revision, string Versiones) | |
{ | |
int[] version = JsonConvert.DeserializeObject<int[]>(Versiones); | |
using(DBTrafosContext db = new DBTrafosContext()) { | |
var Trafo = db.Transformador.AsNoTracking().FirstOrDefault(c => c.Codigo_delfos == CodigoDelfos && c.Revision == Revision); | |
Trafo.Datos_Garantizados = Trafo.Datos_Garantizados.Where(c => version.Contains(c.Version)).ToList(); | |
ImprimirDetalleDistribucionViewModel im = new ImprimirDetalleDistribucionViewModel(Trafo); | |
return View(im); | |
} | |
} | |
public ActionResult Print(string CodigoDelfos, int Revision, string Versiones) | |
{ | |
return new Rotativa.ActionAsPdf(nameof(ImprimirDetalleDistribucion), new | |
{ | |
CodigoDelfos, | |
Revision, | |
Versiones | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment