public static void CargaPlantilla(TIPO_PLANTILLAS_TICKET tipo) { string ruta = ""; switch (tipo) { case TIPO_PLANTILLAS_TICKET.TICKET: ruta = AppDomain.CurrentDomain.BaseDirectory + @"\PLTICKET"; break; case TIPO_PLANTILLAS_TICKET.RESERVA: ruta = AppDomain.CurrentDomain.BaseDirectory + @"\PLRESERVA"; break; } if (System.IO.Directory.Exists(ruta)) { PlantCab = LeeLineasFich(ruta + @"\CAB_TICKET.TXT"); PlantTot = LeeLineasFich(ruta + @"\TOT_TICKET.TXT"); PlantPie = LeeLineasFich(ruta + @"\PIE_TICKET.TXT"); } else { PlantCab = new string[] { "Empresa 1 - C.I.F: 00000000A", "C\\ Calle, nº 1, esc 1, 1ºA", "03640 - Monóvar", "Alicante", "=================================", "Ticket Nº: {NUM_DOC}", "Fecha Exp: {FECHA_DOC}", "=================================" }; PlantTot = new string[] { "TOTAL BRUTO:", "{TOTAL_BRUTO}", "TOTAL IVA:", "{TOTAL_IVA}", "IMPORTE: ", "{IMPORTE_TOTAL}" }; PlantPie = new string[] { "TEXTO PIE 1", "TEXTO PIE 2", "TEXTO PIE 3" }; } }
public static void GuardaPlantilla(TIPO_PLANTILLAS_TICKET tipo) { string ruta = ""; switch (tipo) { case TIPO_PLANTILLAS_TICKET.TICKET: ruta = AppDomain.CurrentDomain.BaseDirectory + @"\PLTICKET"; break; case TIPO_PLANTILLAS_TICKET.RESERVA: ruta = AppDomain.CurrentDomain.BaseDirectory + @"\PLRESERVA"; break; } if (!System.IO.Directory.Exists(ruta)) { System.IO.Directory.CreateDirectory(ruta); } GuardaLineasFich(ruta + @"\CAB_TICKET.TXT", PlantCab); GuardaLineasFich(ruta + @"\TOT_TICKET.TXT", PlantTot); GuardaLineasFich(ruta + @"\PIE_TICKET.TXT", PlantPie); }