Beispiel #1
0
        public int UpdateGroupElementCode(GroupElementCode groupElementCode)
        {
            string sql = @"UPDATE [GroupElementCode] SET [ElementCode] = @ElementCode, [ElementName] = @ElementName, [GroupType] = @GroupType, 
[IsActive] = @IsActive, [LastUpdatedById] = @LastUpdatedById, [LastUpdatedDate] = @LastUpdatedDate WHERE [Id] = @Id";

            var id = db.Connection.Query <int>(sql, groupElementCode).FirstOrDefault();

            return(id);
        }
Beispiel #2
0
        public int InsertGroupElementCode(GroupElementCode groupElementCode)
        {
            string sql = @"INSERT INTO [GroupElementCode] ([ElementCode], [ElementName], [GroupType], [IsActive], [CreatedById], [CreatedDate], [LastUpdatedById], [LastUpdatedDate])
VALUES (@ElementCode, @ElementName, @GroupType, @IsActive, @CreatedById, @CreatedDate, @LastUpdatedById, @LastUpdatedDate); SELECT CAST(SCOPE_IDENTITY() as int)";

            var id = db.Connection.Query <int>(sql, groupElementCode).FirstOrDefault();

            return(id);
        }