)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » DefaultController (Ia.Learning.Kanji.Wa.Controllers)

Public general use code classes and xml files that we've compiled and used over the years:

    1: using Microsoft.AspNetCore.Http;
    2: using Microsoft.AspNetCore.Mvc;
    3: using Microsoft.EntityFrameworkCore.Metadata.Internal;
    4: using System.Net;
    5:  
    6: namespace Ia.Learning.Kanji.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 DefaultController : Controller
   28:     {
   29:         ////////////////////////////////////////////////////////////////////////////
   30:  
   31:         /// <summary>
   32:         ///
   33:         /// </summary>
   34:         public ActionResult Index()
   35:         {
   36:             var indexViewModel = new Ia.Learning.Kanji.Wa.Models.Default.IndexViewModel();
   37:  
   38:             indexViewModel.GradeOneList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 1 select k).ToList();
   39:             indexViewModel.GradeTwoList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 2 select k).ToList();
   40:             indexViewModel.GradeThreeList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 3 select k).ToList();
   41:             indexViewModel.GradeFourList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 4 select k).ToList();
   42:             indexViewModel.GradeFiveList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 5 select k).ToList();
   43:             indexViewModel.GradeSixList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 6 select k).ToList();
   44:             indexViewModel.GeneralGradeList = (from k in Ia.Learning.Cl.Models.Data.Kanji.List where k.Grade == 7 select k).ToList();
   45:  
   46:             return View(indexViewModel);
   47:         }
   48:  
   49:         ////////////////////////////////////////////////////////////////////////////
   50:  
   51:         /// <summary>
   52:         ///
   53:         /// </summary>
   54:         [HttpPost]
   55:         public ActionResult Search(Ia.Learning.Kanji.Wa.Models.Default.IndexViewModel indexViewModel)
   56:         {
   57:             var textInput = WebUtility.HtmlEncode(indexViewModel.TextInput);
   58:  
   59:             if (!string.IsNullOrEmpty(textInput))
   60:             {
   61:                 indexViewModel.SearchList = Ia.Learning.Kanji.Models.Business.Default.Search(textInput, out Ia.Cl.Models.Result result);
   62:  
   63:                 indexViewModel.Result = result;
   64:             }
   65:             else
   66:             {
   67:             }
   68:  
   69:             return View("Index", indexViewModel);
   70:         }
   71:  
   72:         ////////////////////////////////////////////////////////////////////////////
   73:         ////////////////////////////////////////////////////////////////////////////
   74:     }
   75:  
   76:     ////////////////////////////////////////////////////////////////////////////
   77:     ////////////////////////////////////////////////////////////////////////////
   78: }