using Models; using DAL; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DAL { public class InvitationLetterService { List excuteSql(string sql, params SqlParameter[] param) { return ServiceBase.excuteSql(new Position(), "Position", sql, CommandType.Text, param); } Position excuteType(string sql, params SqlParameter[] param) { //查询结果放入对象集合 List hdList = excuteSql(sql, param); //判断集合是否为空 if (hdList == null || hdList.Count == 0) //返回null return null; //返回单个对象 return hdList[0]; } public List GetAllJobTitleCn() { return excuteSql("select * from Position where Isdel=0"); } public Position GetAllByJobTitleCn(string JobTitleCn) { return excuteType("select * from Position where Isdel=0 and JobTitleCn='"+ JobTitleCn + "'"); } } }