SettingService.cs 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WUtilitiesV01.Services;
  7. namespace Ips.Cfq.QfCard.Cli
  8. {
  9. public class SettingService:BaseSettingService<SettingModel>
  10. {
  11. public static SettingService Instance = new SettingService();
  12. [Obsolete]
  13. protected override string _configFileName
  14. {
  15. get { return "Config.BPC.xml"; }
  16. }
  17. }
  18. public class SettingModel
  19. {
  20. public string CardType { get; set; }
  21. public string Gain { get; set; }
  22. public string GetGain(string ch)
  23. {
  24. var arr = Gain.Split(';');
  25. foreach (var s in arr)
  26. {
  27. var arrch=s.Split('-');
  28. if (ch == arrch[0])
  29. {
  30. return arrch[1];
  31. }
  32. }
  33. return "0";
  34. }
  35. }
  36. }