Teams creation and prizes creation are implemented

This commit is contained in:
2020-05-05 23:25:28 +02:00
parent fc49f33575
commit 9596d9aa47
15 changed files with 387 additions and 4 deletions

View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TrackerLibrary;
using TrackerLibrary.Models;
namespace MVCUI.Controllers
{
public class PrizesController : Controller
{
// GET: Prizes
public ActionResult Index()
{
List<PrizeModel> allPrizes = GlobalConfig.Connection.GetPrizes_All();
return View(allPrizes);
}
// GET: Prizes/Create
public ActionResult Create()
{
return View();
}
// POST: Prizes/Create
[ValidateAntiForgeryToken()]
[HttpPost]
public ActionResult Create(PrizeModel p)
{
try
{
if (ModelState.IsValid)
{
GlobalConfig.Connection.CreatePrize(p);
return RedirectToAction("Index");
}
else
{
return View();
}
}
catch
{
return View();
}
}
}
}