GetDeptExcutor.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.SqlClient;
  4. using System.Linq;
  5. using System.Text;
  6. using JLHHJSvr.BLL;
  7. using JLHHJSvr.Com;
  8. using JLHHJSvr.Com.Model;
  9. using JLHHJSvr.DBA.DBModle;
  10. using LJLib.DAL.SQL;
  11. using LJLib.Net.SPI.Server;
  12. namespace JLHHJSvr.Excutor
  13. {
  14. internal sealed class GetDeptExcutor : ExcutorBase<GetDeptRequest, GetDeptResponse>
  15. {
  16. protected override void ExcuteInternal(GetDeptRequest request, object state, GetDeptResponse rslt)
  17. {
  18. var tokendata = BllHelper.GetToken(request.token);
  19. if (tokendata == null)
  20. {
  21. rslt.ErrMsg = "会话已经中断,请重新登录";
  22. return;
  23. }
  24. using (var con = new SqlConnection(GlobalVar.ConnectionString))
  25. using (var cmd = con.CreateCommand())
  26. {
  27. con.Open();
  28. rslt.list = new List<u_dept>();
  29. DbSqlHelper.Select(cmd, "u_dept", null, null, null, 0, 0, rslt.list, null,
  30. "deptid, deptname, profitrate, pricelistid, springtypeid, flag");
  31. }
  32. }
  33. }
  34. }