Esempio n. 1
0
        // Deletes a role from the database
        static void DeleteRole()
        {
            Activity dbUpdate = new DbUpdate()
            {
                ProviderName = providerInvariantName,
                ConnectionString = connectionString,
                Sql = "DELETE FROM Roles WHERE code = @code",
                Parameters =
                        {
                            { "@code", new InArgument<string>("ARCH") }
                        }
            };

            IDictionary<string, object> results = WorkflowInvoker.Invoke(dbUpdate);
            Console.WriteLine("Affected records: {0}", results["AffectedRecords"].ToString());
        }
Esempio n. 2
0
        // Deletes a role from the database
        static void DeleteRole()
        {
            Activity dbUpdate = new DbUpdate()
            {
                ProviderName     = providerInvariantName,
                ConnectionString = connectionString,
                Sql        = "DELETE FROM Roles WHERE code = @code",
                Parameters =
                {
                    { "@code", new InArgument <string>("ARCH") }
                }
            };

            IDictionary <string, object> results = WorkflowInvoker.Invoke(dbUpdate);

            Console.WriteLine("Affected records: {0}", results["AffectedRecords"].ToString());
        }
Esempio n. 3
0
        // Insert a new record using DbUpdate
        static void InsertArchRole()
        {
            Activity dbUpdate = new DbUpdate()
            {
                ProviderName     = providerInvariantName,
                ConnectionString = connectionString,
                Sql        = "INSERT INTO Roles (Code,Name) VALUES (@code, @name)",
                Parameters =
                {
                    { "@code", new InArgument <string>("ARCH")      },
                    { "@name", new InArgument <string>("Architect") }
                }
            };

            IDictionary <string, object> results = WorkflowInvoker.Invoke(dbUpdate);

            Console.WriteLine("Affected records: {0}", results["AffectedRecords"].ToString());
        }
Esempio n. 4
0
        // Insert a new record using DbUpdate
        static void InsertArchRole()
        {
            Activity dbUpdate = new DbUpdate()
            {
                ProviderName = providerInvariantName,
                ConnectionString = connectionString,
                Sql = "INSERT INTO Roles (Code,Name) VALUES (@code, @name)",
                Parameters =
                        {
                            { "@code", new InArgument<string>("ARCH") },
                            { "@name", new InArgument<string>("Architect") }
                        }
            };

            IDictionary<string, object> results = WorkflowInvoker.Invoke(dbUpdate);

            Console.WriteLine("Affected records: {0}", results["AffectedRecords"].ToString());
        }