d5f70d46195b8b6ac808ef0a3707111239020926.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System;
  2. using System.Data;
  3. using Core.Mes.ServerFrameWork;
  4. using System.IO;
  5. using System.Data.OracleClient;
  6. using System.Collections;
  7. using Core.Mes.IBaseInterface;
  8. namespace Core.Mes.PurviewManager
  9. {
  10. public class UAM_FUNCTION : IComponent
  11. {
  12. public UAM_FUNCTION() { }
  13. private System.String _FUNCTIONID;
  14. private System.String _FUNCTIONNAME;
  15. private System.String _CLASSNAME;
  16. private System.String _ASSEMBLYNAME;
  17. private System.String _MEMO;
  18. public System.String FUNCTIONID
  19. {
  20. get { return _FUNCTIONID; }
  21. set { _FUNCTIONID = value; }
  22. }
  23. public System.String FUNCTIONNAME
  24. {
  25. get { return _FUNCTIONNAME; }
  26. set { _FUNCTIONNAME = value; }
  27. }
  28. public System.String CLASSNAME
  29. {
  30. get { return _CLASSNAME; }
  31. set { _CLASSNAME = value; }
  32. }
  33. public System.String ASSEMBLYNAME
  34. {
  35. get { return _ASSEMBLYNAME; }
  36. set { _ASSEMBLYNAME = value; }
  37. }
  38. public System.String MEMO
  39. {
  40. get { return _MEMO; }
  41. set { _MEMO = value; }
  42. }
  43. public ReturnObject SelectUAM_FUNCTION(string strWhere)
  44. {
  45. string sqlstr = "select FUNCTIONID"
  46. + ", FUNCTIONNAME"
  47. + ", CLASSNAME"
  48. + ", ASSEMBLYNAME"
  49. + ", IMAGENAME"
  50. + ", MEMO"
  51. + " from UAM_FUNCTION " + strWhere;
  52. string err = "";
  53. DataSet ds = DBManager.ExecuteQuery(sqlstr, out err);
  54. if (err == "") err = sqlstr;
  55. return new ReturnObject(ds, err);
  56. }
  57. public ReturnObject SelectAndCopy(string strWhere)
  58. {
  59. string sqlstr = "select FUNCTIONID"
  60. + ", FUNCTIONNAME"
  61. + ", CLASSNAME"
  62. + ", ASSEMBLYNAME"
  63. + ", MEMO"
  64. + " from UAM_FUNCTION " + strWhere;
  65. string err = "";
  66. DataSet ds = DBManager.ExecuteQuery(sqlstr, out err);
  67. if (err == "" && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
  68. {
  69. DataRow dr = ds.Tables[0].Rows[0];
  70. Type type = this.GetType();
  71. foreach (System.Reflection.PropertyInfo pro in type.GetProperties())
  72. {
  73. if (pro.GetType().ToString() == "System.Single")
  74. {
  75. pro.SetValue(this, (Single)dr[pro.Name], null);
  76. continue;
  77. }
  78. pro.SetValue(this, dr[pro.Name], null);
  79. }
  80. }
  81. if (err == "") err = sqlstr;
  82. return new ReturnObject(ds, err);
  83. }
  84. public ReturnObject InsertUAM_FUNCTION(ArrayList ar)
  85. {
  86. string sqlstr = "insert into UAM_FUNCTION"
  87. + " (FUNCTIONID"
  88. + ", FUNCTIONNAME"
  89. + ", CLASSNAME"
  90. + ", ASSEMBLYNAME"
  91. + ", MEMO"
  92. + ", IMAGENAME"
  93. + ") values ('" + ar[0]
  94. + "', '" + ar[1]
  95. + "', '" + ar[2]
  96. + "', '" + ar[3]
  97. + "', '" + ar[4]
  98. + "', '" + ar[5] + "')";
  99. string err = "";
  100. int i = DBManager.ExecuteNonQuery(sqlstr, out err);
  101. return new ReturnObject(i, err);
  102. }
  103. public ReturnObject UpdateUAM_FUNCTION(ArrayList ar)
  104. {
  105. string sqlstr = "update UAM_FUNCTION set "
  106. + "FUNCTIONID = '" + ar[0]
  107. + "', FUNCTIONNAME = '" + ar[1]
  108. + "CLASSNAME = '" + ar[2]
  109. + "', ASSEMBLYNAME = '" + ar[3]
  110. + "', MEMO = '" + ar[4]
  111. + "', IMAGENAME = '" + ar[5]
  112. + "' where FUNCTIONID = '" + ar[0] + "'";
  113. string err = "";
  114. int i = DBManager.ExecuteNonQuery(sqlstr, out err);
  115. return new ReturnObject(i, err);
  116. }
  117. public ReturnObject DeleteUAM_FUNCTION(string strWhere)
  118. {
  119. string sqlstr = "delete from UAM_FUNCTION " + strWhere;
  120. string err = "";
  121. int i = DBManager.ExecuteNonQuery(sqlstr, out err);
  122. return new ReturnObject(i, err);
  123. }
  124. public ReturnObject UpdateDataSet(DataSet ds, string sqlstr)
  125. {
  126. string err = "";
  127. bool flag = DBManager.UpdateTable(ds.Tables[0], sqlstr, out err);
  128. return new ReturnObject(flag, err);
  129. }
  130. public void Copy(UAM_FUNCTION par)
  131. {
  132. FUNCTIONID = par.FUNCTIONID;
  133. FUNCTIONNAME = par.FUNCTIONNAME;
  134. CLASSNAME = par.CLASSNAME;
  135. ASSEMBLYNAME = par.ASSEMBLYNAME;
  136. MEMO = par.MEMO;
  137. }
  138. }
  139. }