RecipeServiceClient.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.WCF;
  6. using Aitex.Triton160.Common.Interface;
  7. namespace Aitex.Triton160.UI.WCF
  8. {
  9. public class RecipeServiceClient : ServiceClientWrapper<IRecipeService>, IRecipeService
  10. {
  11. public RecipeServiceClient()
  12. : base("Client_IRecipeService", "RecipeService")
  13. {
  14. }
  15. public string LoadRecipe(Common.ModuleName chamId, string recipeName)
  16. {
  17. string result = null;
  18. Invoke(svc => { result = svc.LoadRecipe(chamId, recipeName); });
  19. return result;
  20. }
  21. public Tuple<string, string> LoadRunTimeRecipeInfo(Common.ModuleName chamId)
  22. {
  23. Tuple<string, string> result = null;
  24. Invoke(svc => { result = svc.LoadRunTimeRecipeInfo(chamId); });
  25. return result;
  26. }
  27. public bool MoveRecipeFile(Common.ModuleName chamId, string folderName, string tragetFolderName)
  28. {
  29. bool result = false;
  30. Invoke(svc => { result = svc.MoveRecipeFile(chamId, folderName, tragetFolderName); });
  31. return result;
  32. }
  33. public IEnumerable<string> GetRecipes(Common.ModuleName chamId, bool includeUsedRecipe)
  34. {
  35. IEnumerable<string> result = null;
  36. Invoke(svc => { result = svc.GetRecipes(chamId, includeUsedRecipe); });
  37. return result;
  38. }
  39. public string GetXmlRecipeList(Common.ModuleName chamId, bool includeUsedRecipe)
  40. {
  41. string result = null;
  42. Invoke(svc => { result = svc.GetXmlRecipeList(chamId, includeUsedRecipe); });
  43. return result;
  44. }
  45. public bool DeleteRecipe(Common.ModuleName chamId, string recipeName)
  46. {
  47. bool result = false;
  48. Invoke(svc => { result = svc.DeleteRecipe(chamId, recipeName); });
  49. return result;
  50. }
  51. public bool DeleteFolder(Common.ModuleName chamId, string folderName)
  52. {
  53. bool result = false;
  54. Invoke(svc => { result = svc.DeleteFolder(chamId, folderName); });
  55. return result;
  56. }
  57. public bool SaveAsRecipe(Common.ModuleName chamId, string recipeName, string recipeContent)
  58. {
  59. bool result = false;
  60. Invoke(svc => { result = svc.SaveAsRecipe(chamId, recipeName, recipeContent); });
  61. return result;
  62. }
  63. public bool SaveRecipe(Common.ModuleName chamId, string recipeName, string recipeContent)
  64. {
  65. bool result = false;
  66. Invoke(svc => { result = svc.SaveRecipe(chamId, recipeName, recipeContent); });
  67. return result;
  68. }
  69. public bool CreateFolder(Common.ModuleName chamId, string folderName)
  70. {
  71. bool result = false;
  72. Invoke(svc => { result = svc.CreateFolder(chamId, folderName); });
  73. return result;
  74. }
  75. public bool RenameRecipe(Common.ModuleName chamId, string oldName, string newName)
  76. {
  77. bool result = false;
  78. Invoke(svc => { result = svc.RenameRecipe(chamId, oldName, newName); });
  79. return result;
  80. }
  81. public bool RenameFolder(Common.ModuleName chamId, string oldName, string newName)
  82. {
  83. bool result = false;
  84. Invoke(svc => { result = svc.RenameFolder(chamId, oldName, newName); });
  85. return result;
  86. }
  87. public string GetRecipeFormatXml(Common.ModuleName chamId)
  88. {
  89. string result = null;
  90. Invoke(svc => { result = svc.GetRecipeFormatXml(chamId); });
  91. return result;
  92. }
  93. public string GetRecipeTemplate(Common.ModuleName chamId)
  94. {
  95. string result = string.Empty;
  96. Invoke(svc => { result = svc.GetRecipeTemplate(chamId); });
  97. return result;
  98. }
  99. public string GetRecipeByBarcode(Common.ModuleName chamId, string barcode)
  100. {
  101. string result = string.Empty;
  102. Invoke(svc => { result = svc.GetRecipeByBarcode(chamId, barcode); });
  103. return result;
  104. }
  105. }
  106. }