管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-12-22 f70fc17e31f5f3f6cc8076f56c580035bd6eb00b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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];
        }
    }
}