Beispiel #1
0
        internal override long Insert()
        {
            var sql = new SqlBuilder();

            sql.AppendSql($"INSERT INTO {TableName}")
            .AppendSql("(")
            .AppendSql($" {Cols.Name}")
            .AppendSql($",{Cols.Priority}")
            .AppendSql($",{Cols.Visible}")
            .AppendSql($",{Cols.CreateAt}")
            .AppendSql($",{Cols.UpdateAt}")
            .AppendSql(")")
            .AppendSql("VALUES")
            .AppendSql("(")
            .AppendSql($" @{Cols.Name}")
            .AppendSql($",@{Cols.Priority}")
            .AppendSql($",@{Cols.Visible}")
            .AppendSql(",datetime('now', 'localtime')")
            .AppendSql(",datetime('now', 'localtime')")
            .AppendSql(")");
            var paramList = new ParameterList();

            paramList.Add($"@{Cols.Name}", this.Name);
            paramList.Add($"@{Cols.Priority}", this.Priority);
            paramList.Add($"@{Cols.Visible}", MyLogDatabase.Bool2Int(this.Visible));
            return(base.Database.Insert(sql, paramList));
        }
Beispiel #2
0
 internal TemplateDetailEntity(MyLogDatabase database) : base(database)
 {
 }
Beispiel #3
0
 internal TempLogEntity(MyLogDatabase database) : base(database)
 {
 }
Beispiel #4
0
 internal LogDetailEntity(MyLogDatabase database) : base(database)
 {
 }
Beispiel #5
0
 internal BaseEntity(MyLogDatabase database)
 {
     this.Database = database;
 }
Beispiel #6
0
 /// <summary>
 /// パラメータを追加する
 /// </summary>
 /// <param name="key">キー(カラム名)</param>
 /// <param name="val">値</param>
 internal void AddParams(string key, bool val)
 {
     this.Params.Add($"@{key}", MyLogDatabase.Bool2Int(val));
 }
Beispiel #7
0
 internal CategoryEntity(MyLogDatabase database) : base(database)
 {
 }