Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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