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