UnLockTableExcutor.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Data.SqlClient;
  3. using System.Linq;
  4. using JLHHJSvr.BLL;
  5. using JLHHJSvr.Com;
  6. using JLHHJSvr.Com.Model;
  7. using JLHHJSvr.Helper;
  8. using JLHHJSvr.LJException;
  9. using LJLib.DAL.SQL;
  10. using LJLib.Net.SPI.Server;
  11. using LJLib.SQLEX;
  12. namespace JLHHJSvr.Excutor
  13. {
  14. internal sealed class UnLockTableExcutor : ExcutorBase<UnLockTableRequest, UnLockTableResponse>
  15. {
  16. protected override void ExcuteInternal(UnLockTableRequest request, object state, UnLockTableResponse rslt)
  17. {
  18. var tokendata = BllHelper.GetToken(request.token);
  19. using (var con = GlobalVar.ConnectionString.NewSqlConnection())
  20. using (var cmd = con.CreateCommand())
  21. {
  22. con.Open();
  23. using (cmd.Transaction = con.BeginTransaction())
  24. {
  25. try
  26. {
  27. LockHelper.UnLockBill(cmd, request.keyword, request.billid, tokendata.username,tokendata.empid == 0 ? (byte)1 : (byte)0);
  28. cmd.Transaction.Commit();
  29. }
  30. catch (Exception e)
  31. {
  32. cmd.Transaction?.Rollback();
  33. rslt.ErrMsg = e.Message;
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }