)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » HomeController (Ia.Ftn.Wa.Controllers)

Public general use code classes and xml files that we've compiled and used over the years:

    1: using Microsoft.AspNetCore.Identity;
    2: using Microsoft.AspNetCore.Mvc;
    3: using Microsoft.Extensions.Caching.Memory;
    4: using System.Diagnostics;
    5:  
    6: namespace Ia.Ftn.Wa.Controllers
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     ///
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     /// </remarks>
   17:     // [Authorize]
   18:     public class HomeController : Controller
   19:     {
   20:         private readonly UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> userManager;
   21:         //private readonly IMemoryCache memoryCache;
   22:  
   23:         /////////////////////////////////////////////////////////////////////////////////
   24:  
   25:         /// <summary>
   26:         ///
   27:         /// </summary>
   28:         public HomeController(UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> _userManager)//, IMemoryCache _memoryCache)
   29:         {
   30:             userManager = _userManager;
   31:  
   32:             //memoryCache = _memoryCache;
   33:         }
   34:  
   35:         /////////////////////////////////////////////////////////////////////////////////
   36:  
   37:         /// <summary>
   38:         ///
   39:         /// </summary>
   40:         [HttpGet]
   41:         public async Task<IActionResult> Index()
   42:         {
   43:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
   44:  
   45:             var alarmViewModel = new Ia.Ftn.Wa.Models.Alarm.AlarmViewModel()
   46:             {
   47:                 CurrentStaffIdentityUser = currentStaffIdentityUser,
   48:                 UserManager = userManager
   49:             };
   50:  
   51:             //var a = Ia.Ftn.Wa.Models.Business.Default.HeartbeatAssemblyNameToCreatedDateTimeDictionary;
   52:  
   53:             Ia.Ftn.Wa.Models.Business.Default.ManageEnqueueHeartbeat();
   54:             await Ia.Ftn.Wa.Models.Business.Default.ManageMessageQueue();
   55:  
   56:             //var b = Ia.Ftn.Wa.Models.Business.Default.HeartbeatAssemblyNameToCreatedDateTimeDictionary;
   57:  
   58:             return View(alarmViewModel);
   59:         }
   60:  
   61:         /////////////////////////////////////////////////////////////////////////////////
   62:  
   63:         /// <summary>
   64:         ///
   65:         /// </summary>
   66:         [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
   67:         public IActionResult Error()
   68:         {
   69:             return View(new Ia.Ftn.Wa.Models.ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
   70:         }
   71:  
   72:         /////////////////////////////////////////////////////////////////////////////////
   73:         /////////////////////////////////////////////////////////////////////////////////
   74:     }
   75:  
   76:     /////////////////////////////////////////////////////////////////////////////////
   77:     /////////////////////////////////////////////////////////////////////////////////
   78: }