DbCoreClientParam.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using CoreFS.CA06;
  7. namespace Core.StlMes.Client.Sale.DbHelp
  8. {
  9. public class DbCoreClientParam
  10. {
  11. private static string ServerName = "core.stlmes.server.sale.dbhelp.DbManager";
  12. private static string QueryMethod = "exceuteQuery";
  13. private static string NoQueryMethod = "exceuteNoQuery";
  14. private static string BeginTransactionMethod = "beginTransaction";
  15. private static string CommitMethod = "commit";
  16. private static string RollbackMethod = "rollBack";
  17. private static string ExecuteNoQueryTransactionMethod = "exceuteNoQueryTranscation";
  18. /// <summary>
  19. ///获取调用查询的参数
  20. /// </summary>
  21. /// <param name="dt"></param>
  22. /// <param name="args"></param>
  23. /// <returns></returns>
  24. public static CoreClientParam GetCoreClientParam_Query(DataTable dt, object[] args)
  25. {
  26. CoreClientParam param = new CoreClientParam();
  27. param.ServerName = ServerName;
  28. param.MethodName = QueryMethod;
  29. param.ServerParams = args;
  30. param.SourceDataTable = dt;
  31. return param;
  32. }
  33. /// <summary>
  34. /// 获取dml 传入参数
  35. /// </summary>
  36. /// <param name="args"></param>
  37. /// <returns></returns>
  38. public static CoreClientParam GetCoreClientParam_NoQuery(object[] args)
  39. {
  40. CoreClientParam param = new CoreClientParam();
  41. param.ServerName = ServerName;
  42. param.MethodName = NoQueryMethod;
  43. param.ServerParams = args;
  44. return param;
  45. }
  46. public static CoreClientParam GetCoreClientParam_BeginTransaction(object[] args)
  47. {
  48. CoreClientParam param = new CoreClientParam();
  49. param.ServerName = ServerName;
  50. param.MethodName = BeginTransactionMethod;
  51. param.ServerParams = args;
  52. return param;
  53. }
  54. public static CoreClientParam GetCoreClientParam_Commit(object[] args)
  55. {
  56. CoreClientParam param = new CoreClientParam();
  57. param.ServerName = ServerName;
  58. param.MethodName = CommitMethod;
  59. param.ServerParams = args;
  60. return param;
  61. }
  62. public static CoreClientParam GetCoreClientParam_RollBack(object[] args)
  63. {
  64. CoreClientParam param = new CoreClientParam();
  65. param.ServerName = ServerName;
  66. param.MethodName = RollbackMethod;
  67. param.ServerParams = args;
  68. return param;
  69. }
  70. public static CoreClientParam GetCoreClientParam_Trancation(object[] args)
  71. {
  72. CoreClientParam param = new CoreClientParam();
  73. param.ServerName = ServerName;
  74. param.MethodName = ExecuteNoQueryTransactionMethod;
  75. param.ServerParams = args;
  76. return param;
  77. }
  78. }
  79. }