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.

63 lines
2.1 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 string StoreId { get; set; }
  29. public static string COM { get; set; }
  30. public static string SaasRoute { get; set; }
  31. public static StoreInfoResponse StoreInfo { get; set; }
  32. public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>();
  33. }
  34. public class ApiRoute
  35. {
  36. /// <summary>
  37. /// 检查卡的状态
  38. /// </summary>
  39. public static string CheckCardStatus = DataBus.SaasRoute + "api/member-helper/membercardinfo/";
  40. /// <summary>
  41. /// 同步消费记录
  42. /// </summary>
  43. public static string SyncSaleLog = DataBus.SaasRoute + "api/member-helper/memberconsumptionorrecharge";
  44. /// <summary>
  45. /// 获取店铺信息
  46. /// </summary>
  47. public static string PullShopInfo = DataBus.SaasRoute + $"api/StoreHelper/GeBasisGateList?StoreId={DataBus.StoreId}";
  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. }