public ActionResult TicketDesigner(TicketType type) { TicketViewModel ticket = new TicketViewModel(); var n = DateTime.Now.ToFileTime(); FontEncoder encoder = new FontEncoder(); string text = encoder.Code39(n.ToString()); return(View(new TicketViewModel() { Numero = 99, Precio = 25000, Barcode = getBarcode(1, n), NumericBarcode = n.ToString(), //NumericBarcodeText = encoder.Code39(n.ToString()), ticketType = TicketType.grande, fechaEvento = removerAcentos(DateTime.Now.ToString("dddd dd MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("es-CO"))), //EdadMinima = string.Format("Edad Minima {0}", 18), HoraApertura = String.Format("Apertarura de puertas: {0}", DateTime.Now.ToString("HH:mm")), //Localidad = removerAcentos(string.Format("Localidad: {0}", "Aforo")), BackgorundImgae = type == TicketType.small ? _Ticket.Background.Small : _Ticket.Background.Large, Responsable = "RESPONSABLE: Triada Colombia S.A.S NIT: 900136882-9".ToUpper(), //Ubicacion = "Calle 32 # 35 -30", //NombreEveno = "Evento de Prueba # 1" })); }
/// <summary> /// Initializes a new instance of the BarcodeHelper class. /// </summary> public BarcodeHelper() { m_fontEncoder = new FontEncoder(); }
} // no header /// <summary> /// Prepares the receipt's body. /// </summary> protected override void PrintBody() { Table playerRaffleInfo = new Table(); playerRaffleInfo.RowGroups.Add(new TableRowGroup()); TableRow row; TableCell cell; // Add the player name row = new TableRow(); row.FontSize = FontBig; row.FontWeight = FontWeightBig; cell = new TableCell(); cell.Blocks.Add(new Paragraph(new Run(m_player.Player.FirstName + " " + m_player.Player.LastName))); row.Cells.Add(cell); playerRaffleInfo.RowGroups[0].Rows.Add(row); // Add the player card if (m_printBarcode && !String.IsNullOrWhiteSpace(m_player.Player.MagneticCardNumber)) { row = new TableRow(); row.FontSize = BARCODE_FONT_SIZE; row.FontFamily = new System.Windows.Media.FontFamily(GTI.Modules.Shared.BarcodeHelper.SmallFontName); cell = new TableCell(); FontEncoder fontEncoder = new FontEncoder(); cell.Blocks.Add(new Paragraph(new Run(fontEncoder.Code128(m_player.Player.MagneticCardNumber)))); row.Cells.Add(cell); playerRaffleInfo.RowGroups[0].Rows.Add(row); } row = new TableRow(); row.FontSize = FontBig; cell = new TableCell(); cell.Blocks.Add(new Paragraph(new Run(m_player.Player.MagneticCardNumber))); row.Cells.Add(cell); playerRaffleInfo.RowGroups[0].Rows.Add(row); // Raffle name if (!String.IsNullOrWhiteSpace(m_raffleName)) { row = new TableRow(); row.FontSize = FontSmall; cell = new TableCell(); cell.Blocks.Add(new Paragraph(new Run( String.Format("Raffle: {0}", m_raffleName) ))); row.Cells.Add(cell); playerRaffleInfo.RowGroups[0].Rows.Add(row); } // Put the print time on it row = new TableRow(); row.FontSize = FontSmall; cell = new TableCell(); cell.Blocks.Add(new Paragraph(new Run( String.Format("Printed: {0}", DateTime.Now.ToString()) ))); row.Cells.Add(cell); playerRaffleInfo.RowGroups[0].Rows.Add(row); // Add everything to the main flow document FlowDoc.Blocks.Add(playerRaffleInfo); }