شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Report

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

Report support class for Next Generation Network (NGN) ui model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Data;
   4:  using System.Linq;
   5:  using System.Text;
   6:   
   7:  namespace Ia.Ngn.Cl.Model.Ui
   8:  {
   9:      ////////////////////////////////////////////////////////////////////////////
  10:   
  11:      /// <summary publish="true">
  12:      /// Report support class for Next Generation Network (NGN) ui model.
  13:      /// </summary>
  14:      /// 
  15:      /// <remarks> 
  16:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  17:      ///
  18:      /// 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
  19:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  20:      ///
  21:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  22:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23:      /// 
  24:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  25:      /// 
  26:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  27:      /// </remarks> 
  28:      public partial class Report
  29:      {
  30:          ////////////////////////////////////////////////////////////////////////////
  31:   
  32:          /// <summary>
  33:          ///
  34:          /// </summary>
  35:          public Report() { }
  36:   
  37:          ////////////////////////////////////////////////////////////////////////////
  38:   
  39:          /// <summary>
  40:          ///
  41:          /// </summary>
  42:          public static List<Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest> ReadSpecificUserIdListAndSiteIdReportWithReportOpenStatusList(List<Guid> userIdList, int siteId)
  43:          {
  44:              List<Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest> reportAccessServiceRequestList;
  45:   
  46:              reportAccessServiceRequestList = Ia.Ngn.Cl.Model.Data.Report.ReadSpecificUserIdListAndSiteIdReportWithReportOpenStatusList(userIdList, siteId);
  47:   
  48:              if (reportAccessServiceRequestList != null)
  49:              {
  50:                  reportAccessServiceRequestList = (from rasr in reportAccessServiceRequestList
  51:                                                    orderby (rasr.Access != null ? rasr.Access.AreaId : 0), (rasr.Access != null ? rasr.Access.Block : string.Empty), (rasr.Access != null ? rasr.Access.Street : string.Empty), (rasr.Access != null ? rasr.Access.PremisesOld : string.Empty) ascending
  52:                                                    select rasr).ToList();
  53:              }
  54:              else
  55:              {
  56:                  reportAccessServiceRequestList = new List<Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest>();
  57:              }
  58:   
  59:              return reportAccessServiceRequestList.ToList();
  60:          }
  61:   
  62:          ////////////////////////////////////////////////////////////////////////////
  63:          ////////////////////////////////////////////////////////////////////////////
  64:   
  65:          /// <summary>
  66:          ///
  67:          /// </summary>
  68:          public static DataTable ToSimpleTextDataTable(List<Guid> userIdList, int siteId)
  69:          {
  70:              // below:
  71:              DataRow dr;
  72:              DataTable dt;
  73:              List<Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest> reportAccessServiceRequestList;
  74:   
  75:              dt = new DataTable("");
  76:              dt.Columns.Add("Service");
  77:              dt.Columns.Add("Port");
  78:              dt.Columns.Add("Action");
  79:              dt.Columns.Add("Access/ONT Name");
  80:              dt.Columns.Add("Address");
  81:              dt.Columns.Add("Detail");
  82:              dt.Columns.Add("Note");
  83:              dt.Columns.Add("Contact");
  84:   
  85:              reportAccessServiceRequestList = Ia.Ngn.Cl.Model.Ui.Report.ReadSpecificUserIdListAndSiteIdReportWithReportOpenStatusList(userIdList, siteId);
  86:   
  87:              foreach (Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest reportAccessServiceRequest in reportAccessServiceRequestList)
  88:              {
  89:                  dr = dt.NewRow();
  90:   
  91:                  dr["Service"] = Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportAccessServiceRequest.Report.Service, reportAccessServiceRequest.Report.ServiceType);
  92:                  dr["Port"] = reportAccessServiceRequest.Port.ToString();
  93:                  dr["Action"] = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ActionDictionary[reportAccessServiceRequest.Report.LastReportHistory.Action].ToString() : string.Empty;
  94:                  dr["Access/ONT Name"] = ((reportAccessServiceRequest.Access != null) ? reportAccessServiceRequest.Access.Name : string.Empty);
  95:                  dr["Address"] = ((reportAccessServiceRequest.Access != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Access.Address) : string.Empty);
  96:                  dr["Detail"] = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Detail) : string.Empty;
  97:                  dr["Note"] = (reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Note) : string.Empty;
  98:                  dr["Contact"] = Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.Contact);
  99:   
 100:                  dt.Rows.Add(dr);
 101:              }
 102:   
 103:              return dt;
 104:          }
 105:   
 106:          ////////////////////////////////////////////////////////////////////////////
 107:          ////////////////////////////////////////////////////////////////////////////
 108:   
 109:          /// <summary>
 110:          ///
 111:          /// </summary>
 112:          public static string ToSimpleTextString(List<Guid> userIdList, int siteId)
 113:          {
 114:              StringBuilder sb;
 115:              List<Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest> reportAccessServiceRequestList;
 116:   
 117:              sb = new StringBuilder();
 118:   
 119:              reportAccessServiceRequestList = Ia.Ngn.Cl.Model.Ui.Report.ReadSpecificUserIdListAndSiteIdReportWithReportOpenStatusList(userIdList, siteId);
 120:   
 121:              foreach (Ia.Ngn.Cl.Model.Ui.ReportAccessServiceRequest reportAccessServiceRequest in reportAccessServiceRequestList)
 122:              {
 123:                  sb.AppendLine("Service: " + Ia.Ngn.Cl.Model.Business.Service.ServiceName(reportAccessServiceRequest.Report.Service, reportAccessServiceRequest.Report.ServiceType));
 124:                  sb.AppendLine("Port: " + reportAccessServiceRequest.Port.ToString());
 125:                  sb.AppendLine("Action: " + ((reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Ngn.Cl.Model.Data.Report.ActionDictionary[reportAccessServiceRequest.Report.LastReportHistory.Action].ToString() : string.Empty));
 126:                  sb.AppendLine("Access/ONT Name: " + ((reportAccessServiceRequest.Access != null) ? reportAccessServiceRequest.Access.Name : string.Empty));
 127:                  sb.AppendLine("Address: " + ((reportAccessServiceRequest.Access != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Access.Address) : string.Empty));
 128:                  sb.AppendLine("Detail: " + ((reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Detail) : string.Empty));
 129:                  sb.AppendLine("Note: " + ((reportAccessServiceRequest.Report.LastReportHistory != null) ? Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.LastReportHistory.Note) : string.Empty));
 130:                  sb.AppendLine("Contact: " + Ia.Cl.Model.Html.Decode(reportAccessServiceRequest.Report.Contact));
 131:                  sb.AppendLine(" ");
 132:              }
 133:   
 134:              return sb.ToString();
 135:          }
 136:   
 137:          ////////////////////////////////////////////////////////////////////////////
 138:          ////////////////////////////////////////////////////////////////////////////   
 139:   
 140:      }
 141:   
 142:      ////////////////////////////////////////////////////////////////////////////
 143:      ////////////////////////////////////////////////////////////////////////////   
 144:  }