McpBaseHelper.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using Core.Mes.Client.Comm.Server;
  7. using CoreFS.CA06;
  8. using Core.Mes.Client.Comm.Control;
  9. using Infragistics.Win.UltraWinEditors;
  10. namespace Core.StlMes.Client.Mcp.Common
  11. {
  12. class McpBaseHelper
  13. {
  14. /// <summary>
  15. /// 获取产线
  16. /// </summary>
  17. /// <param name="validDataPurviewIds">数据权限</param>
  18. /// <param name="Ob"></param>
  19. /// <returns>字符串数组</returns>
  20. public static string[] GetPCodePline(string arr, OpeBase ob)
  21. {
  22. string[] arr1 = null;
  23. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.McpBaseHelper.GetPCode", new Object[] { arr }, ob);
  24. if (dt != null && dt.Rows.Count > 0)
  25. {
  26. arr1 = new string[dt.Rows.Count];
  27. for (int i = 0; i < dt.Rows.Count; i++)
  28. {
  29. arr1[i] = dt.Rows[i][0].ToString();
  30. }
  31. return arr1;
  32. }
  33. else
  34. {
  35. return new string[1] { "" };
  36. }
  37. }
  38. /// <summary>
  39. /// 获取工艺文件路径
  40. /// </summary>
  41. /// <param name="arr"></param>
  42. /// <param name="Ob"></param>
  43. /// <returns></returns>
  44. public static string GetGyUrl(string arr, OpeBase ob)
  45. {
  46. string path = "";
  47. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getCraftPathById", new object[] { arr }, ob);
  48. if (dt.Rows.Count > 0)
  49. {
  50. path = dt.Rows[0]["CRAFT_PATH"].ToString();
  51. FormFileDown down = new FormFileDown(ob, path);
  52. down.CtrlFileDown1.Button3.Visible = false;
  53. down.ShowDialog();
  54. }
  55. else { }
  56. return path;
  57. }
  58. /// <summary>
  59. /// 获取Mps文件路径
  60. /// </summary>
  61. /// <param name="arr"></param>
  62. /// <param name="Ob"></param>
  63. /// <returns></returns>
  64. public static string GetMpsUrl(string arr, OpeBase ob)
  65. {
  66. string path = "";
  67. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getCraftPathById", new object[] { arr }, ob);
  68. if (dt.Rows.Count > 0)
  69. {
  70. path = dt.Rows[0]["CRAFT_PATH"].ToString();
  71. FormFileDown down = new FormFileDown(ob, path);
  72. down.CtrlFileDown1.Button3.Visible = false;
  73. down.ShowDialog();
  74. }
  75. else { }
  76. return path;
  77. }
  78. /// <summary>
  79. /// 产线
  80. /// </summary>
  81. /// <param name="uce"></param>
  82. /// <param name="jurisdictions"></param>
  83. public static void InitPlineUnit(UltraComboEditor uce, string[] plinCode, OpeBase ob,string gx)
  84. {
  85. if (plinCode.Length == 0)
  86. {
  87. uce.DataSource = null;
  88. return;
  89. }
  90. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryPlineCode", new object[] { plinCode, gx }, ob);
  91. uce.DataSource = dt;
  92. uce.DisplayMember = "PLINE_NAME";
  93. uce.ValueMember = "PLINE_CODE";
  94. //uce.SelectedIndex = 0;
  95. }
  96. /// <summary>
  97. /// 仓库数据权限
  98. /// </summary>
  99. /// <param name="customInfo">页面配制信息(自定义参数)</param>
  100. /// <param name="validDataPurviewIds">用户数据权限</param>
  101. /// <returns>可查看仓库组成的字符串</returns>
  102. public static string[] WarehousePermissions(String customInfo, String[] validDataPurviewIds, OpeBase ob)
  103. {
  104. string storageType = "";//仓库类别
  105. string storageAttr = "";//仓库类型
  106. if (customInfo.Length >= 0 && customInfo.Contains(","))
  107. {
  108. string[] strflg = customInfo.ToString().Split(new char[] { ',' });
  109. storageType = strflg[0];
  110. storageAttr = strflg[1];
  111. }
  112. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.WarehousePermissions.getWarehousePermissions", new object[] { storageType, storageAttr, validDataPurviewIds }, ob);
  113. if (dt != null && dt.Rows.Count > 0)
  114. {
  115. string[] storages = new string[dt.Rows.Count];
  116. for (int i = 0; i < dt.Rows.Count; i++)
  117. {
  118. storages[i] = dt.Rows[i]["STORAGE_NO"].ToString();
  119. }
  120. return storages;
  121. }
  122. else
  123. {
  124. return new string[1] { "" };
  125. }
  126. }
  127. }
  128. }