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.

69 rivejä
2.4 KiB

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