GetDeptExcutor.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. using LJLib.SQLEX;
  13. namespace JLHHJSvr.Excutor
  14. {
  15. internal sealed class GetDeptExcutor : ExcutorBase<GetDeptRequest, GetDeptResponse>
  16. {
  17. protected override void ExcuteInternal(GetDeptRequest request, object state, GetDeptResponse rslt)
  18. {
  19. var tokendata = BllHelper.GetToken(request.token);
  20. if (tokendata == null)
  21. {
  22. rslt.ErrMsg = "会话已经中断,请重新登录";
  23. return;
  24. }
  25. using (var con = GlobalVar.ConnectionString.NewSqlConnection())
  26. using (var cmd = con.CreateCommand())
  27. {
  28. con.Open();
  29. rslt.list = new List<u_dept>();
  30. DbSqlHelper.Select(cmd, "u_dept", null, null, null, 0, 0, rslt.list, null,
  31. "deptid, deptname, profitrate, pricelistid, springtypeid, flag");
  32. }
  33. }
  34. }
  35. }