终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ScreenSplitMealsControl3ViewModel.cs 2.4 KiB

pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using BPA.Helper;
  2. using BPA.Message;
  3. using BPA.Message.Enum;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.ObjectModel;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading;
  10. using System.Threading.Tasks;
  11. namespace BPASmartClient.ScreenLib
  12. {
  13. public class ScreenSplitMealsControl3ViewModel : NotifyBase
  14. {
  15. #region 变量
  16. /// <summary>
  17. /// 广告地址
  18. /// </summary>
  19. public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
  20. private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());
  21. /// <summary>
  22. /// 界面数据绑定
  23. /// </summary>
  24. public ScreenModelSplitMeals ViewData
  25. {
  26. get { return _ViewData; }
  27. set
  28. {
  29. _ViewData = value;
  30. OnPropertyChanged();
  31. }
  32. }
  33. private ScreenModelSplitMeals _ViewData = new ScreenModelSplitMeals();
  34. /// <summary>
  35. /// 当前刷新数据类型
  36. /// </summary>
  37. public ScreenDeviceType type = ScreenDeviceType.分餐机;
  38. /// <summary>
  39. /// 订单总数
  40. /// </summary>
  41. public int OrderCount
  42. {
  43. get { return _OrderCount; }
  44. set
  45. {
  46. _OrderCount = value;
  47. OnPropertyChanged();
  48. }
  49. }
  50. private int _OrderCount = 0;
  51. #endregion
  52. public ScreenSplitMealsControl3ViewModel()
  53. {
  54. TaskManage.GetInstance.StartLong(new Action(() =>
  55. {
  56. System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
  57. {
  58. if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
  59. {
  60. ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
  61. if (modelMaxWok != null && modelMaxWok.Alarm != null)
  62. modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
  63. ViewData = modelMaxWok;
  64. OrderCount = modelMaxWok.SplitMeals_CreditCardCount_5 + modelMaxWok.SplitMeals_CreditCardCount_6;
  65. }
  66. }));
  67. Thread.Sleep(100);
  68. }), $"{DateTime.Now}_3,线程服务");
  69. }
  70. }
  71. }