123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using Models;
- using System.Data.SqlClient;
- namespace DAL
- {
- public class IpInfoService
- {
- /// <summary>
- /// 查询所有
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回集合</returns>
- List<IpInfo> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<IpInfo>.excuteSql(new IpInfo(), "IpInfo", sql, CommandType.Text, param);
- }
- /// <summary>
- /// 查询所有地址为中国的Ip段
- /// </summary>
- /// <returns></returns>
- public List<IpInfo> GetAllIpInfo()
- {
- string strSql = "select * from IpInfo where country like '%中国%'";
- return excuteSql(strSql);
- }
- }
- }
|