)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » MaintenanceController (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 MaintenanceController : Controller
   29:     {
   30:         private readonly UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> userManager;
   31:  
   32:         /////////////////////////////////////////////////////////////////////////////////
   33:  
   34:         /// <summary>
   35:         ///
   36:         /// </summary>
   37:         public MaintenanceController(UserManager<Ia.Ftn.Cl.Models.StaffIdentityUser> _userManager)
   38:         {
   39:             userManager = _userManager;
   40:         }
   41:  
   42:         /////////////////////////////////////////////////////////////////////////////////
   43:  
   44:         /// <summary>
   45:         ///
   46:         /// </summary>
   47:         [HttpGet]
   48:         public IActionResult Index()
   49:         {
   50:             return View();
   51:         }
   52:  
   53:         /////////////////////////////////////////////////////////////////////////////////
   54:         /////////////////////////////////////////////////////////////////////////////////
   55:  
   56:         /// <summary>
   57:         ///
   58:         /// </summary>
   59:         [HttpGet]
   60:         [Route("/maintenance/find")]
   61:         public IActionResult Find(string input, string inputType)
   62:         {
   63:             var findViewModel = new Ia.Ftn.Wa.Models.Maintenance.FindViewModel();
   64:  
   65:             findViewModel.CurrentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
   66:  
   67:             findViewModel.Input = input;
   68:             findViewModel.InputType = inputType;
   69:  
   70:             if (!string.IsNullOrEmpty(findViewModel.Input))
   71:             {
   72:                 Ia.Ftn.Wa.Models.Maintenance.Find.ViewModel(ref findViewModel);
   73:             }
   74:  
   75:             return View("Find", findViewModel);
   76:         }
   77:  
   78:         /////////////////////////////////////////////////////////////////////////////////
   79:  
   80:         /// <summary>
   81:         ///
   82:         /// </summary>
   83:         [HttpPost]
   84:         public IActionResult Find(Ia.Ftn.Wa.Models.Maintenance.FindViewModel findViewModel)
   85:         {
   86:             findViewModel.CurrentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
   87:  
   88:             Ia.Ftn.Wa.Models.Maintenance.Find.ViewModel(ref findViewModel);
   89:  
   90:             return View("Find", findViewModel);
   91:         }
   92:  
   93:         /////////////////////////////////////////////////////////////////////////////////
   94:         /////////////////////////////////////////////////////////////////////////////////
   95:  
   96:         /// <summary>
   97:         ///
   98:         /// </summary>
   99:         [HttpGet]
  100:         public IActionResult Access()
  101:         {
  102:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
  103:  
  104:             var accessViewModel = new Ia.Ftn.Wa.Models.Maintenance.AccessViewModel();
  105:  
  106:             Ia.Ftn.Wa.Models.Maintenance.Access.ViewModel(ref accessViewModel, currentStaffIdentityUser);
  107:  
  108:             return View("Access", accessViewModel);
  109:         }
  110:  
  111:         /////////////////////////////////////////////////////////////////////////////////
  112:  
  113:         /// <summary>
  114:         ///
  115:         /// </summary>
  116:         [HttpPost]
  117:         public IActionResult Access(Ia.Ftn.Wa.Models.Maintenance.AccessViewModel accessViewModel)
  118:         {
  119:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
  120:  
  121:             Ia.Ftn.Wa.Models.Maintenance.Access.Post(ref accessViewModel, currentStaffIdentityUser);
  122:  
  123:             Ia.Ftn.Wa.Models.Maintenance.Access.ViewModel(ref accessViewModel, currentStaffIdentityUser);
  124:  
  125:             return View("Access", accessViewModel);
  126:         }
  127:  
  128:         /////////////////////////////////////////////////////////////////////////////////
  129:         /////////////////////////////////////////////////////////////////////////////////
  130:  
  131:         /// <summary>
  132:         ///
  133:         /// </summary>
  134:         [HttpGet]
  135:         public IActionResult List()
  136:         {
  137:             var listViewModel = new Ia.Ftn.Wa.Models.Maintenance.ListViewModel();
  138:  
  139:             Ia.Ftn.Wa.Models.Maintenance.List.ViewModel(ref listViewModel);
  140:  
  141:             return View("List", listViewModel);
  142:         }
  143:  
  144:         /////////////////////////////////////////////////////////////////////////////////
  145:  
  146:         /// <summary>
  147:         ///
  148:         /// </summary>
  149:         [HttpPost]
  150:         public IActionResult List(Ia.Ftn.Wa.Models.Maintenance.ListViewModel listViewModel, string commandName)
  151:         {
  152:             Ia.Ftn.Wa.Models.Maintenance.List.Post(ref listViewModel, commandName);
  153:  
  154:             Ia.Ftn.Wa.Models.Maintenance.List.ViewModel(ref listViewModel);
  155:  
  156:             return View("List", listViewModel);
  157:         }
  158:  
  159:         /////////////////////////////////////////////////////////////////////////////////
  160:         /////////////////////////////////////////////////////////////////////////////////
  161:  
  162:         /// <summary>
  163:         ///
  164:         /// </summary>
  165:         [HttpGet]
  166:         public IActionResult Table()
  167:         {
  168:             var tableViewModel = new Ia.Ftn.Wa.Models.Maintenance.TableViewModel();
  169:  
  170:             Ia.Ftn.Wa.Models.Maintenance.Table.ViewModel(ref tableViewModel);
  171:  
  172:             return View("Table", tableViewModel);
  173:         }
  174:  
  175:         /////////////////////////////////////////////////////////////////////////////////
  176:  
  177:         /// <summary>
  178:         ///
  179:         /// </summary>
  180:         [HttpPost]
  181:         public IActionResult Table(Ia.Ftn.Wa.Models.Maintenance.TableViewModel tableViewModel, string commandName)
  182:         {
  183:             Ia.Ftn.Wa.Models.Maintenance.Table.Post(ref tableViewModel, commandName);
  184:  
  185:             Ia.Ftn.Wa.Models.Maintenance.Table.ViewModel(ref tableViewModel);
  186:  
  187:             return View("Table", tableViewModel);
  188:         }
  189:  
  190:         /////////////////////////////////////////////////////////////////////////////////
  191:         /////////////////////////////////////////////////////////////////////////////////
  192:  
  193:         /// <summary>
  194:         ///
  195:         /// </summary>
  196:         [HttpGet]
  197:         public IActionResult Integrity()
  198:         {
  199:             var integrityViewModel = new Ia.Ftn.Wa.Models.Maintenance.IntegrityViewModel();
  200:  
  201:             Ia.Ftn.Wa.Models.Maintenance.Integrity.ViewModel(ref integrityViewModel);
  202:  
  203:             return View("Integrity", integrityViewModel);
  204:         }
  205:  
  206:         /////////////////////////////////////////////////////////////////////////////////
  207:         /////////////////////////////////////////////////////////////////////////////////
  208:  
  209:         /// <summary>
  210:         ///
  211:         /// </summary>
  212:         [HttpGet]
  213:         public IActionResult Bulk()
  214:         {
  215:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
  216:  
  217:             var bulkViewModel = new Ia.Ftn.Wa.Models.Maintenance.BulkViewModel();
  218:  
  219:             Ia.Ftn.Wa.Models.Maintenance.Bulk.ViewModel(ref bulkViewModel, userManager, currentStaffIdentityUser);
  220:  
  221:             return View("Bulk", bulkViewModel);
  222:         }
  223:  
  224:         /////////////////////////////////////////////////////////////////////////////////
  225:  
  226:         /// <summary>
  227:         ///
  228:         /// </summary>
  229:         [HttpPost]
  230:         public IActionResult Bulk(Ia.Ftn.Wa.Models.Maintenance.BulkViewModel bulkViewModel)
  231:         {
  232:             var currentStaffIdentityUser = Ia.Ftn.Cl.Models.Data.StaffIdentityUser.CurrentStaffIdentityUser(userManager, User);
  233:  
  234:             Ia.Ftn.Wa.Models.Maintenance.Bulk.Post(ref bulkViewModel, userManager, currentStaffIdentityUser);
  235:  
  236:             Ia.Ftn.Wa.Models.Maintenance.Bulk.ViewModel(ref bulkViewModel, userManager, currentStaffIdentityUser);
  237:  
  238:             return View("Bulk", bulkViewModel);
  239:         }
  240:  
  241:         /////////////////////////////////////////////////////////////////////////////////
  242:         /////////////////////////////////////////////////////////////////////////////////
  243:  
  244:         /// <summary>
  245:         ///
  246:         /// </summary>
  247:         [Route("/maintenance/transaction")]
  248:         public IActionResult Transaction()
  249:         {
  250:             return View();
  251:         }
  252:  
  253:         /////////////////////////////////////////////////////////////////////////////////
  254:  
  255:         /// <summary>
  256:         ///
  257:         /// </summary>
  258:         [HttpGet]
  259:         [Route("/maintenance/transaction/ams")]
  260:         public IActionResult Ams()
  261:         {
  262:             var transactionViewModel = new Ia.Ftn.Wa.Models.Maintenance.TransactionViewModel();
  263:  
  264:             Ia.Ftn.Wa.Models.Maintenance.Transaction.ViewModel(ref transactionViewModel);
  265:  
  266:             return View("Ams", transactionViewModel);
  267:         }
  268:  
  269:         /////////////////////////////////////////////////////////////////////////////////
  270:  
  271:         /// <summary>
  272:         ///
  273:         /// </summary>
  274:         [HttpPost]
  275:         [Route("/maintenance/transaction/ams")]
  276:         public IActionResult Ams(Ia.Ftn.Wa.Models.Maintenance.TransactionViewModel transactionViewModel)
  277:         {
  278:             Ia.Ftn.Wa.Models.Maintenance.Transaction.Post(ref transactionViewModel);
  279:  
  280:             Ia.Ftn.Wa.Models.Maintenance.Transaction.ViewModel(ref transactionViewModel);
  281:  
  282:             return View("Ams", transactionViewModel);
  283:         }
  284:  
  285:         /////////////////////////////////////////////////////////////////////////////////
  286:         /////////////////////////////////////////////////////////////////////////////////
  287:  
  288:         /// <summary>
  289:         ///
  290:         /// </summary>
  291:         [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  292:         public IActionResult Error()
  293:         {
  294:             return View(new Ia.Ftn.Wa.Models.ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
  295:         }
  296:  
  297:         /////////////////////////////////////////////////////////////////////////////////
  298:         /////////////////////////////////////////////////////////////////////////////////
  299:     }
  300:  
  301:     /////////////////////////////////////////////////////////////////////////////////
  302:     /////////////////////////////////////////////////////////////////////////////////
  303: }