Exemplo n.º 1
0
        public int UpdateSchemeProduct(SchemeProduct schemeProduct)
        {
            string sql = @"UPDATE [SchemeProduct] SET [SchemeId] = @SchemeId, [ProductId] = @ProductId, [IsActive] = @IsActive, [LastUpdatedById] = @LastUpdatedById, [LastUpdatedDate] = @LastUpdatedDate WHERE [Id] = @Id";

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

            return(id);
        }
Exemplo n.º 2
0
        public int InsertSchemeProduct(SchemeProduct schemeProduct)
        {
            string sql = @"INSERT INTO [SchemeProduct] ([SchemeId],[ProductId],[IsActive], [CreatedById], [CreatedDate], [LastUpdatedById], [LastUpdatedDate])
     VALUES (@SchemeId, @ProductId, @IsActive, @CreatedById, @CreatedDate, @LastUpdatedById, @LastUpdatedDate); SELECT CAST(SCOPE_IDENTITY() as int)";

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

            return(id);
        }