sql helper and code for view selection start

This commit is contained in:
Jake Visser 2017-07-05 15:52:15 -07:00
commit 11f497adee
2 changed files with 43 additions and 2 deletions

View file

@ -8,7 +8,7 @@ namespace qcbadge.Controllers
{ {
public class HomeController : Controller public class HomeController : Controller
{ {
public IActionResult Index(string s) public IActionResult Index(string s, string id)
{ {
if ((String.Compare(Startup.scode, s, true) == 0)) if ((String.Compare(Startup.scode, s, true) == 0))
{ {
@ -17,11 +17,19 @@ namespace qcbadge.Controllers
ViewData["1"] = 1; ViewData["1"] = 1;
ViewData["38"] = 1; ViewData["38"] = 1;
if (String.IsNullOrEmpty(id))
{
}
else
{
}
return View(); return View();
} }
else { return StatusCode(401); } else { return StatusCode(401); }
} }

33
qcbadge/Helpers/Sql.cs Normal file
View file

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Text;
namespace qcbadge.Helpers
{
public class Sql
{
private static string DataSource = Startup.dburi;
private static string UserID = Startup.dbuser;
private static string Password = Startup.dbpass;
private static string db = Startup.dbname;
private static string table = "qcbdage";
public bool[] selectGlobalView()
{
bool[] rtn = new bool[50];
return rtn;
}
public bool[] selectIndervidualView(int badgeid)
{
bool[] rtn = new bool[50];
return rtn;
}
}
}