From 5652e86e5b1a7288fed348d2e2e5b66943ed4783 Mon Sep 17 00:00:00 2001 From: Polina Tyureva Date: Thu, 17 Jul 2025 19:01:09 +0400 Subject: [PATCH 1/3] update example --- .../App_Start/DashboardConfig.cs | 2 +- ...cs => DataBaseEditableDashboardStorage.cs} | 6 +- CS/MVCDashboardDesigner/Global.asax.cs | 8 +- .../MVCDashboardDesigner.csproj | 206 ++++++++++++++---- CS/MVCDashboardDesigner/Web.config | 128 +++++++---- CS/MVCDashboardDesigner/packages.config | 37 ++++ Readme.md | 4 +- .../App_Start/DashboardConfig.vb | 2 +- ...vb => DataBaseEditableDashboardStorage.vb} | 2 +- VB/MVCDashboardDesigner/Global.asax.vb | 2 +- .../MVCDashboardDesigner.vbproj | 2 +- 11 files changed, 299 insertions(+), 100 deletions(-) rename CS/MVCDashboardDesigner/{DataBaseEditaleDashboardStorage.cs => DataBaseEditableDashboardStorage.cs} (95%) rename VB/MVCDashboardDesigner/{DataBaseEditaleDashboardStorage.vb => DataBaseEditableDashboardStorage.vb} (98%) diff --git a/CS/MVCDashboardDesigner/App_Start/DashboardConfig.cs b/CS/MVCDashboardDesigner/App_Start/DashboardConfig.cs index 1dcf3af..5ee1160 100644 --- a/CS/MVCDashboardDesigner/App_Start/DashboardConfig.cs +++ b/CS/MVCDashboardDesigner/App_Start/DashboardConfig.cs @@ -13,7 +13,7 @@ public class DashboardConfig { public static void RegisterService(RouteCollection routes) { routes.MapDashboardRoute("api/dashboard", "DefaultDashboard"); - var dataBaseDashboardStorage = new DataBaseEditaleDashboardStorage( + var dataBaseDashboardStorage = new DataBaseEditableDashboardStorage( ConfigurationManager.ConnectionStrings["DashboardStorageConnection"].ConnectionString); DashboardConfigurator.Default.SetDashboardStorage(dataBaseDashboardStorage); diff --git a/CS/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.cs b/CS/MVCDashboardDesigner/DataBaseEditableDashboardStorage.cs similarity index 95% rename from CS/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.cs rename to CS/MVCDashboardDesigner/DataBaseEditableDashboardStorage.cs index d5b6548..dc3a5e6 100644 --- a/CS/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.cs +++ b/CS/MVCDashboardDesigner/DataBaseEditableDashboardStorage.cs @@ -2,15 +2,15 @@ using System; using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.IO; using System.Xml.Linq; namespace MVCDashboardDesigner { - public class DataBaseEditaleDashboardStorage : IEditableDashboardStorage { + public class DataBaseEditableDashboardStorage : IEditableDashboardStorage { private string connectionString; - public DataBaseEditaleDashboardStorage(string connectionString) { + public DataBaseEditableDashboardStorage(string connectionString) { this.connectionString = connectionString; } diff --git a/CS/MVCDashboardDesigner/Global.asax.cs b/CS/MVCDashboardDesigner/Global.asax.cs index d7b9412..a86d541 100644 --- a/CS/MVCDashboardDesigner/Global.asax.cs +++ b/CS/MVCDashboardDesigner/Global.asax.cs @@ -1,11 +1,9 @@ +using DevExpress.Utils; +using MVCDashboardDesigner.App_Start; using System; -using System.Configuration; using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; -using DevExpress.DashboardCommon; -using DevExpress.DashboardWeb; -using MVCDashboardDesigner.App_Start; namespace MVCDashboardDesigner { // Note: For instructions on enabling IIS6 or IIS7 classic mode, @@ -13,12 +11,12 @@ namespace MVCDashboardDesigner { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { + DeserializationSettings.RegisterTrustedClass(typeof(SalesPersonData)); DashboardConfig.RegisterService(RouteTable.Routes); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); - ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder(); DevExpress.Web.ASPxWebControl.CallbackError += Application_Error; diff --git a/CS/MVCDashboardDesigner/MVCDashboardDesigner.csproj b/CS/MVCDashboardDesigner/MVCDashboardDesigner.csproj index 709dcc2..fc4fe57 100644 --- a/CS/MVCDashboardDesigner/MVCDashboardDesigner.csproj +++ b/CS/MVCDashboardDesigner/MVCDashboardDesigner.csproj @@ -1,10 +1,11 @@ - + Debug AnyCPU - + + 2.0 {CC272148-F54B-41CF-8F78-5B6A63147F84} {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} @@ -14,7 +15,8 @@ MVCDashboardDesigner v4.7.2 false - + + 4.0 true @@ -25,6 +27,8 @@ + + true @@ -44,6 +48,12 @@ 4 + + ..\packages\Azure.Core.1.38.0\lib\net472\Azure.Core.dll + + + ..\packages\Azure.Identity.1.11.4\lib\netstandard2.0\Azure.Identity.dll + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll True @@ -52,7 +62,58 @@ ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll True + + ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.Bcl.Cryptography.8.0.0\lib\net462\Microsoft.Bcl.Cryptography.dll + + + ..\packages\Microsoft.Data.SqlClient.6.0.2\lib\net462\Microsoft.Data.SqlClient.dll + + + ..\packages\Microsoft.Extensions.Caching.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Caching.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Caching.Memory.8.0.1\lib\net462\Microsoft.Extensions.Caching.Memory.dll + + + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Options.8.0.2\lib\net462\Microsoft.Extensions.Options.dll + + + ..\packages\Microsoft.Extensions.Primitives.8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll + + + ..\packages\Microsoft.Identity.Client.4.61.3\lib\net462\Microsoft.Identity.Client.dll + + + ..\packages\Microsoft.Identity.Client.Extensions.Msal.4.61.3\lib\netstandard2.0\Microsoft.Identity.Client.Extensions.Msal.dll + + + ..\packages\Microsoft.IdentityModel.Abstractions.7.5.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll + + + ..\packages\Microsoft.IdentityModel.JsonWebTokens.7.5.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll + + + ..\packages\Microsoft.IdentityModel.Logging.7.5.0\lib\net472\Microsoft.IdentityModel.Logging.dll + + + ..\packages\Microsoft.IdentityModel.Protocols.7.5.0\lib\net472\Microsoft.IdentityModel.Protocols.dll + + + ..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.7.5.0\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll + + + ..\packages\Microsoft.IdentityModel.Tokens.7.5.0\lib\net472\Microsoft.IdentityModel.Tokens.dll + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll True @@ -62,13 +123,67 @@ True + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.ClientModel.1.0.0\lib\netstandard2.0\System.ClientModel.dll + + + ..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + + ..\packages\System.IdentityModel.Tokens.Jwt.7.5.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll + + + ..\packages\System.IO.FileSystem.AccessControl.5.0.0\lib\net461\System.IO.FileSystem.AccessControl.dll + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + ..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll True + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + + ..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll + + + ..\packages\System.Security.Cryptography.Pkcs.8.0.1\lib\net462\System.Security.Cryptography.Pkcs.dll + + + ..\packages\System.Security.Cryptography.ProtectedData.4.7.0\lib\net461\System.Security.Cryptography.ProtectedData.dll + + + ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + + + ..\packages\System.Text.Encodings.Web.6.0.0\lib\net461\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.6.0.10\lib\net461\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + @@ -107,6 +222,7 @@ ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll True + @@ -116,109 +232,109 @@ - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False - + False @@ -286,7 +402,7 @@ - + Global.asax @@ -326,10 +442,18 @@ http://localhost:50911/ False False - + + False - + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/CS/MVCDashboardDesigner/Web.config b/CS/MVCDashboardDesigner/Web.config index f5f5c4d..9dcdefd 100644 --- a/CS/MVCDashboardDesigner/Web.config +++ b/CS/MVCDashboardDesigner/Web.config @@ -2,15 +2,15 @@ -
-
-
-
+
+
+
+
- - + + @@ -30,38 +30,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,11 +83,11 @@ - - + + - + @@ -95,11 +95,11 @@ - + - - + + @@ -121,6 +121,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CS/MVCDashboardDesigner/packages.config b/CS/MVCDashboardDesigner/packages.config index 582cb68..7ea9d3e 100644 --- a/CS/MVCDashboardDesigner/packages.config +++ b/CS/MVCDashboardDesigner/packages.config @@ -1,5 +1,7 @@  + + @@ -9,6 +11,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Readme.md b/Readme.md index 0ea36c3..fbeb24e 100644 --- a/Readme.md +++ b/Readme.md @@ -9,7 +9,7 @@ This example shows how to create a custom dashboard storage to load and save dashboards in a database. To create custom dashboard storage, implement [IDashboardStorage](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IDashboardStorage?p=netframework) or [IEditableDashboardStorage](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IEditableDashboardStorage). -This example also contains an SQL file ([SavedDashboards.sql](./CS/MVCDashboardDesigner/SavedDashboards.sql)). You can use it to recreate a database on your side. Update the connection string in the **Web.config** file to make it valid in your environment. The example uses the [System.Data.SqlClient](https://msdn.microsoft.com/en-us/library/system.data.sqlclient(v=vs.110).aspx) members to connect and manage an MS SQL server database. +This example also contains an SQL file ([SavedDashboards.sql](./CS/MVCDashboardDesigner/SavedDashboards.sql)). You can use it to recreate a database on your side. Update the connection string in the **Web.config** file to make it valid in your environment. The example uses the [Microsoft.Data.SqlClient](https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlclient?view=sqlclient-dotnet-6.0) members to connect and manage an MS SQL server database. The following API used in the example: @@ -29,7 +29,7 @@ The following API used in the example: ## Files to Review -* [DataBaseEditaleDashboardStorage.cs](./CS/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.cs) (VB: [DataBaseEditaleDashboardStorage.vb](./VB/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.vb)) +* [DataBaseEditableDashboardStorage.cs](./CS/MVCDashboardDesigner/DataBaseEditableDashboardStorage.cs) (VB: [DataBaseEditableDashboardStorage.vb](./VB/MVCDashboardDesigner/DataBaseEditableDashboardStorage.vb)) * [Global.asax.cs](./CS/MVCDashboardDesigner/Global.asax.cs) (VB: [Global.asax.vb](./VB/MVCDashboardDesigner/Global.asax.vb)) ## Documentation diff --git a/VB/MVCDashboardDesigner/App_Start/DashboardConfig.vb b/VB/MVCDashboardDesigner/App_Start/DashboardConfig.vb index 3713cf3..7f30401 100644 --- a/VB/MVCDashboardDesigner/App_Start/DashboardConfig.vb +++ b/VB/MVCDashboardDesigner/App_Start/DashboardConfig.vb @@ -9,7 +9,7 @@ Public Class DashboardConfig Public Shared Sub RegisterService(ByVal routes As RouteCollection) routes.MapDashboardRoute("api/dashboard", "DefaultDashboard") - Dim dataBaseDashboardStorage = New DataBaseEditaleDashboardStorage(ConfigurationManager.ConnectionStrings("DashboardStorageConnection").ConnectionString) + Dim dataBaseDashboardStorage = New DataBaseEditableDashboardStorage(ConfigurationManager.ConnectionStrings("DashboardStorageConnection").ConnectionString) DashboardConfigurator.Default.SetDashboardStorage(dataBaseDashboardStorage) diff --git a/VB/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.vb b/VB/MVCDashboardDesigner/DataBaseEditableDashboardStorage.vb similarity index 98% rename from VB/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.vb rename to VB/MVCDashboardDesigner/DataBaseEditableDashboardStorage.vb index d37489f..0370a13 100644 --- a/VB/MVCDashboardDesigner/DataBaseEditaleDashboardStorage.vb +++ b/VB/MVCDashboardDesigner/DataBaseEditableDashboardStorage.vb @@ -7,7 +7,7 @@ Imports System.IO Imports System.Xml.Linq Namespace MVCDashboardDesigner - Public Class DataBaseEditaleDashboardStorage + Public Class DataBaseEditableDashboardStorage Implements IEditableDashboardStorage Private connectionString As String diff --git a/VB/MVCDashboardDesigner/Global.asax.vb b/VB/MVCDashboardDesigner/Global.asax.vb index 1834643..207b7a3 100644 --- a/VB/MVCDashboardDesigner/Global.asax.vb +++ b/VB/MVCDashboardDesigner/Global.asax.vb @@ -24,7 +24,7 @@ Namespace MVCDashboardDesigner AddHandler DevExpress.Web.ASPxWebControl.CallbackError, AddressOf Application_Error - Dim dataBaseDashboardStorage = New DataBaseEditaleDashboardStorage(ConfigurationManager.ConnectionStrings("DashboardStorageConnection").ConnectionString) + Dim dataBaseDashboardStorage = New DataBaseEditableDashboardStorage(ConfigurationManager.ConnectionStrings("DashboardStorageConnection").ConnectionString) DashboardConfigurator.Default.SetDashboardStorage(dataBaseDashboardStorage) diff --git a/VB/MVCDashboardDesigner/MVCDashboardDesigner.vbproj b/VB/MVCDashboardDesigner/MVCDashboardDesigner.vbproj index 3006e35..e21ae45 100644 --- a/VB/MVCDashboardDesigner/MVCDashboardDesigner.vbproj +++ b/VB/MVCDashboardDesigner/MVCDashboardDesigner.vbproj @@ -293,7 +293,7 @@ - + Global.asax From d55ab447a4dd93b03a3f8a25f9143c5829424e4e Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Thu, 17 Jul 2025 18:06:24 +0300 Subject: [PATCH 2/3] Created a new file CODEOWNERS [skip ci] --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a88e69e --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @DevExpressExampleBot \ No newline at end of file From a808a37786415b88a37fd02c3018b1a9192381e5 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Thu, 17 Jul 2025 19:06:29 +0400 Subject: [PATCH 3/3] README auto update [skip ci] --- Readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Readme.md b/Readme.md index fbeb24e..f6f29df 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,4 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128579375/24.2.1%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T400693) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) [![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)