82 lines
2.1 KiB
C#
82 lines
2.1 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;
|
|
string admin = string.Empty;
|
|
string time_sheet = string.Empty;
|
|
public HomeController(ILogger<HomeController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public IActionResult Index()
|
|
{
|
|
SessionHelper helper = new SessionHelper(this);
|
|
token = helper.GetStringValue("tok");
|
|
admin = helper.GetStringValue("admin");
|
|
time_sheet = helper.GetStringValue("time_sheet");
|
|
|
|
ViewBag.Admin = admin;
|
|
ViewBag.TimeSheet = time_sheet;
|
|
|
|
if (string.IsNullOrEmpty(token))
|
|
{
|
|
return RedirectToAction("Login2", "Login");
|
|
}
|
|
else
|
|
{
|
|
return View();
|
|
}
|
|
}
|
|
|
|
public IActionResult VT_Read()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Privacy()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Cookies()
|
|
{
|
|
return View();
|
|
|
|
}
|
|
|
|
public IActionResult DatiPers()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Listino()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public FileResult Download(string file)
|
|
{
|
|
string app = "";
|
|
byte[] fileBytes = System.IO.File.ReadAllBytes(file);
|
|
var response = new FileContentResult(fileBytes, "application/octet-stream");
|
|
response.FileDownloadName = "appTest.apk";
|
|
return response;
|
|
}
|
|
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
} |