123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Data.SqlClient;
- using System.Linq;
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com;
- using JLHHJSvr.Com.Model;
- using JLHHJSvr.Helper;
- using JLHHJSvr.LJException;
- using LJLib.DAL.SQL;
- using LJLib.Net.SPI.Server;
- using LJLib.SQLEX;
- namespace JLHHJSvr.Excutor
- {
- internal sealed class UnLockTableExcutor : ExcutorBase<UnLockTableRequest, UnLockTableResponse>
- {
- protected override void ExcuteInternal(UnLockTableRequest request, object state, UnLockTableResponse rslt)
- {
- var tokendata = BllHelper.GetToken(request.token);
- if (tokendata == null)
- {
- rslt.ErrMsg = "会话已经中断,请重新登录";
- return;
- }
- using (var con = GlobalVar.ConnectionString.NewSqlConnection())
- using (var cmd = con.CreateCommand())
- {
- con.Open();
- using (cmd.Transaction = con.BeginTransaction())
- {
- try
- {
- foreach (var bill in request.lockList)
- {
- LockHelper.UnLockBill(cmd, bill.keyword, bill.billid, tokendata.username,tokendata.empid == 0 ? (byte)1 : (byte)0);
- }
- cmd.Transaction.Commit();
- }
- catch (Exception e)
- {
- cmd.Transaction.Rollback();
- rslt.ErrMsg = e.Message;
- }
- }
- }
- }
- }
- }
|