1
1
using AdminLTEWithASPNETCore . Attributes ;
2
2
using AdminLTEWithASPNETCore . Models ;
3
+ using AdminLTEWithASPNETCore . Models . Controllers ;
3
4
using Microsoft . AspNetCore . Authorization ;
4
5
using Microsoft . AspNetCore . Mvc ;
5
6
using Microsoft . Extensions . Logging ;
@@ -19,7 +20,123 @@ public HomeController(ILogger<HomeController> logger)
19
20
20
21
public IActionResult Index ( )
21
22
{
22
- return View ( ) ;
23
+ HomeModel model = new HomeModel ( ) ;
24
+ model . Card = new Models . Components . Cards . CardModel ( )
25
+ {
26
+ Body = "This is an example of card" ,
27
+ Links = new System . Collections . Generic . List < Models . Components . LinkModel > ( )
28
+ {
29
+ new Models . Components . LinkModel ( ) {
30
+ Target = "_blank" ,
31
+ Text = "PureSourceCode" ,
32
+ Url = "https://www.puresourcecode.com"
33
+ } ,
34
+ new Models . Components . LinkModel ( ) {
35
+ Target = "" ,
36
+ Text = "Click here" ,
37
+ Url = "#"
38
+ }
39
+ } ,
40
+ Title = "Card test"
41
+ } ;
42
+ model . VisitorChart = new Models . Components . Charts . ChartModel ( )
43
+ {
44
+ ChartId = "visitor-chart" ,
45
+ Height = 250 ,
46
+ Labels = { "18th" , "20th" , "22nd" , "24th" , "26th" , "28th" , "30th" } ,
47
+ ShowLegend = true ,
48
+ Datasets = new System . Collections . Generic . List < Models . Components . Charts . Dataset > ( )
49
+ {
50
+ new Models . Components . Charts . Dataset ( )
51
+ {
52
+ BackgroundColors = new System . Collections . Generic . List < string > ( ) { "transparent" } ,
53
+ BorderColor = "#007bff" ,
54
+ Label = "This week" ,
55
+ PointBackgroundColor = "#007bff" ,
56
+ PointBorderColor = "#007bff" ,
57
+ Fill = false ,
58
+ Data = new System . Collections . Generic . List < decimal > ( ) {
59
+ 100 , 120 , 170 , 167 , 180 , 177 , 160
60
+ }
61
+ } ,
62
+ new Models . Components . Charts . Dataset ( )
63
+ {
64
+ BackgroundColors = new System . Collections . Generic . List < string > ( ) { "transparent" } ,
65
+ BorderColor = "#ced4da" ,
66
+ Label = "Last week" ,
67
+ PointBackgroundColor = "#ced4da" ,
68
+ PointBorderColor = "#ced4da" ,
69
+ Fill = false ,
70
+ Data = new System . Collections . Generic . List < decimal > ( ) {
71
+ 60 , 80 , 70 , 67 , 80 , 77 , 100
72
+ }
73
+ }
74
+ }
75
+ } ;
76
+ model . SalesChart = new Models . Components . Charts . ChartModel ( )
77
+ {
78
+ ChartId = "salesChart" ,
79
+ Height = 250 ,
80
+ Labels = { "JUN" , "JUL" , "AUG" , "SEP" , "OCT" , "NOV" , "DEC" } ,
81
+ ShowLegend = true ,
82
+ XAxes = new Models . Components . Charts . Axes ( )
83
+ {
84
+ ShowAxes = true ,
85
+ ShowGridLines = true
86
+ } ,
87
+ YAxes = new Models . Components . Charts . Axes ( )
88
+ {
89
+ ShowAxes = true ,
90
+ ShowGridLines = true
91
+ } ,
92
+ Datasets = new System . Collections . Generic . List < Models . Components . Charts . Dataset > ( )
93
+ {
94
+ new Models . Components . Charts . Dataset ( )
95
+ {
96
+ BackgroundColors = new System . Collections . Generic . List < string > ( ) { "#007bff" } ,
97
+ BorderColor = "#007bff" ,
98
+ Label = "This year" ,
99
+ Data = new System . Collections . Generic . List < decimal > ( )
100
+ {
101
+ 1000 , 2000 , 3000 , 2500 , 2700 , 2500 , 3000
102
+ }
103
+ } ,
104
+ new Models . Components . Charts . Dataset ( )
105
+ {
106
+ BackgroundColors = new System . Collections . Generic . List < string > ( ) { "#ced4da" } ,
107
+ BorderColor = "#ced4da" ,
108
+ Label = "Last year" ,
109
+ Data = new System . Collections . Generic . List < decimal > ( )
110
+ {
111
+ 700 , 1700 , 2700 , 2000 , 1800 , 1500 , 2000
112
+ }
113
+ }
114
+ }
115
+ } ;
116
+ model . SalesPie = new Models . Components . Charts . ChartModel ( )
117
+ {
118
+ ChartId = "pieSales" ,
119
+ Labels = new System . Collections . Generic . List < string > ( ) {
120
+ "Instore Sales" , "Download Sales" , "Mail-Order Sales"
121
+ } ,
122
+ ShowLegend = true ,
123
+ Datasets = new System . Collections . Generic . List < Models . Components . Charts . Dataset > ( )
124
+ {
125
+ new Models . Components . Charts . Dataset ( )
126
+ {
127
+ BackgroundColors = new System . Collections . Generic . List < string > ( )
128
+ {
129
+ "#f56954" , "#00a65a" , "#f39c12"
130
+ } ,
131
+ Data = new System . Collections . Generic . List < decimal > ( )
132
+ {
133
+ 30 , 20 , 10
134
+ }
135
+ }
136
+ }
137
+ } ;
138
+
139
+ return View ( "Index" , model ) ;
23
140
}
24
141
25
142
[ Breadcrumb ( "Privacy" ) ]
0 commit comments