)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » AdministrationController (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.Authorization;
    2: using Microsoft.AspNetCore.Identity;
    3: using Microsoft.AspNetCore.Mvc;
    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:     [Authorize]
   28:     public class AdministrationController : Controller
   29:     {
   30:         private static Ia.Ftn.Wa.Models.Administration.AccessNetworkViewModel currentAccessNetworkViewModel = new Ia.Ftn.Wa.Models.Administration.AccessNetworkViewModel();
   31:         private readonly UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> userManager;
   32:  
   33:         /////////////////////////////////////////////////////////////////////////////////
   34:  
   35:         /// <summary>
   36:         ///
   37:         /// </summary>
   38:         public AdministrationController(UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> _userManager)
   39:         {
   40:             userManager = _userManager;
   41:         }
   42:  
   43:         /////////////////////////////////////////////////////////////////////////////////
   44:  
   45:         /// <summary>
   46:         ///
   47:         /// </summary>
   48:         [HttpGet]
   49:         public IActionResult Index()
   50:         {
   51:             var administrationViewModel = new Ia.Ftn.Wa.Models.Administration.IndexViewModel();
   52:  
   53:             administrationViewModel.OfficialWorkingTimeText = Ia.Ftn.Cl.Models.Business.Administration.OfficialWorkingTimeString();
   54:  
   55:             administrationViewModel.NowIsOfficialWorkingTimeText = Ia.Cl.Models.Default.YesNo(Ia.Ftn.Cl.Models.Business.Administration.NowIsOfficialWorkingTime);
   56:  
   57:             administrationViewModel.ServiceSuspensionIsEnabledText = Ia.Cl.Models.Default.YesNo(Ia.Ftn.Cl.Models.Business.Administration.ServiceSuspensionIsEnabled);
   58:  
   59:             return View(administrationViewModel);
   60:         }
   61:  
   62:         /////////////////////////////////////////////////////////////////////////////////
   63:  
   64:         /// <summary>
   65:         ///
   66:         /// </summary>
   67:         [HttpGet]
   68:         [Route("/administration/access-network")]
   69:         public IActionResult AccessNetwork()
   70:         {
   71:             var accessNetworkViewModel = new Ia.Ftn.Wa.Models.Administration.AccessNetworkViewModel();
   72:  
   73:             Ia.Ftn.Wa.Models.Administration.AccessNetwork.ViewModel(ref currentAccessNetworkViewModel, ref accessNetworkViewModel);
   74:  
   75:             return View("AccessNetwork", accessNetworkViewModel);
   76:         }
   77:  
   78:         ////////////////////////////////////////////////////////////////////////////
   79:  
   80:         /// <summary>
   81:         ///
   82:         /// </summary>
   83:         [HttpPost]
   84:         [Route("/administration/access-network")]
   85:         public IActionResult ManageAccessNetwork(Ia.Ftn.Wa.Models.Administration.AccessNetworkViewModel accessNetworkViewModel)
   86:         {
   87:             Ia.Ftn.Wa.Models.Administration.AccessNetwork.ViewModel(ref currentAccessNetworkViewModel, ref accessNetworkViewModel);
   88:  
   89:             return View("AccessNetwork", accessNetworkViewModel);
   90:         }
   91:  
   92:         /////////////////////////////////////////////////////////////////////////////////
   93:  
   94:         /// <summary>
   95:         ///
   96:         /// </summary>
   97:         [HttpGet]
   98:         public IActionResult Framework()
   99:         {
  100:             string table = Ia.Ftn.Cl.Models.Ui.Administration.Framework.StructureDataTable();
  101:  
  102:             return View("Framework", table);
  103:         }
  104:  
  105:         /////////////////////////////////////////////////////////////////////////////////
  106:  
  107:         /// <summary>
  108:         ///
  109:         /// </summary>
  110:         [HttpGet]
  111:         public IActionResult Staff()
  112:         {
  113:             var staffViewModel = new Ia.Ftn.Wa.Models.Administration.StaffViewModel();
  114:  
  115:             var identityUsers = Ia.Ftn.Cl.Models.Identity.StaffIdentityUserList();
  116:  
  117:             staffViewModel.UserSelectList = identityUsers;
  118:  
  119:             return View("Staff", staffViewModel);
  120:         }
  121:  
  122:         /////////////////////////////////////////////////////////////////////////////////
  123:  
  124:         /// <summary>
  125:         ///
  126:         /// </summary>
  127:         [HttpGet]
  128:         [Route("/administration/network-design-document")]
  129:         public IActionResult NetworkDesignDocument()
  130:         {
  131:             string table = Ia.Ftn.Cl.Models.Ui.NetworkDesignDocument.StructureDataTable();
  132:  
  133:             return View("NetworkDesignDocument", table);
  134:         }
  135:  
  136:         /////////////////////////////////////////////////////////////////////////////////
  137:  
  138:         /// <summary>
  139:         ///
  140:         /// </summary>
  141:         [HttpGet]
  142:         public IActionResult Statistics()
  143:         {
  144:             var statisticsViewModel = new Ia.Ftn.Wa.Models.Administration.StatisticsViewModel();
  145:  
  146:             Ia.Ftn.Wa.Models.Administration.Statistics.SiteStatisticViewModel(ref statisticsViewModel);
  147:             Ia.Ftn.Wa.Models.Administration.Statistics.AreaStatisticViewModel(ref statisticsViewModel);
  148:  
  149:             return View("Statistics", statisticsViewModel);
  150:         }
  151:  
  152:         /////////////////////////////////////////////////////////////////////////////////
  153:  
  154:         /// <summary>
  155:         ///
  156:         /// </summary>
  157:         [HttpGet]
  158:         [Route("/administration/service-status")]
  159:         public IActionResult ServiceStatus()
  160:         {
  161:             var serviceStatusViewModel = new Ia.Ftn.Wa.Models.Administration.ServiceStatusViewModel();
  162:  
  163:             Ia.Ftn.Wa.Models.Administration.ServiceStatus.ViewModel(ref serviceStatusViewModel);
  164:  
  165:             return View("ServiceStatus", serviceStatusViewModel);
  166:         }
  167:  
  168:         /////////////////////////////////////////////////////////////////////////////////
  169:  
  170:         /// <summary>
  171:         ///
  172:         /// </summary>
  173:         [HttpPost]
  174:         [Route("/administration/service-status")]
  175:         public IActionResult ServiceStatusCategorize_Submit(Ia.Ftn.Wa.Models.Administration.ServiceStatusViewModel serviceStatusViewModel)
  176:         {
  177:             Ia.Ftn.Wa.Models.Administration.ServiceStatus.Categorize(ref serviceStatusViewModel);
  178:  
  179:             Ia.Ftn.Wa.Models.Administration.ServiceStatus.ViewModel(ref serviceStatusViewModel);
  180:  
  181:             return View("ServiceStatus", serviceStatusViewModel);
  182:         }
  183:  
  184:         /////////////////////////////////////////////////////////////////////////////////
  185:  
  186:         /// <summary>
  187:         ///
  188:         /// </summary>
  189:         [HttpGet]
  190:         [Route("administration/service-request-administrative-issue")]
  191:         public IActionResult ServiceRequestAdministrativeIssue()
  192:         {
  193:             var serviceRequestAdministrativeIssueViewModel = new Ia.Ftn.Wa.Models.Administration.ServiceRequestAdministrativeIssueViewModel();
  194:  
  195:             Ia.Ftn.Wa.Models.Administration.ServiceRequestAdministrativeIssue.ViewModel(ref serviceRequestAdministrativeIssueViewModel);
  196:  
  197:             return View("ServiceRequestAdministrativeIssue", serviceRequestAdministrativeIssueViewModel);
  198:         }
  199:  
  200:         /////////////////////////////////////////////////////////////////////////////////
  201:  
  202:         /// <summary>
  203:         ///
  204:         /// </summary>
  205:         [HttpGet]
  206:         public IActionResult Monitor()
  207:         {
  208:             string text;
  209:             int withinLastNMinutes = 20;
  210:  
  211:             var dictionary = Ia.Ftn.Wa.Models.Business.Default.HeartbeatAssemblyNameToCreatedDateTimeDictionary;
  212:  
  213:             if (dictionary.Count > 0)
  214:             {
  215:                 text = Ia.Ftn.Cl.Models.Business.Heartbeat.WithinLastNMinuteHtmlTable(dictionary, withinLastNMinutes);
  216:             }
  217:             else text = "No heartbeat data from secretary. Try to refresh within a few minutes.";
  218:  
  219:             return View("Monitor", text);
  220:         }
  221:  
  222:         /////////////////////////////////////////////////////////////////////////////////
  223:  
  224:         /// <summary>
  225:         ///
  226:         /// </summary>
  227:         [HttpGet]
  228:         [Route("/administration/area-readiness")]
  229:         public IActionResult AreaReadiness()
  230:         {
  231:             var areaReadinessListViewModel = Ia.Ftn.Wa.Models.Administration.AreaReadiness.AreaReadinessList();
  232:  
  233:             return View("AreaReadiness", areaReadinessListViewModel);
  234:         }
  235:  
  236:         /////////////////////////////////////////////////////////////////////////////////
  237:  
  238:         /// <summary>
  239:         ///
  240:         /// </summary>
  241:         [HttpGet]
  242:         public IActionResult Kpi()
  243:         {
  244:             var kpiViewModel = Ia.Ftn.Wa.Models.Administration.Kpi.ViewModel();
  245:  
  246:             return View("Kpi", kpiViewModel);
  247:         }
  248:  
  249:         /////////////////////////////////////////////////////////////////////////////////
  250:  
  251:         /// <summary>
  252:         ///
  253:         /// </summary>
  254:         [HttpGet]
  255:         [Route("/administration/sdc")]
  256:         public IActionResult Sdc()
  257:         {
  258:             var sdcViewModel = Ia.Ftn.Wa.Models.Administration.Sdc.ViewModel();
  259:  
  260:             return View("Sdc", sdcViewModel);
  261:         }
  262:  
  263:         /////////////////////////////////////////////////////////////////////////////////
  264:  
  265:         /// <summary>
  266:         ///
  267:         /// </summary>
  268:         [HttpPost]
  269:         [Route("/administration/sdc")]
  270:         public IActionResult Sdc(Ia.Ftn.Wa.Models.Administration.SdcViewModel sdcViewModel)
  271:         {
  272:             Ia.Ftn.Wa.Models.Administration.Sdc.ViewModel(ref sdcViewModel);
  273:  
  274:             return View("Sdc", sdcViewModel);
  275:         }
  276:  
  277:         /////////////////////////////////////////////////////////////////////////////////
  278:  
  279:         /// <summary>
  280:         ///
  281:         /// </summary>
  282:         [HttpGet]
  283:         [Route("/administration/sdc/pon-bandwidth-utilization")]
  284:         public IActionResult SdcPonBandwidthUtilization()
  285:         {
  286:             var sdcViewModel = Ia.Ftn.Wa.Models.Administration.Sdc.SdcPonBandwidthUtilizationViewModel();
  287:  
  288:             return View("SdcPonBandwidthUtilization", sdcViewModel);
  289:         }
  290:  
  291:         /////////////////////////////////////////////////////////////////////////////////
  292:  
  293:         /// <summary>
  294:         ///
  295:         /// </summary>
  296:         [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  297:         public IActionResult Error()
  298:         {
  299:             return View(new Ia.Ftn.Wa.Models.ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
  300:         }
  301:  
  302:         /////////////////////////////////////////////////////////////////////////////////
  303:         /////////////////////////////////////////////////////////////////////////////////
  304:     }
  305:  
  306:     /////////////////////////////////////////////////////////////////////////////////
  307:     /////////////////////////////////////////////////////////////////////////////////
  308: }