终端一体化运控平台
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.
 
 
 

91 lines
3.0 KiB

  1. using BPASmartClient.MorkCL.Model.DB;
  2. using BPASmartClient.MorkCL.Server;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPASmartClient.MorkCL.ViewModel
  9. {
  10. public class testViewModel : NotifyBase
  11. {
  12. public testViewModel()
  13. {
  14. testCommand = new BPARelayCommand(() =>
  15. {
  16. SqliteHelper.GetInstance.Init();
  17. for (int i = 0; i < 10; i++)
  18. {
  19. SqliteHelper.GetInstance.AddAccessories(new Model.DB.AccessoriesTB()
  20. {
  21. Description = "AccessoriesTB",
  22. Loc = 1,
  23. Name = $"AccessoriesTB{i}"
  24. });
  25. SqliteHelper.GetInstance.AddIngredients(new Model.DB.IngredientsTB()
  26. {
  27. Description = "IngredientsTB",
  28. Loc = 1,
  29. Name = $"IngredientsTB{i}"
  30. });
  31. SqliteHelper.GetInstance.AddSeasoning(new Model.DB.SeasoningTB()
  32. {
  33. Description = "SeasoningTB",
  34. Loc = 1,
  35. Name = $"SeasoningTB{i}"
  36. });
  37. }
  38. var Accessories = SqliteHelper.GetInstance.GetAccessories();
  39. var Ingredients = SqliteHelper.GetInstance.GetIngredients();
  40. var Seasoning = SqliteHelper.GetInstance.GetSeasoning();
  41. Accessories?.ForEach(x =>
  42. {
  43. SqliteHelper.GetInstance.EditAccessories(new Model.DB.AccessoriesTB()
  44. {
  45. Description = "AccessoriesTB1111",
  46. Loc = x.Loc,
  47. Name = x.Name,
  48. Id = x.Id
  49. });
  50. });
  51. Ingredients?.ForEach(x =>
  52. {
  53. SqliteHelper.GetInstance.EditIngredients(new Model.DB.IngredientsTB()
  54. {
  55. Description = "IngredientsTB1111",
  56. Loc = x.Loc,
  57. Name = x.Name,
  58. Id = x.Id
  59. });
  60. });
  61. Seasoning?.ForEach(x =>
  62. {
  63. SqliteHelper.GetInstance.EditSeasoning(new Model.DB.SeasoningTB()
  64. {
  65. Description = "SeasoningTB1111",
  66. Loc = x.Loc,
  67. Name = x.Name,
  68. Id = x.Id
  69. });
  70. });
  71. var Accessories1 = SqliteHelper.GetInstance.GetAccessories();
  72. var Ingredients1 = SqliteHelper.GetInstance.GetIngredients();
  73. var Seasoning1 = SqliteHelper.GetInstance.GetSeasoning();
  74. });
  75. }
  76. public BPARelayCommand testCommand { get; set; }
  77. }
  78. }