58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
using NuGet.Common;
|
|
using System.Diagnostics;
|
|
using VirtualTask.Models;
|
|
|
|
namespace VirtualTask.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
private readonly ILogger<HomeController> _logger;
|
|
string token = string.Empty;
|
|
public HomeController(ILogger<HomeController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public IActionResult Index()
|
|
{
|
|
SessionHelper helper = new SessionHelper(this);
|
|
token = helper.GetStringValue("tok");
|
|
if (string.IsNullOrEmpty(token))
|
|
{
|
|
return RedirectToAction("Index", "Login");
|
|
}
|
|
else
|
|
{
|
|
//List<Anag> modelList = new List<Anag>();
|
|
//Anag a=new Anag();
|
|
//a.ancodice = "0001";
|
|
//a.andescri = "Francesco Totti";
|
|
//modelList.Add(a);
|
|
|
|
//Anag b = new Anag();
|
|
//b.ancodice = "0002";
|
|
//b.andescri = "Alex Del Piero";
|
|
//modelList.Add(b);
|
|
|
|
|
|
//SelectList customers = new SelectList(modelList,"ancodice","andescri");
|
|
//ViewBag.Token = token;
|
|
//return View(customers);
|
|
return View();
|
|
}
|
|
}
|
|
|
|
public IActionResult Privacy()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
} |