You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.3 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 COM { get; set; }
  33. public static string SaasRoute { get; set; }
  34. public static int Count { get; set; }
  35. public static TimeSpilte Times { get; set; }
  36. public static StoreInfoResponse StoreInfo { get; set; }
  37. public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>();
  38. }
  39. public class ApiRoute
  40. {
  41. /// <summary>
  42. /// 检查卡的状态
  43. /// </summary>
  44. public static string CheckCardStatus = DataBus.SaasRoute + "api/member-helper/membercardinfo";
  45. /// <summary>
  46. /// 同步消费记录
  47. /// </summary>
  48. public static string SyncSaleLog = DataBus.SaasRoute + "api/member-helper/memberconsumptionorrecharge";
  49. /// <summary>
  50. /// 获取店铺信息
  51. /// </summary>
  52. public static string PullShopInfo = DataBus.SaasRoute + $"api/StoreHelper/GeBasisGateList?StoreId={DataBus.StoreId}";
  53. }
  54. public class HKConverter : IValueConverter
  55. {
  56. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  57. {
  58. return (bool)value ? "启用" : "禁用";
  59. }
  60. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  61. {
  62. return value;
  63. }
  64. }
  65. }