)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
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:     /// </remarks> 
   19:     public static class Performance
   20:     {
   21:         ////////////////////////////////////////////////////////////////////////////
   22:  
   23:         /// <summary>
   24:         ///
   25:         /// </summary>
   26:         public static void ViewModel(ref Ia.Ftn.Wa.Models.Maintenance.PerformanceViewModel performanceViewModel)
   27:         {
   28:             var list = new List<SelectListItem>();
   29:  
   30:             list.Add(new SelectListItem("All Time", ""));
   31:             list.Add(new SelectListItem("A Year", "360"));
   32:             list.Add(new SelectListItem("Six Months", "180"));
   33:             list.Add(new SelectListItem("Three Months", "90"));
   34:             list.Add(new SelectListItem("One Month", "30"));
   35:  
   36:             performanceViewModel.FromSelectList = new SelectList(list, "Value", "Text");
   37:         }
   38:  
   39:         ////////////////////////////////////////////////////////////////////////////
   40:  
   41:         /// <summary>
   42:         ///
   43:         /// </summary>
   44:         public static void Post(ref Ia.Ftn.Wa.Models.Maintenance.PerformanceViewModel performanceViewModel)
   45:         {
   46:             var processId = performanceViewModel.FromSelectedValue;
   47:  
   48:             var result = new Ia.Cl.Models.Result();
   49:  
   50:             if (int.TryParse(performanceViewModel.FromSelectedValue, out int daysAgo)) { }
   51:             else daysAgo = 0;
   52:  
   53:             var list0 = Ia.Ftn.Cl.Models.Data.Administration.StaffAndFrameworkPerformanceReport(daysAgo);
   54:  
   55:             var list = list0.Where(u => u.FirstAndMiddleName != "غير معرف");
   56:  
   57:             performanceViewModel.PerformanceList = list.OrderByDescending(u => u.Attempted).ThenByDescending(u => u.Resolved).ToList();
   58:  
   59:  
   60:             performanceViewModel.ReportInsertionChart = new Ia.Cl.Models.Ui.Chart();
   61:             performanceViewModel.ReportInsertionChart.Id = "reportInsertionChart";
   62:  
   63:             var list1 = (from l in list orderby l.Inserted descending select l).Take(10).ToList();
   64:  
   65:             performanceViewModel.ReportInsertionChart.Labels = (from l in list1 orderby l.StaffIdentityUserId select l.FirstAndMiddleName).ToList();
   66:             performanceViewModel.ReportInsertionChart.Label1 = "Staff";
   67:             performanceViewModel.ReportInsertionChart.Data1 = (from l in list1 orderby l.StaffIdentityUserId select l.Inserted).ToList();
   68:             performanceViewModel.ReportInsertionChart.Type = "pie";
   69:             performanceViewModel.ReportInsertionChart.Width = 350;
   70:  
   71:             performanceViewModel.ReportInsertionChart.DataBind();
   72:  
   73:  
   74:             //var list2 = (from l in list orderby l.Migrated descending select l).Take(10).ToList();
   75:             //migrationChart.Labels = (from l in list2 orderby l.UserId select l.FirstAndMiddleName).ToList();
   76:             //migrationChart.Label1 = "Staff";
   77:             //migrationChart.Data1 = (from l in list2 orderby l.UserId select l.Migrated).ToList();
   78:             //migrationChart.DataBind();
   79:  
   80:  
   81:             performanceViewModel.StaffPerformanceChart = new Ia.Cl.Models.Ui.Chart();
   82:             performanceViewModel.StaffPerformanceChart.Id = "staffPerformanceChart";
   83:  
   84:             var list3 = (from l in list orderby (l.Inserted + l.Migrated + l.Attempted) descending select l).Take(20).ToList();
   85:  
   86:             performanceViewModel.StaffPerformanceChart.Labels = (from l in list3 orderby l.StaffIdentityUserId select l.FirstAndMiddleName).ToList();
   87:             performanceViewModel.StaffPerformanceChart.Label1 = "Attempted";
   88:             performanceViewModel.StaffPerformanceChart.Data1 = (from l in list3 orderby l.StaffIdentityUserId select l.Attempted).ToList();
   89:  
   90:             performanceViewModel.StaffPerformanceChart.Label2 = "Resolved";
   91:             performanceViewModel.StaffPerformanceChart.Data2 = (from l in list3 orderby l.StaffIdentityUserId select l.Resolved).ToList();
   92:  
   93:             performanceViewModel.StaffPerformanceChart.Label3 = "Migrated";
   94:             performanceViewModel.StaffPerformanceChart.Data3 = (from l in list3 orderby l.StaffIdentityUserId select l.Migrated).ToList();
   95:  
   96:             performanceViewModel.StaffPerformanceChart.Type = "bar";
   97:  
   98:             performanceViewModel.StaffPerformanceChart.DataBind();
   99:         }
  100:  
  101:         ////////////////////////////////////////////////////////////////////////////
  102:         ////////////////////////////////////////////////////////////////////////////
  103:     }
  104:  
  105:     ////////////////////////////////////////////////////////////////////////////
  106:     ////////////////////////////////////////////////////////////////////////////
  107: }