using System; using System.Globalization; using System.Text; namespace GCHR.Model { internal static class Constants { public static string Vormonat(string periode) { var jahr = Int32.Parse(periode.Substring(0, 4)); var monat = Int32.Parse(periode.Substring(4, 2)); monat--; if (monat == 0) { monat = 12; jahr--; } return jahr + monat.ToString().PadLeft(2, '0'); } private static byte[] key = {76, 123, 122, 84, 45, 12, 44, 78, 56, 43, 47, 6, 2, 13, 23, 23, 45, 255, 65, 20, 33, 5, 235, 66}; private static readonly byte[] iv = { 56, 254, 98, 123, 66, 4, 90, 34, 111, 34, 78, 33, 222, 80, 74, 35 }; internal static string Encrypt(string toenc) { var des = new CTripleDes(key, iv); return des.Encrypt(toenc); } internal static string Decrypt(string todec) { var des = new CTripleDes(key, iv); return des.Decrypt(todec); } public static Encoding CsvEncoding = Encoding.Default; public static string Importdaten = "data\\import\\import_{0}_{1}.txt"; public const string ConfigDatei = "config\\gchr.xml"; public const string ConfigDateiAlt = "config\\config.xml"; public const string KontenDatei = "data\\ManuelleKonten.xml"; public const string KontenrahmenDatei = "data\\Kontenrahmen.csv"; public const string DatenexportPfad = "data\\"; public const string DepartmentFilter = "'01','1'"; public static NumberFormatInfo Zahlenformat = CultureInfo.GetCultureInfo("de-DE").NumberFormat; public static NumberFormatInfo ZahlenformatImport = CultureInfo.GetCultureInfo("en-US").NumberFormat; } public enum Ampelstatus { Keine = -1, Arbeitend = 0, Gruen = 1, Gelb = 2, Rot = 3 } public class Status { public Ampelstatus Ampelstatus; public string Message; } }