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.

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