)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » ContactController (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.Mvc;
    3: using System.Diagnostics;
    4: using System.Net;
    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 ContactController : Controller
   19:     {
   20:         /////////////////////////////////////////////////////////////////////////////////
   21:  
   22:         /// <summary>
   23:         ///
   24:         /// </summary>
   25:         [HttpGet]
   26:         public IActionResult Index()
   27:         {
   28:             return View();
   29:         }
   30:  
   31:         /////////////////////////////////////////////////////////////////////////////////
   32:  
   33:         /// <summary>
   34:         ///
   35:         /// </summary>
   36:         [HttpPost]
   37:         public IActionResult Index(string nameTextInput, string emailTextInput, string phoneTextInput, string inquiryTextArea)
   38:         {
   39:             var result = Ia.Ftn.Wa.Models.Contact.Index.ProcessEmail(nameTextInput, emailTextInput, phoneTextInput, inquiryTextArea);
   40:  
   41:             if (result.IsSuccessful)
   42:             {
   43:                 ViewBag.ResultMessage = result.Message;
   44:                 ViewBag.ResultClass = "success";
   45:             }
   46:             else
   47:             {
   48:                 ViewBag.ResultMessage = result.Message;
   49:                 ViewBag.ResultClass = "error";
   50:             }
   51:  
   52:             return View();
   53:         }
   54:  
   55:         /////////////////////////////////////////////////////////////////////////////////
   56:         /////////////////////////////////////////////////////////////////////////////////
   57:  
   58:         /// <summary>
   59:         ///
   60:         /// </summary>
   61:         [HttpGet]
   62:         public IActionResult Print(string formName, string frameworkId, string userId, string actionCheckBoxSelectedItemValueList)
   63:         {
   64:             var content = string.Empty;
   65:  
   66:             var userIdList = new List<string>();
   67:             var actionCheckBoxSelectedItemValueIntList = new List<int>();
   68:  
   69:             if (!string.IsNullOrEmpty(formName))
   70:             {
   71:                 if (formName == "field-tnmd-supplier-workorder-form")
   72:                 {
   73:                     var s = WebUtility.UrlDecode(userId);
   74:  
   75:                     if (!string.IsNullOrEmpty(s))
   76:                     {
   77:                         foreach (string u in s.Split(' ')) userIdList.Add(u);
   78:                     }
   79:  
   80:                     s = WebUtility.UrlDecode(actionCheckBoxSelectedItemValueList);
   81:  
   82:                     if (!string.IsNullOrEmpty(s))
   83:                     {
   84:                         foreach (string u in s.Split(' ')) actionCheckBoxSelectedItemValueIntList.Add(int.Parse(u));
   85:                     }
   86:  
   87:                     content = Ia.Ftn.Wa.Models.Business.Administration.PrepareFieldTnmdSupplierWorkorderPaperForm(userIdList, frameworkId, actionCheckBoxSelectedItemValueIntList);
   88:                 }
   89:                 else
   90:                 {
   91:                 }
   92:             }
   93:  
   94:             return View(content);
   95:         }
   96:  
   97:         /////////////////////////////////////////////////////////////////////////////////
   98:         /////////////////////////////////////////////////////////////////////////////////
   99:  
  100:         /// <summary>
  101:         ///
  102:         /// </summary>
  103:         public IActionResult Support()
  104:         {
  105:             return View();
  106:         }
  107:  
  108:         /////////////////////////////////////////////////////////////////////////////////
  109:  
  110:         /// <summary>
  111:         ///
  112:         /// </summary>
  113:         [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  114:         public IActionResult Error()
  115:         {
  116:             return View(new Ia.Ftn.Wa.Models.ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
  117:         }
  118:  
  119:         /////////////////////////////////////////////////////////////////////////////////
  120:         /////////////////////////////////////////////////////////////////////////////////
  121:     }
  122:  
  123:     /////////////////////////////////////////////////////////////////////////////////
  124:     /////////////////////////////////////////////////////////////////////////////////
  125: }