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