ClsLoad.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 Infragistics.Win;
  9. using System.Collections;
  10. namespace Core.StlMes.Client.YdmPipeReport
  11. {
  12. class ClsLoad
  13. {
  14. /// <summary>
  15. ///基础信息
  16. /// </summary>
  17. /// <param name="df"></param>
  18. /// <param name="ob"></param>
  19. public static DataTable GetValueListDataTable(string pCode, OpeBase ob)
  20. {
  21. DataTable dt = new DataTable();
  22. ArrayList queryList = new ArrayList();
  23. queryList.Add(pCode);
  24. dt = ServerHelper.GetData("com.steering.pss.ydm.base.BaseOperations.queryBaseConfion", new object[] { queryList }, ob);
  25. return dt;
  26. }
  27. public static DataTable GetValueListDataTable(string [] pCode, OpeBase ob)
  28. {
  29. DataTable dt = new DataTable();
  30. ArrayList queryList = new ArrayList();
  31. for (int i = 0; i < pCode.Length; i++)
  32. {
  33. queryList.Add(pCode[i].ToString());
  34. }
  35. dt = ServerHelper.GetData("com.steering.pss.ydm.base.BaseOperations.queryBaseConfion", new object[] { queryList }, ob);
  36. return dt;
  37. }
  38. /// <summary>
  39. /// 根据指定DataTable生成ValueList
  40. /// </summary>
  41. /// <param name="table"></param>
  42. /// <param name="strKey">value</param>
  43. /// <param name="strText">Text</param>
  44. /// <returns></returns>
  45. public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
  46. {
  47. if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
  48. {
  49. return null;
  50. }
  51. ArrayList alist = new ArrayList();
  52. ValueList vlist = new ValueList();
  53. for (int i = 0; i < table.Rows.Count; i++)
  54. {
  55. try
  56. {
  57. if (!alist.Contains(table.Rows[i][strKey]))
  58. {
  59. alist.Add(table.Rows[i][strKey]);
  60. vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
  61. }
  62. }
  63. catch { }
  64. }
  65. return vlist;
  66. }
  67. /// <summary>
  68. /// 获取作业类型信息
  69. /// </summary>
  70. /// <param name="sortCode">快速索引码,参数数组</param>
  71. /// <param name="ob">界面OB对象</param>
  72. /// <returns></returns>
  73. public static DataTable getComTypeInfo(string sortCode, OpeBase ob)
  74. {
  75. return ServerHelper.GetData("com.steering.pss.ydm.pipemanage.PipeManageClassInfo.queryType", new object[] { sortCode }, ob);
  76. }
  77. }
  78. }