Skip to content

Commit 2457277

Browse files
author
Natalia Kazakova (DevExpress)
committed
add restricted controller
1 parent 6776d63 commit 2457277

File tree

270 files changed

+56220
-3243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+56220
-3243
lines changed

CS/MvcCustomController.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31129.286
4+
VisualStudioVersion = 16.0.31624.102
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcCustomController", "MvcCustomController\MvcCustomController.csproj", "{9028E14F-B0E5-497B-B92C-635469A8E5B1}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcCustomController", "MvcCustomController\MvcCustomController.csproj", "{08576304-1B2B-4731-BABE-26592EFCB6B5}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{9028E14F-B0E5-497B-B92C-635469A8E5B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{9028E14F-B0E5-497B-B92C-635469A8E5B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{9028E14F-B0E5-497B-B92C-635469A8E5B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{9028E14F-B0E5-497B-B92C-635469A8E5B1}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{08576304-1B2B-4731-BABE-26592EFCB6B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{08576304-1B2B-4731-BABE-26592EFCB6B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{08576304-1B2B-4731-BABE-26592EFCB6B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{08576304-1B2B-4731-BABE-26592EFCB6B5}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {9E4D3DF9-68BF-49AE-854A-8B1C5CA7A6EF}
23+
SolutionGuid = {3E1457D6-743D-4F47-9E7D-827864E92F42}
2424
EndGlobalSection
2525
EndGlobal
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1+
using System.Web.Hosting;
12
using System.Web.Routing;
3+
using DevExpress.DashboardCommon;
24
using DevExpress.DashboardWeb;
35
using DevExpress.DashboardWeb.Mvc;
4-
using DevExpress.DataAccess.Sql;
5-
using System.Web.Hosting;
66
using DevExpress.DataAccess.Excel;
7-
using DevExpress.DashboardCommon;
7+
using DevExpress.DataAccess.Sql;
88

99
namespace MvcCustomController {
10-
public static class DashboardConfig {
10+
public class DashboardConfig {
1111
public static void RegisterService(RouteCollection routes) {
12-
routes.MapDashboardRoute("dashboardControl", "DefaultDashboard", new string[] { "MvcCustomController.Controllers" });
12+
routes.MapDashboardRoute("dashboardControl", "DefaultDashboard");
1313

1414
DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
1515
DashboardConfigurator.Default.SetDashboardStorage(dashboardFileStorage);
1616

1717
// Uncomment this string to allow end users to create new data sources based on predefined connection strings.
1818
//DashboardConfigurator.Default.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());
19-
19+
2020
DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
21-
21+
2222
// Registers an SQL data source.
2323
DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "NWindConnectionString");
2424
SelectQuery query = SelectQueryFluentBuilder
@@ -27,25 +27,14 @@ public static void RegisterService(RouteCollection routes) {
2727
.Build("Sales Person");
2828
sqlDataSource.Queries.Add(query);
2929
dataSourceStorage.RegisterDataSource("sqlDataSource", sqlDataSource.SaveToXml());
30-
31-
// Registers an Object data source.
32-
DashboardObjectDataSource objDataSource = new DashboardObjectDataSource("Object Data Source");
33-
dataSourceStorage.RegisterDataSource("objDataSource", objDataSource.SaveToXml());
34-
30+
3531
// Registers an Excel data source.
3632
DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");
3733
excelDataSource.FileName = HostingEnvironment.MapPath(@"~/App_Data/Sales.xlsx");
3834
excelDataSource.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("Sheet1"));
3935
dataSourceStorage.RegisterDataSource("excelDataSource", excelDataSource.SaveToXml());
40-
41-
DashboardConfigurator.Default.SetDataSourceStorage(dataSourceStorage);
42-
DashboardConfigurator.Default.DataLoading += DataLoading;
43-
}
4436

45-
private static void DataLoading(object sender, DataLoadingWebEventArgs e) {
46-
if(e.DataSourceName == "Object Data Source") {
47-
e.Data = Invoices.CreateData();
48-
}
37+
DashboardConfigurator.Default.SetDataSourceStorage(dataSourceStorage);
4938
}
5039
}
5140
}
-12.6 KB
Binary file not shown.

CS/MvcCustomController/Content/Site.css

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)