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

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