using JiangSu.Models;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Data.SQLite;
|
using System.Linq;
|
using System.Web;
|
|
namespace JiangSu.cs
|
{
|
public class ModelDAL
|
{
|
public static Model SelectById(int id)
|
{
|
string sql = "select * from model where id = @id";
|
|
SQLiteParameter param = new SQLiteParameter("@id");
|
param.Value = id;
|
|
DataTable dt = SQLiteHelper.GetDataTable(sql, param);
|
if (null == dt || dt.Rows.Count == 0)
|
{
|
return null;
|
}
|
|
List<Model> list = ModelHandler.FillModel<Model>(dt);
|
|
return null == list || list.Count == 0 ? null : list[0];
|
}
|
}
|
}
|