using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using PSTW_CentralSystem.DBContext;
using PSTW_CentralSystem.Models;
using System.Diagnostics;

namespace PSTW_CentralSystem.Controllers
{
    [Authorize(Policy = "RoleModulePolicy")]
    public class AdminController : Controller
    {
        private readonly CentralSystemContext _authDbContext;
        private readonly ILogger<HomeController> _logger;

        public AdminController(ILogger<HomeController> logger, CentralSystemContext authDbContext)
        {
            _logger = logger;
            _authDbContext = authDbContext;
        }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult ModuleAdmin()
        {
            return View();
        }

        public IActionResult ModuleSetting(int? id)
        {
            if (id == null)
            {
                return NotFound();
            }

            var moduleSettings =  _authDbContext.ModuleSettings.Find(id);
            if (moduleSettings == null)
            {
                return NotFound();
            }

            return View(moduleSettings);
        }

        public IActionResult ModuleCreate()
        {
            return View();
        }

        public IActionResult UserAdmin()
        {
            return View();
        }

        public IActionResult UserSetting()
        {
            return View();
        }

        public IActionResult UserCreate()
        {
            return View();
        }
        public IActionResult RoleAdmin()
        {
            return View();
        }
        public IActionResult CompDeptAdmin()
        {
            return View();
        }
    }
}
