Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CS/MVCDashboardDesigner/App_Start/DashboardConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 2 additions & 6 deletions CS/MVCDashboardDesigner/Global.asax.cs
Original file line number Diff line number Diff line change
@@ -1,12 +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 DevExpress.Utils;
using MVCDashboardDesigner.App_Start;

namespace MVCDashboardDesigner {
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
Expand All @@ -20,7 +17,6 @@ protected void Application_Start() {
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;
Expand Down
206 changes: 165 additions & 41 deletions CS/MVCDashboardDesigner/MVCDashboardDesigner.csproj

Large diffs are not rendered by default.

128 changes: 84 additions & 44 deletions CS/MVCDashboardDesigner/Web.config

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions CS/MVCDashboardDesigner/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Azure.Core" version="1.38.0" targetFramework="net472" />
<package id="Azure.Identity" version="1.11.4" targetFramework="net472" />
<package id="EntityFramework" version="6.1.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
Expand All @@ -9,6 +11,41 @@
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebPages.Data" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
<package id="Microsoft.Bcl.Cryptography" version="8.0.0" targetFramework="net472" />
<package id="Microsoft.Data.SqlClient" version="6.0.2" targetFramework="net472" />
<package id="Microsoft.Data.SqlClient.SNI" version="6.0.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="8.0.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Caching.Memory" version="8.0.1" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Options" version="8.0.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Primitives" version="8.0.0" targetFramework="net472" />
<package id="Microsoft.Identity.Client" version="4.61.3" targetFramework="net472" />
<package id="Microsoft.Identity.Client.Extensions.Msal" version="4.61.3" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Abstractions" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Logging" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Protocols" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Tokens" version="7.5.0" targetFramework="net472" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.ClientModel" version="1.0.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net472" />
<package id="System.IdentityModel.Tokens.Jwt" version="7.5.0" targetFramework="net472" />
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
<package id="System.Memory.Data" version="1.0.2" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Pkcs" version="8.0.1" targetFramework="net472" />
<package id="System.Security.Cryptography.ProtectedData" version="4.7.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
<package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="net472" />
<package id="System.Text.Json" version="6.0.10" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VB/MVCDashboardDesigner/App_Start/DashboardConfig.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VB/MVCDashboardDesigner/Global.asax.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion VB/MVCDashboardDesigner/MVCDashboardDesigner.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
<Compile Include="App_Start\WebApiConfig.vb" />
<Compile Include="Controllers\DefaultDashboardController.vb" />
<Compile Include="Controllers\HomeController.vb" />
<Compile Include="DataBaseEditaleDashboardStorage.vb" />
<Compile Include="DataBaseEditableDashboardStorage.vb" />
<Compile Include="Global.asax.vb">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
Expand Down