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

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

    1: using Microsoft.AspNetCore.Identity;
    2: using Microsoft.AspNetCore.Mvc.Rendering;
    3: using Microsoft.EntityFrameworkCore;
    4: using System.Data;
    5: using System.Net;
    6: using System.Text.RegularExpressions;
    7:  
    8: namespace Ia.Ftn.Wa.Models.Maintenance
    9: {
   10:     ////////////////////////////////////////////////////////////////////////////
   11:  
   12:     /// <summary publish="true">
   13:     ///
   14:     /// </summary>
   15:     /// 
   16:     /// <remarks> 
   17:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   18:     ///
   19:     /// 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
   20:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   21:     ///
   22:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   23:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   24:     /// 
   25:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   26:     /// 
   27:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   28:     /// </remarks> 
   29:     public static class Performance
   30:     {
   31:         ////////////////////////////////////////////////////////////////////////////
   32:  
   33:         /// <summary>
   34:         ///
   35:         /// </summary>
   36:         public static void ViewModel(ref Ia.Ftn.Wa.Models.Maintenance.PerformanceViewModel performanceViewModel)
   37:         {
   38:             var list = new List<SelectListItem>();
   39:  
   40:             list.Add(new SelectListItem("All Time", ""));
   41:             list.Add(new SelectListItem("A Year", "360"));
   42:             list.Add(new SelectListItem("Six Months", "180"));
   43:             list.Add(new SelectListItem("Three Months", "90"));
   44:             list.Add(new SelectListItem("One Month", "30"));
   45:  
   46:             performanceViewModel.FromSelectList = new SelectList(list, "Value", "Text");
   47:         }
   48:  
   49:         ////////////////////////////////////////////////////////////////////////////
   50:  
   51:         /// <summary>
   52:         ///
   53:         /// </summary>
   54:         public static void Post(ref Ia.Ftn.Wa.Models.Maintenance.PerformanceViewModel performanceViewModel)
   55:         {
   56:             var processId = performanceViewModel.FromSelectedValue;
   57:  
   58:             var result = new Ia.Cl.Models.Result();
   59:  
   60:             if (int.TryParse(performanceViewModel.FromSelectedValue, out int daysAgo)) { }
   61:             else daysAgo = 0;
   62:  
   63:             var list0 = Ia.Ftn.Cl.Models.Data.Administration.StaffAndFrameworkPerformanceReport(daysAgo);
   64:  
   65:             var list = list0.Where(u => u.FirstAndMiddleName != "غير معرف");
   66:  
   67:             performanceViewModel.PerformanceList = list.OrderByDescending(u => u.Attempted).ThenByDescending(u => u.Resolved).ToList();
   68:  
   69:  
   70:             performanceViewModel.ReportInsertionChart = new Ia.Cl.Models.Ui.Chart();
   71:             performanceViewModel.ReportInsertionChart.Id = "reportInsertionChart";
   72:  
   73:             var list1 = (from l in list orderby l.Inserted descending select l).Take(10).ToList();
   74:  
   75:             performanceViewModel.ReportInsertionChart.Labels = (from l in list1 orderby l.StaffIdentityUserId select l.FirstAndMiddleName).ToList();
   76:             performanceViewModel.ReportInsertionChart.Label1 = "Staff";
   77:             performanceViewModel.ReportInsertionChart.Data1 = (from l in list1 orderby l.StaffIdentityUserId select l.Inserted).ToList();
   78:             performanceViewModel.ReportInsertionChart.Type = "pie";
   79:             performanceViewModel.ReportInsertionChart.Width = 350;
   80:  
   81:             performanceViewModel.ReportInsertionChart.DataBind();
   82:  
   83:  
   84:             //var list2 = (from l in list orderby l.Migrated descending select l).Take(10).ToList();
   85:             //migrationChart.Labels = (from l in list2 orderby l.UserId select l.FirstAndMiddleName).ToList();
   86:             //migrationChart.Label1 = "Staff";
   87:             //migrationChart.Data1 = (from l in list2 orderby l.UserId select l.Migrated).ToList();
   88:             //migrationChart.DataBind();
   89:  
   90:  
   91:             performanceViewModel.StaffPerformanceChart = new Ia.Cl.Models.Ui.Chart();
   92:             performanceViewModel.StaffPerformanceChart.Id = "staffPerformanceChart";
   93:  
   94:             var list3 = (from l in list orderby (l.Inserted + l.Migrated + l.Attempted) descending select l).Take(20).ToList();
   95:  
   96:             performanceViewModel.StaffPerformanceChart.Labels = (from l in list3 orderby l.StaffIdentityUserId select l.FirstAndMiddleName).ToList();
   97:             performanceViewModel.StaffPerformanceChart.Label1 = "Attempted";
   98:             performanceViewModel.StaffPerformanceChart.Data1 = (from l in list3 orderby l.StaffIdentityUserId select l.Attempted).ToList();
   99:  
  100:             performanceViewModel.StaffPerformanceChart.Label2 = "Resolved";
  101:             performanceViewModel.StaffPerformanceChart.Data2 = (from l in list3 orderby l.StaffIdentityUserId select l.Resolved).ToList();
  102:  
  103:             performanceViewModel.StaffPerformanceChart.Label3 = "Migrated";
  104:             performanceViewModel.StaffPerformanceChart.Data3 = (from l in list3 orderby l.StaffIdentityUserId select l.Migrated).ToList();
  105:  
  106:             performanceViewModel.StaffPerformanceChart.Type = "bar";
  107:  
  108:             performanceViewModel.StaffPerformanceChart.DataBind();
  109:         }
  110:  
  111:         ////////////////////////////////////////////////////////////////////////////
  112:         ////////////////////////////////////////////////////////////////////////////
  113:     }
  114:  
  115:     ////////////////////////////////////////////////////////////////////////////
  116:     ////////////////////////////////////////////////////////////////////////////
  117: }