InvitationLetterService.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Models;
  2. using DAL;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Data.SqlClient;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace DAL
  11. {
  12. public class InvitationLetterService
  13. {
  14. List<Position> excuteSql(string sql, params SqlParameter[] param)
  15. {
  16. return ServiceBase<Position>.excuteSql(new Position(), "Position", sql, CommandType.Text, param);
  17. }
  18. Position excuteType(string sql, params SqlParameter[] param)
  19. {
  20. //查询结果放入对象集合
  21. List<Position> hdList = excuteSql(sql, param);
  22. //判断集合是否为空
  23. if (hdList == null || hdList.Count == 0)
  24. //返回null
  25. return null;
  26. //返回单个对象
  27. return hdList[0];
  28. }
  29. public List<Position> GetAllJobTitleCn()
  30. {
  31. return excuteSql("select * from Position where Isdel=0");
  32. }
  33. public Position GetAllByJobTitleCn(string JobTitleCn)
  34. {
  35. return excuteType("select * from Position where Isdel=0 and JobTitleCn='"+ JobTitleCn + "'");
  36. }
  37. }
  38. }