Constants.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Globalization;
  3. using System.Text;
  4. namespace GCHR.Model
  5. {
  6. internal static class Constants
  7. {
  8. public static string Vormonat(string periode)
  9. {
  10. var jahr = Int32.Parse(periode.Substring(0, 4));
  11. var monat = Int32.Parse(periode.Substring(4, 2));
  12. monat--;
  13. if (monat == 0)
  14. {
  15. monat = 12;
  16. jahr--;
  17. }
  18. return jahr + monat.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0');
  19. }
  20. private static readonly byte[] Key = {76, 123, 122, 84, 45, 12, 44, 78, 56, 43, 47, 6,
  21. 2, 13, 23, 23, 45, 255, 65, 20, 33, 5, 235, 66};
  22. private static readonly byte[] Iv = { 56, 254, 98, 123, 66, 4, 90, 34, 111, 34, 78, 33, 222, 80, 74, 35 };
  23. internal static string Encrypt(string toenc)
  24. {
  25. var des = new CTripleDes(Key, Iv);
  26. return des.Encrypt(toenc);
  27. }
  28. internal static string Decrypt(string todec)
  29. {
  30. var des = new CTripleDes(Key, Iv);
  31. return des.Decrypt(todec);
  32. }
  33. public static Encoding CsvEncoding = Encoding.Default;
  34. public static string ConfigDatei = "config\\gchr.xml";
  35. public const string ConfigDateiAlt = "config\\config.xml";
  36. public const string DepartmentFilter = "'01','1'";
  37. public static NumberFormatInfo Zahlenformat = CultureInfo.GetCultureInfo("de-DE").NumberFormat;
  38. public static NumberFormatInfo ZahlenformatImport = CultureInfo.GetCultureInfo("en-US").NumberFormat;
  39. }
  40. public enum Ampelstatus
  41. {
  42. Keine = -1,
  43. Arbeitend = 0,
  44. Gruen = 1,
  45. Gelb = 2,
  46. Rot = 3
  47. }
  48. public class Status
  49. {
  50. public Ampelstatus Ampelstatus;
  51. public string Message;
  52. }
  53. }