Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

70 рядки
2.5 KiB

  1. using HKCardOUT.Views;
  2. using HKLib.Dto;
  3. using Logic.RemoteModel;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Globalization;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Data;
  12. using XExten.Advance.StaticFramework;
  13. namespace HKCardOUT.Helper
  14. {
  15. public class DataBus
  16. {
  17. private static string _ConnectionString;
  18. public static string ConnectionString
  19. {
  20. get => _ConnectionString;
  21. set
  22. {
  23. var Route = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DATA");
  24. _ConnectionString = $"DataSource={SyncStatic.CreateFile(Path.Combine(SyncStatic.CreateDir(Route), value))}";
  25. }
  26. }
  27. public static bool NetWordState { get; set; } = false;
  28. public static string Cron { get; set; }
  29. public static bool StartDevice { get; set; }
  30. public static bool Cancel { get; set; }
  31. public static string StoreId { get; set; }
  32. public static string TenantId { get; set; }
  33. public static string COM { get; set; }
  34. public static string SaasRoute { get; set; }
  35. public static int Count { get; set; }
  36. public static TimeSpilte Times { get; set; }
  37. public static StoreInfoResponse StoreInfo { get; set; }
  38. public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>();
  39. }
  40. public class ApiRoute
  41. {
  42. public static string GetTime = DataBus.SaasRoute + "api/one-card/eat-time-interval";
  43. /// <summary>
  44. /// 获取所有卡
  45. /// </summary>
  46. public static string CheckCardStatus = DataBus.SaasRoute + "api/one-card/card-list";
  47. /// <summary>
  48. /// 同步消费记录
  49. /// </summary>
  50. public static string SyncSaleLog = DataBus.SaasRoute + "api/member-helper/memberconsumptionorrecharge";
  51. /// <summary>
  52. /// 获取店铺信息
  53. /// </summary>
  54. public static string PullShopInfo = DataBus.SaasRoute + $"api/StoreHelper/GeBasisGateList?StoreId={DataBus.StoreId}";
  55. }
  56. public class HKConverter : IValueConverter
  57. {
  58. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  59. {
  60. return (bool)value ? "启用" : "禁用";
  61. }
  62. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  63. {
  64. return value;
  65. }
  66. }
  67. }