Shuxia Ning
2024-07-17 fd681339c81201ed6fb3303647ecab89e3e6c0c1
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
32
33
34
35
36
37
38
39
40
41
42
namespace IStation.DAL.SQLite
{
    /// <summary>
    /// 
    /// </summary>
    public partial class HydraulicModelValidation : Yw.DAL.SQLite.BaseDAL<Entity.HydraulicModelValidation>, IHydraulicModelValidation
    {
        /// <summary>
        /// 
        /// </summary>
        public override ConnectionConfig ConnectionConfig
        {
            get { return ConfigHelper.HydraulicConnectionConfig; }
        }
 
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override long Insert(Entity.HydraulicModelValidation entity)
        {
            if (entity == null)
            {
                return 0L;
            }
 
            using SqlSugarClient sqlSugarClient = new SqlSugarClient(ConnectionConfig);
            if (entity.ID > 0)
            {
                if (sqlSugarClient.Insertable(entity).ExecuteCommand() <= 0)
                {
                    return 0L;
                }
                return entity.ID;
            }
            return sqlSugarClient.Insertable(entity).ExecuteReturnSnowflakeId();
        }
 
    }
}