mirror of
https://github.com/Queercon/QC14-Badge-Webview.git
synced 2025-08-20 21:33:29 -07:00
List controller
This commit is contained in:
parent
7cbdaa60be
commit
23bc3b421b
2 changed files with 100 additions and 4 deletions
|
@ -50,7 +50,47 @@ namespace qcbadge.Controllers
|
|||
|
||||
}
|
||||
|
||||
public IActionResult List(string s, string id, int refresh)
|
||||
{
|
||||
Helpers.Sql sql = new Helpers.Sql();
|
||||
ViewData["refresh"] = refresh;
|
||||
|
||||
if ((String.Compare(Startup.scode, s, true) == 0))
|
||||
{
|
||||
ViewData["Message"] = "";
|
||||
ViewData["0"] = 0;
|
||||
ViewData["1"] = 0;
|
||||
ViewData["38"] = 0;
|
||||
|
||||
bool[] imglist = new bool[50];
|
||||
|
||||
if (String.IsNullOrEmpty(id))
|
||||
{
|
||||
imglist = sql.selectGlobalView();
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
ViewData[i.ToString()] = imglist[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int badgeid = Convert.ToInt32(id);
|
||||
badgeid = badgeid - 1;
|
||||
imglist = sql.selectIndervidualView(badgeid);
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
ViewData[i.ToString()] = imglist[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return View();
|
||||
}
|
||||
else { return StatusCode(401); }
|
||||
|
||||
}
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue