|
|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
using Gremlin.GremlinUI.ViewModels;
|
|
|
|
|
using Gremlin.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using static Gremlin.GremlinData.EntityClasses.Enums;
|
|
|
|
|
@ -8,7 +10,26 @@ namespace Gremlin.Operations
|
|
|
|
|
{
|
|
|
|
|
internal class TexFileHandler
|
|
|
|
|
{
|
|
|
|
|
public static void Write(StringBuilder texFile, string datei)
|
|
|
|
|
internal static void CreateTexAndOpen(QuoteVM quoteVM, bool? brutto = false, string texDatei = "test.tex")
|
|
|
|
|
{
|
|
|
|
|
StringBuilder texFile = CreateTexFile(quoteVM, brutto);
|
|
|
|
|
WriteTextToFile(texFile, texDatei);
|
|
|
|
|
//OpenTexFile(texDatei);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void OpenTexFile(string texDatei)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_ = Process.Start(texDatei);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ErrorHandler.ShowErrorInMessageBox(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void WriteTextToFile(StringBuilder texFile, string datei)
|
|
|
|
|
{
|
|
|
|
|
using (StreamWriter writer = new(datei, false, Encoding.UTF8))
|
|
|
|
|
{
|
|
|
|
|
@ -16,7 +37,7 @@ namespace Gremlin.Operations
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static StringBuilder CreateTexFile(QuoteVM quoteVM, bool? brutto = false)
|
|
|
|
|
private static StringBuilder CreateTexFile(QuoteVM quoteVM, bool? brutto)
|
|
|
|
|
{
|
|
|
|
|
float rand = Properties.Settings.Default.texRand;
|
|
|
|
|
|
|
|
|
|
|