Helper_SQLHelper_CommandInfo.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. 
  2. using System;
  3. using System.IO;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Data.SqlClient;
  7. using System.Web;
  8. namespace LYFZ.Helper
  9. {
  10. public enum EffentNextType
  11. {
  12. /// <summary>
  13. /// 对其他语句无任何影响
  14. /// </summary>
  15. None,
  16. /// <summary>
  17. /// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务
  18. /// </summary>
  19. WhenHaveContine,
  20. /// <summary>
  21. /// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
  22. /// </summary>
  23. WhenNoHaveContine,
  24. /// <summary>
  25. /// 当前语句影响到的行数必须大于0,否则回滚事务
  26. /// </summary>
  27. ExcuteEffectRows,
  28. /// <summary>
  29. /// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
  30. /// </summary>
  31. SolicitationEvent
  32. }
  33. public class CommandInfo
  34. {
  35. public string CommandText;
  36. public System.Data.SqlClient.SqlParameter[] Parameters;
  37. public EffentNextType EffentNextType = EffentNextType.None;
  38. public CommandInfo()
  39. {
  40. }
  41. public CommandInfo(string sqlText, SqlParameter[] para)
  42. {
  43. this.CommandText = sqlText;
  44. this.Parameters = para;
  45. }
  46. public CommandInfo(string sqlText, SqlParameter[] para, EffentNextType type)
  47. {
  48. this.CommandText = sqlText;
  49. this.Parameters = para;
  50. this.EffentNextType = type;
  51. }
  52. }
  53. }