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.

83 regels
2.1 KiB

  1. using BPA.Models;
  2. using HKCardOUT.Helper;
  3. using HKCardOUT.Logic;
  4. using HKCardOUT.Logic.Model;
  5. using HKCardOUT.Logic.Service;
  6. using HKLib.Dto;
  7. using HKLib.RabbitMQ.Config;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Text;
  11. using XExten.Advance.LinqFramework;
  12. using BPA.Helper;
  13. namespace HKCardOUT
  14. {
  15. public class CardHandle : IAccept
  16. {
  17. public void AcceptMQ<T>(string msg)
  18. {
  19. var res = msg.FromJSON<CardStutasDto>();
  20. if (res == null)
  21. {
  22. if (msg.Contains("add"))
  23. RemoteService.GetFoodMenus();
  24. return;
  25. }
  26. //var dto = msg.ToModel<CardStutasDto>();
  27. DbContext.Context.Updateable<CardStutas>().SetColumns(t => t.Stutas == res.Stutas).Where(t => t.CardNo == res.CardNo).ExecuteCommand();
  28. new HKCore().GetAllCardStatus();
  29. }
  30. }
  31. public class NewCardHandle : IAccept
  32. {
  33. public void AcceptMQ<T>(string msg)
  34. {
  35. var res = msg.FromJSON<CardStutas>();
  36. if (res == null)
  37. {
  38. if (msg.Contains("add"))
  39. RemoteService.GetFoodMenus();
  40. return;
  41. }
  42. var data = msg.ToModel<CardStutas>();
  43. HKCore.AddCard(new List<CardStutas> { data });
  44. }
  45. }
  46. public class TimeHandle : IAccept
  47. {
  48. public void AcceptMQ<T>(string msg)
  49. {
  50. var res = msg.FromJSON<TimeSpilte>();
  51. if (res == null)
  52. {
  53. if (msg.Contains("add"))
  54. RemoteService.GetFoodMenus();
  55. return;
  56. }
  57. DataBus.Times = res;
  58. //DataBus.Times = msg.ToModel<TimeSpilte>();
  59. //RemoteService.SyncTime();
  60. }
  61. }
  62. public class FoodHandle : IAccept
  63. {
  64. public void AcceptMQ<T>(string msg)
  65. {
  66. RemoteService.GetFoodMenus();
  67. }
  68. }
  69. public class RangeHandle : IAccept
  70. {
  71. public void AcceptMQ<T>(string msg)
  72. {
  73. RemoteService.GetRangeCtrl();
  74. }
  75. }
  76. }