From 9957004b804ca3bbf572c1281256e930ad56178a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Sun, 3 May 2020 22:52:11 +0200 Subject: [PATCH] The new UI-project is developing startpage has got right texts and list of Tournaments is showing up --- MVCUI/Content/Site.css | 12 ++++++ MVCUI/Controllers/HomeController.cs | 18 +++------ MVCUI/Global.asax.cs | 4 ++ MVCUI/MVCUI.csproj | 8 +++- MVCUI/Views/Home/About.cshtml | 7 ---- MVCUI/Views/Home/Contact.cshtml | 17 -------- MVCUI/Views/Home/Index.cshtml | 63 ++++++++++++++++------------- MVCUI/Views/Shared/_Layout.cshtml | 6 +-- MVCUI/Web.config | 5 +++ 9 files changed, 71 insertions(+), 69 deletions(-) delete mode 100644 MVCUI/Views/Home/About.cshtml delete mode 100644 MVCUI/Views/Home/Contact.cshtml diff --git a/MVCUI/Content/Site.css b/MVCUI/Content/Site.css index 6ea5d8f..63d7501 100644 --- a/MVCUI/Content/Site.css +++ b/MVCUI/Content/Site.css @@ -22,3 +22,15 @@ select, textarea { max-width: 280px; } + +.tourney-display { + margin-left: 20px; +} + +.tourney-display > li { + margin-bottom:10px; +} + +.tourney-display > li > a { + font-size: 20px; +} \ No newline at end of file diff --git a/MVCUI/Controllers/HomeController.cs b/MVCUI/Controllers/HomeController.cs index 6e7c40b..31ca604 100644 --- a/MVCUI/Controllers/HomeController.cs +++ b/MVCUI/Controllers/HomeController.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; +using TrackerLibrary; +using TrackerLibrary.Models; namespace MVCUI.Controllers { @@ -10,21 +12,11 @@ namespace MVCUI.Controllers { public ActionResult Index() { - return View(); + List tournaments = GlobalConfig.Connection.GetTournament_All(); + + return View(tournaments); } - public ActionResult About() - { - ViewBag.Message = "Your application description page."; - return View(); - } - - public ActionResult Contact() - { - ViewBag.Message = "Your contact page."; - - return View(); - } } } \ No newline at end of file diff --git a/MVCUI/Global.asax.cs b/MVCUI/Global.asax.cs index b776115..8e0d3a5 100644 --- a/MVCUI/Global.asax.cs +++ b/MVCUI/Global.asax.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; +using TrackerLibrary; namespace MVCUI { @@ -16,6 +17,9 @@ namespace MVCUI FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); + + // Initialize the database connections + GlobalConfig.InitializeConnections(DatabaseType.Sql); } } } diff --git a/MVCUI/MVCUI.csproj b/MVCUI/MVCUI.csproj index 85c9be5..19aa643 100644 --- a/MVCUI/MVCUI.csproj +++ b/MVCUI/MVCUI.csproj @@ -252,8 +252,6 @@ - - @@ -281,6 +279,12 @@ + + + {27ba8b4b-4ef6-4ca2-8e43-7c930552ecd9} + TrackerLibrary + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/MVCUI/Views/Home/About.cshtml b/MVCUI/Views/Home/About.cshtml deleted file mode 100644 index 4b2d9e8..0000000 --- a/MVCUI/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewBag.Title = "About"; -} -

@ViewBag.Title.

-

@ViewBag.Message

- -

Use this area to provide additional information.

diff --git a/MVCUI/Views/Home/Contact.cshtml b/MVCUI/Views/Home/Contact.cshtml deleted file mode 100644 index 0f4327e..0000000 --- a/MVCUI/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewBag.Title = "Contact"; -} -

@ViewBag.Title.

-

@ViewBag.Message

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
\ No newline at end of file diff --git a/MVCUI/Views/Home/Index.cshtml b/MVCUI/Views/Home/Index.cshtml index 32e1dd9..050d02b 100644 --- a/MVCUI/Views/Home/Index.cshtml +++ b/MVCUI/Views/Home/Index.cshtml @@ -1,31 +1,40 @@ -@{ +@model IEnumerable + +@{ ViewBag.Title = "Home Page"; } -
-

ASP.NET

-

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

-

Learn more »

-
-
-
-

Getting started

-

- ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that - enables a clean separation of concerns and gives you full control over markup - for enjoyable, agile development. -

-

Learn more »

-
-
-

Get more libraries

-

NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

-

Learn more »

-
-
-

Web Hosting

-

You can easily find a web hosting company that offers the right mix of features and price for your applications.

-

Learn more »

-
-
\ No newline at end of file + +
+
+
+

Office Fun!

+

Track your in office tournament easily and have a great time doing it.

+

Create a tournament

+
+
+
+

Play with friends

+

+ Get a team and get started today on a new tournament. +

+
+
+

Win prizes

+

Set up a tournament with prizes for first and second place and compete to win.

+
+
+
+
+

Current Tournament

+ +
+ +
\ No newline at end of file diff --git a/MVCUI/Views/Shared/_Layout.cshtml b/MVCUI/Views/Shared/_Layout.cshtml index 568e56b..69cc21d 100644 --- a/MVCUI/Views/Shared/_Layout.cshtml +++ b/MVCUI/Views/Shared/_Layout.cshtml @@ -24,12 +24,12 @@ - + *@ @@ -42,7 +42,7 @@
- © @DateTime.Now.Year - My ASP.NET Application + © @DateTime.Now.Year - Tournament Tracker Application by Tim Corey
@Scripts.Render("~/bundles/jquery") diff --git a/MVCUI/Web.config b/MVCUI/Web.config index 69157a1..6e2448c 100644 --- a/MVCUI/Web.config +++ b/MVCUI/Web.config @@ -10,6 +10,11 @@ + + + + +