)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
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:     ///
   17:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   18:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   19:     ///
   20:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   21:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   22:     /// 
   23:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   24:     /// 
   25:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   26:     /// </remarks> 
   27:     public class HomeController : Controller
   28:     {
   29:         private readonly UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> userManager;
   30:         //private readonly IMemoryCache memoryCache;
   31:  
   32:         /////////////////////////////////////////////////////////////////////////////////
   33:  
   34:         /// <summary>
   35:         ///
   36:         /// </summary>
   37:         public HomeController(UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> _userManager)//, IMemoryCache _memoryCache)
   38:         {
   39:             userManager = _userManager;
   40:  
   41:             //memoryCache = _memoryCache;
   42:         }
   43:  
   44:         /////////////////////////////////////////////////////////////////////////////////
   45:  
   46:         /// <summary>
   47:         ///
   48:         /// </summary>
   49:         [HttpGet]
   50:         public IActionResult Index()
   51:         {
   52:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
   53:  
   54:             var alarmViewModel = new Ia.Ftn.Wa.Models.Alarm.AlarmViewModel()
   55:             {
   56:                 CurrentStaffIdentityUser = currentStaffIdentityUser,
   57:                 UserManager = userManager
   58:             };
   59:  
   60:             Ia.Ftn.Wa.Models.Business.Default.ManageEnqueueHeartbeat();
   61:             Ia.Ftn.Wa.Models.Business.Default.ManageMessageQueue();
   62:  
   63:             return View(alarmViewModel);
   64:         }
   65:  
   66:         /////////////////////////////////////////////////////////////////////////////////
   67:  
   68:         /// <summary>
   69:         ///
   70:         /// </summary>
   71:         [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
   72:         public IActionResult Error()
   73:         {
   74:             return View(new Ia.Ftn.Wa.Models.ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
   75:         }
   76:  
   77:         /////////////////////////////////////////////////////////////////////////////////
   78:         /////////////////////////////////////////////////////////////////////////////////
   79:     }
   80:  
   81:     /////////////////////////////////////////////////////////////////////////////////
   82:     /////////////////////////////////////////////////////////////////////////////////
   83: }