public void CreateDatabase() { var connectionString = ConfigurationManager.ConnectionStrings["InitialSetupConnString"].ConnectionString; using (var conn = new SqlConnection(connectionString)) { conn.Open(); using (var dropDatabaseCommand = new SqlCommand(DropSql, conn)) { dropDatabaseCommand.ExecuteNonQuery(); } using (var createDatabaseCommand = new SqlCommand(CreateSql, conn)) { createDatabaseCommand.ExecuteNonQuery(); } using (var setupUserCommand = new SqlCommand(SetupUserSql, conn)) { setupUserCommand.ExecuteNonQuery(); } conn.Close(); } Deploy.Run(); }
public static void XPurge() { if (!CheckLicense.Check()) { return; } // Process active document Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Autodesk.AutoCAD.DatabaseServices.Database db = doc.Database; // Read settings var deploy = new Deploy(); // Add purge actions deploy.AddAction(new PurgeDGNLS()); deploy.AddAction(new PurgeAll()); // Start processing deploy.Run(db); }