diff --git a/api/src/Erp.Platform.HttpApi.Host/Data/LegacyReportDbContext.cs b/api/src/Erp.Platform.HttpApi.Host/Data/LegacyReportDbContext.cs deleted file mode 100644 index 6484326c..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/Data/LegacyReportDbContext.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Linq; -using Microsoft.EntityFrameworkCore; - -namespace Erp.Reports.HttpApi.Host.Data; - -public class SqlDataConnectionDescription : DataConnection { } -public class JsonDataConnectionDescription : DataConnection { } - -public abstract class DataConnection -{ - public int Id { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string ConnectionString { get; set; } -} - -public class LegacyReportDbContext : DbContext -{ - public DbSet JsonDataConnections { get; set; } - public DbSet SqlDataConnections { get; set; } - - public LegacyReportDbContext(DbContextOptions options) : base(options) - { - } - - public void InitializeDatabase() - { - Database.EnsureCreated(); - - var nwindJsonDataConnectionName = "NWindProductsJson"; - if (!JsonDataConnections.Any(x => x.Name == nwindJsonDataConnectionName)) - { - var newData = new JsonDataConnectionDescription - { - Name = nwindJsonDataConnectionName, - DisplayName = "Northwind Products (JSON)", - ConnectionString = "Uri=Data/nwind.json" - }; - JsonDataConnections.Add(newData); - } - - var nwindSqlDataConnectionName = "NWindConnectionString"; - if (!SqlDataConnections.Any(x => x.Name == nwindSqlDataConnectionName)) - { - var newData = new SqlDataConnectionDescription - { - Name = nwindSqlDataConnectionName, - DisplayName = "Northwind Data Connection", - ConnectionString = "XpoProvider=SQLite;Data Source=|DataDirectory|Data/nwind.db" - }; - SqlDataConnections.Add(newData); - } - - var reportsDataConnectionName = "ReportsDataSqlite"; - if (!SqlDataConnections.Any(x => x.Name == reportsDataConnectionName)) - { - var newData = new SqlDataConnectionDescription - { - Name = reportsDataConnectionName, - DisplayName = "Reports Data (Demo)", - ConnectionString = "XpoProvider=SQLite;Data Source=|DataDirectory|Data/reportsData.db" - }; - SqlDataConnections.Add(newData); - } - SaveChanges(); - } -} diff --git a/api/src/Erp.Platform.HttpApi.Host/Data/nwind.db b/api/src/Erp.Platform.HttpApi.Host/Data/nwind.db deleted file mode 100644 index ef5dea89..00000000 Binary files a/api/src/Erp.Platform.HttpApi.Host/Data/nwind.db and /dev/null differ diff --git a/api/src/Erp.Platform.HttpApi.Host/Data/nwind.json b/api/src/Erp.Platform.HttpApi.Host/Data/nwind.json deleted file mode 100644 index 49aa018c..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/Data/nwind.json +++ /dev/null @@ -1,1005 +0,0 @@ -{ - "Products": [ - { - "ProductID": 1, - "ProductName": "Chai", - "SupplierID": 1, - "CategoryID": 1, - "QuantityPerUnit": "10 boxes x 20 bags", - "UnitPrice": 18, - "UnitsInStock": 39, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900001" - }, - { - "ProductID": 2, - "ProductName": "Chang", - "SupplierID": 1, - "CategoryID": 1, - "QuantityPerUnit": "24 - 12 oz bottles", - "UnitPrice": 19, - "UnitsInStock": 17, - "UnitsOnOrder": 40, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900002" - }, - { - "ProductID": 3, - "ProductName": "Aniseed Syrup", - "SupplierID": 1, - "CategoryID": 2, - "QuantityPerUnit": "12 - 550 ml bottles", - "UnitPrice": 10, - "UnitsInStock": 13, - "UnitsOnOrder": 70, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900003" - }, - { - "ProductID": 4, - "ProductName": "Chef Anton's Cajun Seasoning", - "SupplierID": 2, - "CategoryID": 2, - "QuantityPerUnit": "48 - 6 oz jars", - "UnitPrice": 22, - "UnitsInStock": 53, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900004" - }, - { - "ProductID": 5, - "ProductName": "Chef Anton's Gumbo Mix", - "SupplierID": 2, - "CategoryID": 2, - "QuantityPerUnit": "36 boxes", - "UnitPrice": 21.35, - "UnitsInStock": 0, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900005" - }, - { - "ProductID": 6, - "ProductName": "Grandma's Boysenberry Spread", - "SupplierID": 3, - "CategoryID": 2, - "QuantityPerUnit": "12 - 8 oz jars", - "UnitPrice": 25, - "UnitsInStock": 120, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900006" - }, - { - "ProductID": 7, - "ProductName": "Uncle Bob's Organic Dried Pears", - "SupplierID": 3, - "CategoryID": 7, - "QuantityPerUnit": "12 - 1 lb pkgs.", - "UnitPrice": 30, - "UnitsInStock": 15, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900007" - }, - { - "ProductID": 8, - "ProductName": "Northwoods Cranberry Sauce", - "SupplierID": 3, - "CategoryID": 2, - "QuantityPerUnit": "12 - 12 oz jars", - "UnitPrice": 40, - "UnitsInStock": 6, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900008" - }, - { - "ProductID": 9, - "ProductName": "Mishi Kobe Niku", - "SupplierID": 4, - "CategoryID": 6, - "QuantityPerUnit": "18 - 500 g pkgs.", - "UnitPrice": 97, - "UnitsInStock": 29, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900009" - }, - { - "ProductID": 10, - "ProductName": "Ikura", - "SupplierID": 4, - "CategoryID": 8, - "QuantityPerUnit": "12 - 200 ml jars", - "UnitPrice": 31, - "UnitsInStock": 31, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900010" - }, - { - "ProductID": 11, - "ProductName": "Queso Cabrales", - "SupplierID": 5, - "CategoryID": 4, - "QuantityPerUnit": "1 kg pkg.", - "UnitPrice": 21, - "UnitsInStock": 22, - "UnitsOnOrder": 30, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900011" - }, - { - "ProductID": 12, - "ProductName": "Queso Manchego La Pastora", - "SupplierID": 5, - "CategoryID": 4, - "QuantityPerUnit": "10 - 500 g pkgs.", - "UnitPrice": 38, - "UnitsInStock": 86, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900012" - }, - { - "ProductID": 13, - "ProductName": "Konbu", - "SupplierID": 6, - "CategoryID": 8, - "QuantityPerUnit": "2 kg box", - "UnitPrice": 6, - "UnitsInStock": 24, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900013" - }, - { - "ProductID": 14, - "ProductName": "Tofu", - "SupplierID": 6, - "CategoryID": 7, - "QuantityPerUnit": "40 - 100 g pkgs.", - "UnitPrice": 23.25, - "UnitsInStock": 35, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900014" - }, - { - "ProductID": 15, - "ProductName": "Genen Shouyu", - "SupplierID": 6, - "CategoryID": 2, - "QuantityPerUnit": "24 - 250 ml bottles", - "UnitPrice": 15.5, - "UnitsInStock": 39, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900015" - }, - { - "ProductID": 16, - "ProductName": "Pavlova", - "SupplierID": 7, - "CategoryID": 3, - "QuantityPerUnit": "32 - 500 g boxes", - "UnitPrice": 17.45, - "UnitsInStock": 29, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900016" - }, - { - "ProductID": 17, - "ProductName": "Alice Mutton", - "SupplierID": 7, - "CategoryID": 6, - "QuantityPerUnit": "20 - 1 kg tins", - "UnitPrice": 39, - "UnitsInStock": 0, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900017" - }, - { - "ProductID": 18, - "ProductName": "Carnarvon Tigers", - "SupplierID": 7, - "CategoryID": 8, - "QuantityPerUnit": "16 kg pkg.", - "UnitPrice": 62.5, - "UnitsInStock": 42, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900018" - }, - { - "ProductID": 19, - "ProductName": "Teatime Chocolate Biscuits", - "SupplierID": 8, - "CategoryID": 3, - "QuantityPerUnit": "10 boxes x 12 pieces", - "UnitPrice": 9.2, - "UnitsInStock": 25, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900019" - }, - { - "ProductID": 20, - "ProductName": "Sir Rodney's Marmalade", - "SupplierID": 8, - "CategoryID": 3, - "QuantityPerUnit": "30 gift boxes", - "UnitPrice": 81, - "UnitsInStock": 40, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900020" - }, - { - "ProductID": 21, - "ProductName": "Sir Rodney's Scones", - "SupplierID": 8, - "CategoryID": 3, - "QuantityPerUnit": "24 pkgs. x 4 pieces", - "UnitPrice": 10, - "UnitsInStock": 3, - "UnitsOnOrder": 40, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900021" - }, - { - "ProductID": 22, - "ProductName": "Gustaf's Knäckebröd", - "SupplierID": 9, - "CategoryID": 5, - "QuantityPerUnit": "24 - 500 g pkgs.", - "UnitPrice": 21, - "UnitsInStock": 104, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900022" - }, - { - "ProductID": 23, - "ProductName": "Tunnbröd", - "SupplierID": 9, - "CategoryID": 5, - "QuantityPerUnit": "12 - 250 g pkgs.", - "UnitPrice": 9, - "UnitsInStock": 61, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900023" - }, - { - "ProductID": 24, - "ProductName": "Guaraná Fantástica", - "SupplierID": 10, - "CategoryID": 1, - "QuantityPerUnit": "12 - 355 ml cans", - "UnitPrice": 4.5, - "UnitsInStock": 20, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900024" - }, - { - "ProductID": 25, - "ProductName": "NuNuCa Nuß-Nougat-Creme", - "SupplierID": 11, - "CategoryID": 3, - "QuantityPerUnit": "20 - 450 g glasses", - "UnitPrice": 14, - "UnitsInStock": 76, - "UnitsOnOrder": 0, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900025" - }, - { - "ProductID": 26, - "ProductName": "Gumbär Gummibärchen", - "SupplierID": 11, - "CategoryID": 3, - "QuantityPerUnit": "100 - 250 g bags", - "UnitPrice": 31.23, - "UnitsInStock": 15, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900026" - }, - { - "ProductID": 27, - "ProductName": "Schoggi Schokolade", - "SupplierID": 11, - "CategoryID": 3, - "QuantityPerUnit": "100 - 100 g pieces", - "UnitPrice": 43.9, - "UnitsInStock": 49, - "UnitsOnOrder": 0, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900027" - }, - { - "ProductID": 28, - "ProductName": "Rössle Sauerkraut", - "SupplierID": 12, - "CategoryID": 7, - "QuantityPerUnit": "25 - 825 g cans", - "UnitPrice": 45.6, - "UnitsInStock": 26, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900028" - }, - { - "ProductID": 29, - "ProductName": "Thüringer Rostbratwurst", - "SupplierID": 12, - "CategoryID": 6, - "QuantityPerUnit": "50 bags x 30 sausgs.", - "UnitPrice": 123.79, - "UnitsInStock": 0, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900029" - }, - { - "ProductID": 30, - "ProductName": "Nord-Ost Matjeshering", - "SupplierID": 13, - "CategoryID": 8, - "QuantityPerUnit": "10 - 200 g glasses", - "UnitPrice": 25.89, - "UnitsInStock": 10, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900030" - }, - { - "ProductID": 31, - "ProductName": "Gorgonzola Telino", - "SupplierID": 14, - "CategoryID": 4, - "QuantityPerUnit": "12 - 100 g pkgs", - "UnitPrice": 12.5, - "UnitsInStock": 0, - "UnitsOnOrder": 70, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900031" - }, - { - "ProductID": 32, - "ProductName": "Mascarpone Fabioli", - "SupplierID": 14, - "CategoryID": 4, - "QuantityPerUnit": "24 - 200 g pkgs.", - "UnitPrice": 32, - "UnitsInStock": 9, - "UnitsOnOrder": 40, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900032" - }, - { - "ProductID": 33, - "ProductName": "Geitost", - "SupplierID": 15, - "CategoryID": 4, - "QuantityPerUnit": "500 g", - "UnitPrice": 2.5, - "UnitsInStock": 112, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900033" - }, - { - "ProductID": 34, - "ProductName": "Sasquatch Ale", - "SupplierID": 16, - "CategoryID": 1, - "QuantityPerUnit": "24 - 12 oz bottles", - "UnitPrice": 14, - "UnitsInStock": 111, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900034" - }, - { - "ProductID": 35, - "ProductName": "Steeleye Stout", - "SupplierID": 16, - "CategoryID": 1, - "QuantityPerUnit": "24 - 12 oz bottles", - "UnitPrice": 18, - "UnitsInStock": 20, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900035" - }, - { - "ProductID": 36, - "ProductName": "Inlagd Sill", - "SupplierID": 17, - "CategoryID": 8, - "QuantityPerUnit": "24 - 250 g jars", - "UnitPrice": 19, - "UnitsInStock": 112, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900036" - }, - { - "ProductID": 37, - "ProductName": "Gravad lax", - "SupplierID": 17, - "CategoryID": 8, - "QuantityPerUnit": "12 - 500 g pkgs.", - "UnitPrice": 26, - "UnitsInStock": 11, - "UnitsOnOrder": 50, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900037" - }, - { - "ProductID": 38, - "ProductName": "Côte de Blaye", - "SupplierID": 18, - "CategoryID": 1, - "QuantityPerUnit": "12 - 75 cl bottles", - "UnitPrice": 263.5, - "UnitsInStock": 17, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900038" - }, - { - "ProductID": 39, - "ProductName": "Chartreuse verte", - "SupplierID": 18, - "CategoryID": 1, - "QuantityPerUnit": "750 cc per bottle", - "UnitPrice": 18, - "UnitsInStock": 69, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900039" - }, - { - "ProductID": 40, - "ProductName": "Boston Crab Meat", - "SupplierID": 19, - "CategoryID": 8, - "QuantityPerUnit": "24 - 4 oz tins", - "UnitPrice": 18.4, - "UnitsInStock": 123, - "UnitsOnOrder": 0, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900040" - }, - { - "ProductID": 41, - "ProductName": "Jack's New England Clam Chowder", - "SupplierID": 19, - "CategoryID": 8, - "QuantityPerUnit": "12 - 12 oz cans", - "UnitPrice": 9.65, - "UnitsInStock": 85, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900041" - }, - { - "ProductID": 42, - "ProductName": "Singaporean Hokkien Fried Mee", - "SupplierID": 20, - "CategoryID": 5, - "QuantityPerUnit": "32 - 1 kg pkgs.", - "UnitPrice": 14, - "UnitsInStock": 26, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900042" - }, - { - "ProductID": 43, - "ProductName": "Ipoh Coffee", - "SupplierID": 20, - "CategoryID": 1, - "QuantityPerUnit": "16 - 500 g tins", - "UnitPrice": 46, - "UnitsInStock": 17, - "UnitsOnOrder": 10, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900043" - }, - { - "ProductID": 44, - "ProductName": "Gula Malacca", - "SupplierID": 20, - "CategoryID": 2, - "QuantityPerUnit": "20 - 2 kg bags", - "UnitPrice": 19.45, - "UnitsInStock": 27, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900044" - }, - { - "ProductID": 45, - "ProductName": "Rogede sild", - "SupplierID": 21, - "CategoryID": 8, - "QuantityPerUnit": "1k pkg.", - "UnitPrice": 9.5, - "UnitsInStock": 5, - "UnitsOnOrder": 70, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900045" - }, - { - "ProductID": 46, - "ProductName": "Spegesild", - "SupplierID": 21, - "CategoryID": 8, - "QuantityPerUnit": "4 - 450 g glasses", - "UnitPrice": 12, - "UnitsInStock": 95, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900046" - }, - { - "ProductID": 47, - "ProductName": "Zaanse koeken", - "SupplierID": 22, - "CategoryID": 3, - "QuantityPerUnit": "10 - 4 oz boxes", - "UnitPrice": 9.5, - "UnitsInStock": 36, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900047" - }, - { - "ProductID": 48, - "ProductName": "Chocolade", - "SupplierID": 22, - "CategoryID": 3, - "QuantityPerUnit": "10 pkgs.", - "UnitPrice": 12.75, - "UnitsInStock": 15, - "UnitsOnOrder": 70, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900048" - }, - { - "ProductID": 49, - "ProductName": "Maxilaku", - "SupplierID": 23, - "CategoryID": 3, - "QuantityPerUnit": "24 - 50 g pkgs.", - "UnitPrice": 20, - "UnitsInStock": 10, - "UnitsOnOrder": 60, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900049" - }, - { - "ProductID": 50, - "ProductName": "Valkoinen suklaa", - "SupplierID": 23, - "CategoryID": 3, - "QuantityPerUnit": "12 - 100 g bars", - "UnitPrice": 16.25, - "UnitsInStock": 65, - "UnitsOnOrder": 0, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900050" - }, - { - "ProductID": 51, - "ProductName": "Manjimup Dried Apples", - "SupplierID": 24, - "CategoryID": 7, - "QuantityPerUnit": "50 - 300 g pkgs.", - "UnitPrice": 53, - "UnitsInStock": 20, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900051" - }, - { - "ProductID": 52, - "ProductName": "Filo Mix", - "SupplierID": 24, - "CategoryID": 5, - "QuantityPerUnit": "16 - 2 kg boxes", - "UnitPrice": 7, - "UnitsInStock": 38, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900052" - }, - { - "ProductID": 53, - "ProductName": "Perth Pasties", - "SupplierID": 24, - "CategoryID": 6, - "QuantityPerUnit": "48 pieces", - "UnitPrice": 32.8, - "UnitsInStock": 0, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 1, - "EAN13": "070684900053" - }, - { - "ProductID": 54, - "ProductName": "Tourtière", - "SupplierID": 25, - "CategoryID": 6, - "QuantityPerUnit": "16 pies", - "UnitPrice": 7.45, - "UnitsInStock": 21, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900054" - }, - { - "ProductID": 55, - "ProductName": "Pâté chinois", - "SupplierID": 25, - "CategoryID": 6, - "QuantityPerUnit": "24 boxes x 2 pies", - "UnitPrice": 24, - "UnitsInStock": 115, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900055" - }, - { - "ProductID": 56, - "ProductName": "Gnocchi di nonna Alice", - "SupplierID": 26, - "CategoryID": 5, - "QuantityPerUnit": "24 - 250 g pkgs.", - "UnitPrice": 38, - "UnitsInStock": 21, - "UnitsOnOrder": 10, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900056" - }, - { - "ProductID": 57, - "ProductName": "Ravioli Angelo", - "SupplierID": 26, - "CategoryID": 5, - "QuantityPerUnit": "24 - 250 g pkgs.", - "UnitPrice": 19.5, - "UnitsInStock": 36, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900057" - }, - { - "ProductID": 58, - "ProductName": "Escargots de Bourgogne", - "SupplierID": 27, - "CategoryID": 8, - "QuantityPerUnit": "24 pieces", - "UnitPrice": 13.25, - "UnitsInStock": 62, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900058" - }, - { - "ProductID": 59, - "ProductName": "Raclette Courdavault", - "SupplierID": 28, - "CategoryID": 4, - "QuantityPerUnit": "5 kg pkg.", - "UnitPrice": 55, - "UnitsInStock": 79, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900059" - }, - { - "ProductID": 60, - "ProductName": "Camembert Pierrot", - "SupplierID": 28, - "CategoryID": 4, - "QuantityPerUnit": "15 - 300 g rounds", - "UnitPrice": 34, - "UnitsInStock": 19, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900060" - }, - { - "ProductID": 61, - "ProductName": "Sirop d'érable", - "SupplierID": 29, - "CategoryID": 2, - "QuantityPerUnit": "24 - 500 ml bottles", - "UnitPrice": 28.5, - "UnitsInStock": 113, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900061" - }, - { - "ProductID": 62, - "ProductName": "Tarte au sucre", - "SupplierID": 29, - "CategoryID": 3, - "QuantityPerUnit": "48 pies", - "UnitPrice": 49.3, - "UnitsInStock": 17, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900062" - }, - { - "ProductID": 63, - "ProductName": "Vegie-spread", - "SupplierID": 7, - "CategoryID": 2, - "QuantityPerUnit": "15 - 625 g jars", - "UnitPrice": 43.9, - "UnitsInStock": 24, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900063" - }, - { - "ProductID": 64, - "ProductName": "Wimmers gute Semmelknödel", - "SupplierID": 12, - "CategoryID": 5, - "QuantityPerUnit": "20 bags x 4 pieces", - "UnitPrice": 33.25, - "UnitsInStock": 22, - "UnitsOnOrder": 80, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900064" - }, - { - "ProductID": 65, - "ProductName": "Louisiana Fiery Hot Pepper Sauce", - "SupplierID": 2, - "CategoryID": 2, - "QuantityPerUnit": "32 - 8 oz bottles", - "UnitPrice": 21.05, - "UnitsInStock": 76, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900065" - }, - { - "ProductID": 66, - "ProductName": "Louisiana Hot Spiced Okra", - "SupplierID": 2, - "CategoryID": 2, - "QuantityPerUnit": "24 - 8 oz jars", - "UnitPrice": 17, - "UnitsInStock": 4, - "UnitsOnOrder": 100, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900066" - }, - { - "ProductID": 67, - "ProductName": "Laughing Lumberjack Lager", - "SupplierID": 16, - "CategoryID": 1, - "QuantityPerUnit": "24 - 12 oz bottles", - "UnitPrice": 14, - "UnitsInStock": 52, - "UnitsOnOrder": 0, - "ReorderLevel": 10, - "Discontinued": 0, - "EAN13": "070684900067" - }, - { - "ProductID": 68, - "ProductName": "Scottish Longbreads", - "SupplierID": 8, - "CategoryID": 3, - "QuantityPerUnit": "10 boxes x 8 pieces", - "UnitPrice": 12.5, - "UnitsInStock": 6, - "UnitsOnOrder": 10, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900068" - }, - { - "ProductID": 69, - "ProductName": "Gudbrandsdalsost", - "SupplierID": 15, - "CategoryID": 4, - "QuantityPerUnit": "10 kg pkg.", - "UnitPrice": 36, - "UnitsInStock": 26, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900069" - }, - { - "ProductID": 70, - "ProductName": "Outback Lager", - "SupplierID": 7, - "CategoryID": 1, - "QuantityPerUnit": "24 - 355 ml bottles", - "UnitPrice": 15, - "UnitsInStock": 15, - "UnitsOnOrder": 10, - "ReorderLevel": 30, - "Discontinued": 0, - "EAN13": "070684900070" - }, - { - "ProductID": 71, - "ProductName": "Flotemysost", - "SupplierID": 15, - "CategoryID": 4, - "QuantityPerUnit": "10 - 500 g pkgs.", - "UnitPrice": 21.5, - "UnitsInStock": 26, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900071" - }, - { - "ProductID": 72, - "ProductName": "Mozzarella di Giovanni", - "SupplierID": 14, - "CategoryID": 4, - "QuantityPerUnit": "24 - 200 g pkgs.", - "UnitPrice": 34.8, - "UnitsInStock": 14, - "UnitsOnOrder": 0, - "ReorderLevel": 0, - "Discontinued": 0, - "EAN13": "070684900072" - }, - { - "ProductID": 73, - "ProductName": "Röd Kaviar", - "SupplierID": 17, - "CategoryID": 8, - "QuantityPerUnit": "24 - 150 g jars", - "UnitPrice": 15, - "UnitsInStock": 101, - "UnitsOnOrder": 0, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900073" - }, - { - "ProductID": 74, - "ProductName": "Longlife Tofu", - "SupplierID": 4, - "CategoryID": 7, - "QuantityPerUnit": "5 kg pkg.", - "UnitPrice": 10, - "UnitsInStock": 4, - "UnitsOnOrder": 20, - "ReorderLevel": 5, - "Discontinued": 0, - "EAN13": "070684900074" - }, - { - "ProductID": 75, - "ProductName": "Rhönbräu Klosterbier", - "SupplierID": 12, - "CategoryID": 1, - "QuantityPerUnit": "24 - 0.5 l bottles", - "UnitPrice": 7.75, - "UnitsInStock": 125, - "UnitsOnOrder": 0, - "ReorderLevel": 25, - "Discontinued": 0, - "EAN13": "070684900075" - }, - { - "ProductID": 76, - "ProductName": "Lakkalikööri", - "SupplierID": 23, - "CategoryID": 1, - "QuantityPerUnit": "500 ml", - "UnitPrice": 18, - "UnitsInStock": 57, - "UnitsOnOrder": 0, - "ReorderLevel": 20, - "Discontinued": 0, - "EAN13": "070684900076" - }, - { - "ProductID": 77, - "ProductName": "Original Frankfurter grüne Soße", - "SupplierID": 12, - "CategoryID": 2, - "QuantityPerUnit": "12 boxes", - "UnitPrice": 13, - "UnitsInStock": 32, - "UnitsOnOrder": 0, - "ReorderLevel": 15, - "Discontinued": 0, - "EAN13": "070684900077" - } - ] -} diff --git a/api/src/Erp.Platform.HttpApi.Host/Data/reportsData.db b/api/src/Erp.Platform.HttpApi.Host/Data/reportsData.db deleted file mode 100644 index 7a11360f..00000000 Binary files a/api/src/Erp.Platform.HttpApi.Host/Data/reportsData.db and /dev/null differ diff --git a/api/src/Erp.Platform.HttpApi.Host/Erp.Platform.HttpApi.Host.csproj b/api/src/Erp.Platform.HttpApi.Host/Erp.Platform.HttpApi.Host.csproj index 8fe09174..7c15982e 100644 --- a/api/src/Erp.Platform.HttpApi.Host/Erp.Platform.HttpApi.Host.csproj +++ b/api/src/Erp.Platform.HttpApi.Host/Erp.Platform.HttpApi.Host.csproj @@ -44,15 +44,6 @@ - - - PreserveNewest - - - PreserveNewest - - - XtraReport diff --git a/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs b/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs index 3e91cb4c..6543b28b 100644 --- a/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs +++ b/api/src/Erp.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs @@ -411,11 +411,9 @@ public class PlatformHttpApiHostModule : AbpModule // Register report storage extension context.Services.AddScoped(); - // Register custom data connection providers + // Register custom SQL data connection provider context.Services.AddScoped(); - context.Services.AddScoped(); context.Services.AddScoped(); - context.Services.AddScoped(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/api/src/Erp.Platform.HttpApi.Host/PredefinedReports/TestReport.Designer.cs b/api/src/Erp.Platform.HttpApi.Host/PredefinedReports/TestReport.Designer.cs index e9a8fad3..8363faff 100644 --- a/api/src/Erp.Platform.HttpApi.Host/PredefinedReports/TestReport.Designer.cs +++ b/api/src/Erp.Platform.HttpApi.Host/PredefinedReports/TestReport.Designer.cs @@ -29,17 +29,9 @@ DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery(); DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column(); DevExpress.DataAccess.Sql.ColumnExpression columnExpression1 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Table table4 = new DevExpress.DataAccess.Sql.Table(); + DevExpress.DataAccess.Sql.Table table1 = new DevExpress.DataAccess.Sql.Table(); DevExpress.DataAccess.Sql.Column column2 = new DevExpress.DataAccess.Sql.Column(); DevExpress.DataAccess.Sql.ColumnExpression columnExpression2 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column3 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression3 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column4 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression4 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column5 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression5 = new DevExpress.DataAccess.Sql.ColumnExpression(); - DevExpress.DataAccess.Sql.Column column6 = new DevExpress.DataAccess.Sql.Column(); - DevExpress.DataAccess.Sql.ColumnExpression columnExpression6 = new DevExpress.DataAccess.Sql.ColumnExpression(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestReport)); this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); @@ -47,44 +39,18 @@ this.pageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); this.label1 = new DevExpress.XtraReports.UI.XRLabel(); - this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.table1 = new DevExpress.XtraReports.UI.XRTable(); + this.Detail = new DevExpress.XtraReports.UI.DetailBand(); + this.table2 = new DevExpress.XtraReports.UI.XRTable(); this.tableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); this.tableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); this.tableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); - this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.table2 = new DevExpress.XtraReports.UI.XRTable(); - this.tableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); - this.tableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); - this.Detail = new DevExpress.XtraReports.UI.DetailBand(); - this.table3 = new DevExpress.XtraReports.UI.XRTable(); - this.tableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); - this.tableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); - this.tableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); - this.pictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox(); - this.tableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); - this.pictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox(); - this.tableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); - this.pictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox(); - this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); - this.label2 = new DevExpress.XtraReports.UI.XRLabel(); this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components); this.Title = new DevExpress.XtraReports.UI.XRControlStyle(); - this.GroupCaption1 = new DevExpress.XtraReports.UI.XRControlStyle(); - this.GroupData1 = new DevExpress.XtraReports.UI.XRControlStyle(); this.DetailCaption1 = new DevExpress.XtraReports.UI.XRControlStyle(); this.DetailData1 = new DevExpress.XtraReports.UI.XRControlStyle(); - this.GroupFooterBackground3 = new DevExpress.XtraReports.UI.XRControlStyle(); this.DetailData3_Odd = new DevExpress.XtraReports.UI.XRControlStyle(); this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle(); - ((System.ComponentModel.ISupportInitialize)(this.table1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.table2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.table3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // TopMargin @@ -128,26 +94,23 @@ this.label1.Name = "label1"; this.label1.SizeF = new System.Drawing.SizeF(650F, 24.19433F); this.label1.StyleName = "Title"; - this.label1.Text = "Report"; + this.label1.Text = "Sector Report"; // - // GroupHeader1 + // Detail // - this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.table1}); - this.GroupHeader1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] { - new DevExpress.XtraReports.UI.GroupField("CategoryID", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)}); - this.GroupHeader1.GroupUnion = DevExpress.XtraReports.UI.GroupUnion.WithFirstDetail; - this.GroupHeader1.HeightF = 27F; - this.GroupHeader1.Level = 1; - this.GroupHeader1.Name = "GroupHeader1"; + this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.table2}); + this.Detail.HeightF = 25F; + this.Detail.Name = "Detail"; // - // table1 + // table2 // - this.table1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 2F); - this.table1.Name = "table1"; - this.table1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.table2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.table2.Name = "table2"; + this.table2.OddStyleName = "DetailData3_Odd"; + this.table2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.tableRow1}); - this.table1.SizeF = new System.Drawing.SizeF(650F, 25F); + this.table2.SizeF = new System.Drawing.SizeF(650F, 25F); // // tableRow1 // @@ -159,234 +122,39 @@ // // tableCell1 // + this.tableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.tableCell1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { + new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Id]")}); this.tableCell1.Name = "tableCell1"; - this.tableCell1.StyleName = "GroupCaption1"; - this.tableCell1.Text = "CATEGORY ID"; - this.tableCell1.Weight = 1434852.375D; + this.tableCell1.StyleName = "DetailData1"; + this.tableCell1.StylePriority.UseBorders = false; + this.tableCell1.Text = "Id"; + this.tableCell1.Weight = 0.3D; // // tableCell2 // this.tableCell2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[CategoryID]")}); + new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Name]")}); this.tableCell2.Name = "tableCell2"; - this.tableCell2.StyleName = "GroupData1"; - this.tableCell2.Weight = 9214747D; - // - // GroupHeader2 - // - this.GroupHeader2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.table2}); - this.GroupHeader2.GroupUnion = DevExpress.XtraReports.UI.GroupUnion.WithFirstDetail; - this.GroupHeader2.HeightF = 28F; - this.GroupHeader2.Level = 2; - this.GroupHeader2.Name = "GroupHeader2"; - // - // table2 - // - this.table2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.table2.Name = "table2"; - this.table2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.tableRow2}); - this.table2.SizeF = new System.Drawing.SizeF(650F, 28F); - // - // tableRow2 - // - this.tableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.tableCell3, - this.tableCell4, - this.tableCell5, - this.tableCell6, - this.tableCell7}); - this.tableRow2.Name = "tableRow2"; - this.tableRow2.Weight = 1D; - // - // tableCell3 - // - this.tableCell3.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.tableCell3.Name = "tableCell3"; - this.tableCell3.StyleName = "DetailCaption1"; - this.tableCell3.StylePriority.UseBorders = false; - this.tableCell3.Text = "Category Name"; - this.tableCell3.Weight = 0.29834482046274041D; - // - // tableCell4 - // - this.tableCell4.Name = "tableCell4"; - this.tableCell4.StyleName = "DetailCaption1"; - this.tableCell4.Text = "Description"; - this.tableCell4.Weight = 0.2344280066856971D; - // - // tableCell5 - // - this.tableCell5.Name = "tableCell5"; - this.tableCell5.StyleName = "DetailCaption1"; - this.tableCell5.Text = "Picture"; - this.tableCell5.Weight = 0.1609015596829928D; - // - // tableCell6 - // - this.tableCell6.Name = "tableCell6"; - this.tableCell6.StyleName = "DetailCaption1"; - this.tableCell6.Text = "Icon17"; - this.tableCell6.Weight = 0.153162841796875D; - // - // tableCell7 - // - this.tableCell7.Name = "tableCell7"; - this.tableCell7.StyleName = "DetailCaption1"; - this.tableCell7.Text = "Icon25"; - this.tableCell7.Weight = 0.15316274789663462D; - // - // Detail - // - this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.table3}); - this.Detail.HeightF = 25F; - this.Detail.Name = "Detail"; - // - // table3 - // - this.table3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.table3.Name = "table3"; - this.table3.OddStyleName = "DetailData3_Odd"; - this.table3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.tableRow3}); - this.table3.SizeF = new System.Drawing.SizeF(650F, 25F); - // - // tableRow3 - // - this.tableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.tableCell8, - this.tableCell9, - this.tableCell10, - this.tableCell11, - this.tableCell12}); - this.tableRow3.Name = "tableRow3"; - this.tableRow3.Weight = 11.5D; - // - // tableCell8 - // - this.tableCell8.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.tableCell8.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[CategoryName]")}); - this.tableCell8.Name = "tableCell8"; - this.tableCell8.StyleName = "DetailData1"; - this.tableCell8.StylePriority.UseBorders = false; - this.tableCell8.Weight = 0.29834482046274041D; - // - // tableCell9 - // - this.tableCell9.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Description]")}); - this.tableCell9.Name = "tableCell9"; - this.tableCell9.StyleName = "DetailData1"; - this.tableCell9.Weight = 0.2344280066856971D; - // - // tableCell10 - // - this.tableCell10.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.pictureBox1}); - this.tableCell10.Name = "tableCell10"; - this.tableCell10.StyleName = "DetailData1"; - this.tableCell10.Weight = 0.1609015596829928D; - // - // pictureBox1 - // - this.pictureBox1.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right))); - this.pictureBox1.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom))); - this.pictureBox1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Picture]")}); - this.pictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.SizeF = new System.Drawing.SizeF(102.5027F, 25F); - this.pictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; - // - // tableCell11 - // - this.tableCell11.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.pictureBox2}); - this.tableCell11.Name = "tableCell11"; - this.tableCell11.StyleName = "DetailData1"; - this.tableCell11.Weight = 0.153162841796875D; - // - // pictureBox2 - // - this.pictureBox2.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right))); - this.pictureBox2.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom))); - this.pictureBox2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Icon17]")}); - this.pictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.SizeF = new System.Drawing.SizeF(97.47251F, 25F); - this.pictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; - // - // tableCell12 - // - this.tableCell12.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.pictureBox3}); - this.tableCell12.Name = "tableCell12"; - this.tableCell12.StyleName = "DetailData1"; - this.tableCell12.Weight = 0.15316274789663462D; - // - // pictureBox3 - // - this.pictureBox3.AnchorHorizontal = ((DevExpress.XtraReports.UI.HorizontalAnchorStyles)((DevExpress.XtraReports.UI.HorizontalAnchorStyles.Left | DevExpress.XtraReports.UI.HorizontalAnchorStyles.Right))); - this.pictureBox3.AnchorVertical = ((DevExpress.XtraReports.UI.VerticalAnchorStyles)((DevExpress.XtraReports.UI.VerticalAnchorStyles.Top | DevExpress.XtraReports.UI.VerticalAnchorStyles.Bottom))); - this.pictureBox3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "ImageSource", "[Icon25]")}); - this.pictureBox3.LocationFloat = new DevExpress.Utils.PointFloat(2.083333F, 0F); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.SizeF = new System.Drawing.SizeF(97.47245F, 25F); - this.pictureBox3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; - // - // GroupFooter1 - // - this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.label2}); - this.GroupFooter1.GroupUnion = DevExpress.XtraReports.UI.GroupFooterUnion.WithLastDetail; - this.GroupFooter1.HeightF = 6F; - this.GroupFooter1.Name = "GroupFooter1"; - // - // label2 - // - this.label2.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.label2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.label2.Name = "label2"; - this.label2.SizeF = new System.Drawing.SizeF(650F, 2.08F); - this.label2.StyleName = "GroupFooterBackground3"; - this.label2.StylePriority.UseBorders = false; + this.tableCell2.StyleName = "DetailData1"; + this.tableCell2.Text = "Name"; + this.tableCell2.Weight = 0.7D; // // sqlDataSource1 // - this.sqlDataSource1.ConnectionName = "NWindConnectionString"; + this.sqlDataSource1.ConnectionName = "SqlServer"; this.sqlDataSource1.Name = "sqlDataSource1"; - columnExpression1.ColumnName = "CategoryID"; - table4.Name = "Categories"; - columnExpression1.Table = table4; + columnExpression1.ColumnName = "Id"; + table1.Name = "Sas_T_Sector"; + columnExpression1.Table = table1; column1.Expression = columnExpression1; - columnExpression2.ColumnName = "CategoryName"; - columnExpression2.Table = table4; + columnExpression2.ColumnName = "Name"; + columnExpression2.Table = table1; column2.Expression = columnExpression2; - columnExpression3.ColumnName = "Description"; - columnExpression3.Table = table4; - column3.Expression = columnExpression3; - columnExpression4.ColumnName = "Picture"; - columnExpression4.Table = table4; - column4.Expression = columnExpression4; - columnExpression5.ColumnName = "Icon17"; - columnExpression5.Table = table4; - column5.Expression = columnExpression5; - columnExpression6.ColumnName = "Icon25"; - columnExpression6.Table = table4; - column6.Expression = columnExpression6; selectQuery1.Columns.Add(column1); selectQuery1.Columns.Add(column2); - selectQuery1.Columns.Add(column3); - selectQuery1.Columns.Add(column4); - selectQuery1.Columns.Add(column5); - selectQuery1.Columns.Add(column6); - selectQuery1.Name = "Categories"; - selectQuery1.Tables.Add(table4); + selectQuery1.Name = "Sas_T_Sector"; + selectQuery1.Tables.Add(table1); this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] { selectQuery1}); this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable"); @@ -402,30 +170,6 @@ this.Title.Name = "Title"; this.Title.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F); // - // GroupCaption1 - // - this.GroupCaption1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142))))); - this.GroupCaption1.BorderColor = System.Drawing.Color.White; - this.GroupCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.GroupCaption1.BorderWidth = 2F; - this.GroupCaption1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold); - this.GroupCaption1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(228)))), ((int)(((byte)(228))))); - this.GroupCaption1.Name = "GroupCaption1"; - this.GroupCaption1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F); - this.GroupCaption1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // - // GroupData1 - // - this.GroupData1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142))))); - this.GroupData1.BorderColor = System.Drawing.Color.White; - this.GroupData1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.GroupData1.BorderWidth = 2F; - this.GroupData1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold); - this.GroupData1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(70)))), ((int)(((byte)(80))))); - this.GroupData1.Name = "GroupData1"; - this.GroupData1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F); - this.GroupData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // // DetailCaption1 // this.DetailCaption1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(211)))), ((int)(((byte)(142))))); @@ -449,18 +193,6 @@ this.DetailData1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F); this.DetailData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; // - // GroupFooterBackground3 - // - this.GroupFooterBackground3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(117)))), ((int)(((byte)(129))))); - this.GroupFooterBackground3.BorderColor = System.Drawing.Color.White; - this.GroupFooterBackground3.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.GroupFooterBackground3.BorderWidth = 2F; - this.GroupFooterBackground3.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold); - this.GroupFooterBackground3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(228)))), ((int)(((byte)(228))))); - this.GroupFooterBackground3.Name = "GroupFooterBackground3"; - this.GroupFooterBackground3.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100F); - this.GroupFooterBackground3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // // DetailData3_Odd // this.DetailData3_Odd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(245)))), ((int)(((byte)(248))))); @@ -486,28 +218,20 @@ this.TopMargin, this.BottomMargin, this.ReportHeader, - this.GroupHeader1, - this.GroupHeader2, - this.Detail, - this.GroupFooter1}); + this.Detail}); this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { this.sqlDataSource1}); - this.DataMember = "Categories"; + this.DataMember = "Sas_T_Sector"; this.DataSource = this.sqlDataSource1; this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F); this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] { this.Title, - this.GroupCaption1, - this.GroupData1, this.DetailCaption1, this.DetailData1, - this.GroupFooterBackground3, this.DetailData3_Odd, this.PageInfo}); this.Version = "22.2"; - ((System.ComponentModel.ISupportInitialize)(this.table1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.table2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.table3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } @@ -520,39 +244,15 @@ private DevExpress.XtraReports.UI.XRPageInfo pageInfo2; private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader; private DevExpress.XtraReports.UI.XRLabel label1; - private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; - private DevExpress.XtraReports.UI.XRTable table1; + private DevExpress.XtraReports.UI.DetailBand Detail; + private DevExpress.XtraReports.UI.XRTable table2; private DevExpress.XtraReports.UI.XRTableRow tableRow1; private DevExpress.XtraReports.UI.XRTableCell tableCell1; private DevExpress.XtraReports.UI.XRTableCell tableCell2; - private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader2; - private DevExpress.XtraReports.UI.XRTable table2; - private DevExpress.XtraReports.UI.XRTableRow tableRow2; - private DevExpress.XtraReports.UI.XRTableCell tableCell3; - private DevExpress.XtraReports.UI.XRTableCell tableCell4; - private DevExpress.XtraReports.UI.XRTableCell tableCell5; - private DevExpress.XtraReports.UI.XRTableCell tableCell6; - private DevExpress.XtraReports.UI.XRTableCell tableCell7; - private DevExpress.XtraReports.UI.DetailBand Detail; - private DevExpress.XtraReports.UI.XRTable table3; - private DevExpress.XtraReports.UI.XRTableRow tableRow3; - private DevExpress.XtraReports.UI.XRTableCell tableCell8; - private DevExpress.XtraReports.UI.XRTableCell tableCell9; - private DevExpress.XtraReports.UI.XRTableCell tableCell10; - private DevExpress.XtraReports.UI.XRPictureBox pictureBox1; - private DevExpress.XtraReports.UI.XRTableCell tableCell11; - private DevExpress.XtraReports.UI.XRPictureBox pictureBox2; - private DevExpress.XtraReports.UI.XRTableCell tableCell12; - private DevExpress.XtraReports.UI.XRPictureBox pictureBox3; - private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; - private DevExpress.XtraReports.UI.XRLabel label2; private DevExpress.DataAccess.Sql.SqlDataSource sqlDataSource1; private DevExpress.XtraReports.UI.XRControlStyle Title; - private DevExpress.XtraReports.UI.XRControlStyle GroupCaption1; - private DevExpress.XtraReports.UI.XRControlStyle GroupData1; private DevExpress.XtraReports.UI.XRControlStyle DetailCaption1; private DevExpress.XtraReports.UI.XRControlStyle DetailData1; - private DevExpress.XtraReports.UI.XRControlStyle GroupFooterBackground3; private DevExpress.XtraReports.UI.XRControlStyle DetailData3_Odd; private DevExpress.XtraReports.UI.XRControlStyle PageInfo; } diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomDataSourceWizardJsonDataConnectionStorage.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomDataSourceWizardJsonDataConnectionStorage.cs deleted file mode 100644 index 85223fe3..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomDataSourceWizardJsonDataConnectionStorage.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using DevExpress.DataAccess.Json; -using DevExpress.DataAccess.Web; -using DevExpress.DataAccess.Wizard.Services; -using Erp.Reports.HttpApi.Host.Data; - -namespace Erp.Platform.ReportServices; - -public class CustomDataSourceWizardJsonDataConnectionStorage : IDataSourceWizardJsonConnectionStorage -{ - protected LegacyReportDbContext DbContext { get; } - - public CustomDataSourceWizardJsonDataConnectionStorage(LegacyReportDbContext dbContext) - { - DbContext = dbContext; - } - - public List GetConnections() - { - return DbContext.JsonDataConnections.ToList(); - } - - bool IJsonConnectionStorageService.CanSaveConnection { get { return DbContext.JsonDataConnections != null; } } - - bool IJsonConnectionStorageService.ContainsConnection(string connectionName) - { - return GetConnections().Any(x => x.Name == connectionName); - } - - IEnumerable IJsonConnectionStorageService.GetConnections() - { - return GetConnections().Select(x => CreateJsonDataConnectionFromString(x)); - } - - JsonDataConnection IJsonDataConnectionProviderService.GetJsonDataConnection(string name) - { - var connection = GetConnections().FirstOrDefault(x => x.Name == name); - if (connection == null) - throw new InvalidOperationException(); - return CreateJsonDataConnectionFromString(connection); - } - - void IJsonConnectionStorageService.SaveConnection(string connectionName, JsonDataConnection dataConnection, bool saveCredentials) - { - var connections = GetConnections(); - var connectionString = dataConnection.CreateConnectionString(); - foreach (var connection in connections) - { - if (connection.Name == connectionName) - { - connection.ConnectionString = connectionString; - DbContext.SaveChanges(); - return; - } - } - DbContext.JsonDataConnections.Add(new JsonDataConnectionDescription() { Name = connectionName, ConnectionString = connectionString }); - DbContext.SaveChanges(); - } - - public static JsonDataConnection CreateJsonDataConnectionFromString(DataConnection dataConnection) - { - return new JsonDataConnection(dataConnection.ConnectionString) { StoreConnectionNameOnly = true, Name = dataConnection.Name }; - } -} diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomJsonDataConnectionProviderFactory.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomJsonDataConnectionProviderFactory.cs deleted file mode 100644 index ba035e98..00000000 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomJsonDataConnectionProviderFactory.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using DevExpress.DataAccess.Json; -using DevExpress.DataAccess.Web; -using Erp.Reports.HttpApi.Host.Data; - -namespace Erp.Platform.ReportServices; - -public class CustomJsonDataConnectionProviderFactory : IJsonDataConnectionProviderFactory -{ - protected LegacyReportDbContext DbContext { get; } - - public CustomJsonDataConnectionProviderFactory(LegacyReportDbContext dbContext) - { - DbContext = dbContext; - } - - public IJsonDataConnectionProviderService Create() - { - return new WebDocumentViewerJsonDataConnectionProvider(DbContext.JsonDataConnections.ToList()); - } -} - -public class WebDocumentViewerJsonDataConnectionProvider : IJsonDataConnectionProviderService -{ - readonly IEnumerable jsonDataConnections; - - public WebDocumentViewerJsonDataConnectionProvider(IEnumerable jsonDataConnections) - { - this.jsonDataConnections = jsonDataConnections; - } - - public JsonDataConnection GetJsonDataConnection(string name) - { - var connection = jsonDataConnections.FirstOrDefault(x => x.Name == name); - if (connection == null) - throw new InvalidOperationException(); - return CustomDataSourceWizardJsonDataConnectionStorage.CreateJsonDataConnectionFromString(connection); - } -} diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs index 257c5419..d053e8ac 100644 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs +++ b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataConnectionProviderFactory.cs @@ -1,48 +1,47 @@ using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Extensions.Configuration; using DevExpress.DataAccess.ConnectionParameters; using DevExpress.DataAccess.Sql; using DevExpress.DataAccess.Web; +using static Erp.Settings.SettingsConsts; using DevExpress.DataAccess.Wizard.Services; -using Erp.Reports.HttpApi.Host.Data; namespace Erp.Platform.ReportServices; public class CustomSqlDataConnectionProviderFactory : IConnectionProviderFactory { - private readonly LegacyReportDbContext reportDbContext; + private readonly IConfiguration _configuration; - public CustomSqlDataConnectionProviderFactory(LegacyReportDbContext reportDbContext) + public CustomSqlDataConnectionProviderFactory(IConfiguration configuration) { - this.reportDbContext = reportDbContext; + _configuration = configuration; } public IConnectionProviderService Create() { - return new CustomSqlConnectionProviderService(reportDbContext.SqlDataConnections.ToList()); + return new CustomSqlConnectionProviderService(_configuration); } } public class CustomSqlConnectionProviderService : IConnectionProviderService { - readonly IEnumerable sqlDataConnections; + private readonly IConfiguration _configuration; - public CustomSqlConnectionProviderService(IEnumerable sqlDataConnections) + public CustomSqlConnectionProviderService(IConfiguration configuration) { - this.sqlDataConnections = sqlDataConnections; + _configuration = configuration; } public SqlDataConnection LoadConnection(string connectionName) { - var sqlDataConnectionData = sqlDataConnections.FirstOrDefault(x => x.Name == connectionName); - if (sqlDataConnectionData == null) - throw new InvalidOperationException(); - - if (string.IsNullOrEmpty(sqlDataConnectionData.ConnectionString)) - throw new KeyNotFoundException($"Connection string '{connectionName}' not found."); + // appsettings.json'dan SQL Server connection string'ini al + var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider); - var connectionParameters = new CustomStringConnectionParameters(sqlDataConnectionData.ConnectionString); + if (string.IsNullOrEmpty(connectionString)) + throw new InvalidOperationException($"Connection string for '{DefaultDatabaseProvider}' not found in configuration."); + + // SQL Server için CustomStringConnectionParameters kullan + var connectionParameters = new CustomStringConnectionParameters(connectionString); return new SqlDataConnection(connectionName, connectionParameters); } } diff --git a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs index 96a4d39d..2851353b 100644 --- a/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs +++ b/api/src/Erp.Platform.HttpApi.Host/ReportServices/CustomSqlDataSourceWizardConnectionStringsProvider.cs @@ -1,27 +1,37 @@ +using System; using System.Collections.Generic; -using System.Linq; +using Microsoft.Extensions.Configuration; using DevExpress.DataAccess.ConnectionParameters; using DevExpress.DataAccess.Web; -using Erp.Reports.HttpApi.Host.Data; +using static Erp.Settings.SettingsConsts; namespace Erp.Platform.ReportServices; public class CustomSqlDataSourceWizardConnectionStringsProvider : IDataSourceWizardConnectionStringsProvider { - readonly LegacyReportDbContext reportDataContext; + private readonly IConfiguration _configuration; - public CustomSqlDataSourceWizardConnectionStringsProvider(LegacyReportDbContext reportDataContext) + public CustomSqlDataSourceWizardConnectionStringsProvider(IConfiguration configuration) { - this.reportDataContext = reportDataContext; + _configuration = configuration; } Dictionary IDataSourceWizardConnectionStringsProvider.GetConnectionDescriptions() { - return reportDataContext.SqlDataConnections.ToDictionary(x => x.Name, x => x.DisplayName); + // SqlServer adında bir baÄŸlantı tanımla + return new Dictionary + { + { "SqlServer", "SQL Server Database Connection" } + }; } DataConnectionParametersBase IDataSourceWizardConnectionStringsProvider.GetDataConnectionParameters(string name) { - return null; + var connectionString = _configuration.GetConnectionString(DefaultDatabaseProvider); + + if (string.IsNullOrEmpty(connectionString)) + return null; + + return new CustomStringConnectionParameters(connectionString); } }