Files
everything2/EveryThing/Pages/Index.cshtml.cs
David Štaleker a45fe73754 Odstranjenn projekt
dodan vnos pozicije fakture
2023-05-13 16:42:01 +02:00

54 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using EveryThing.Data;
using EveryThing.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace EveryThing.Pages
{
[Authorize]
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
private readonly ApplicationDbContext _context;
private readonly UserManager<IdentityApplicationUser> _userManager;
private readonly SignInManager<IdentityApplicationUser> _loginManager;
private readonly RoleManager<IdentityApplicationRole> _roleManager;
public IndexModel(ApplicationDbContext context, UserManager<IdentityApplicationUser> userManager, SignInManager<IdentityApplicationUser> loginManager, RoleManager<IdentityApplicationRole> roleManager)
{
_context = context;
_userManager = userManager;
_loginManager = loginManager;
_roleManager = roleManager;
}
public string Year { get; set; }
public IActionResult OnGet(string year)
{
//_logger.LogInformation("Index");
Year = year;
Year ??= DateTime.Now.Year.ToString();
ViewData["Years"] = new SelectList(Enumerable.Range(2022, (DateTime.Now.Year - 2022) + 2));
return Page();
}
public IActionResult OnGetData(int year)
{
return new JsonResult(new { data = new List<int>(), error = "", successful = true });
}
}
}