Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

63 Zeilen
2.0 KiB

  1. using HKCardOUT.Views;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Data;
  10. using XExten.Advance.StaticFramework;
  11. namespace HKCardOUT.Helper
  12. {
  13. public class DataBus
  14. {
  15. private static string _ConnectionString;
  16. public static string ConnectionString
  17. {
  18. get => _ConnectionString;
  19. set
  20. {
  21. var Route = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DATA");
  22. _ConnectionString = $"DataSource={SyncStatic.CreateFile(Path.Combine(SyncStatic.CreateDir(Route), value))}";
  23. }
  24. }
  25. public static bool NetWordState { get; set; } = false;
  26. public static string Cron { get; set; }
  27. public static string SaasRoute { get; set; }
  28. public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>();
  29. }
  30. public class ApiRoute
  31. {
  32. /// <summary>
  33. /// 检查卡的状态
  34. /// </summary>
  35. public static string CheckCardStatus = DataBus.SaasRoute + "";
  36. /// <summary>
  37. /// 同步消费记录
  38. /// </summary>
  39. public static string SyncSaleLog = DataBus.SaasRoute + "";
  40. /// <summary>
  41. /// 获取档口信息
  42. /// </summary>
  43. public static string PullWindow = DataBus.SaasRoute + "";
  44. /// <summary>
  45. /// 获取店铺信息
  46. /// </summary>
  47. public static string PullShopInfo = DataBus.SaasRoute + "";
  48. }
  49. public class HKConverter : IValueConverter
  50. {
  51. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  52. {
  53. return (bool)value ? "启用" : "禁用";
  54. }
  55. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  56. {
  57. return value;
  58. }
  59. }
  60. }