Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » AmsTransaction

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

Nokia AmsTransaction Entity Framework class for Next Generation Network (NGN) business model.

   1:  using System;
   2:  using System.Data;
   3:  using System.Collections.Generic;
   4:  using System.Linq;
   5:  using System.Text;
   6:  using System.Text.RegularExpressions;
   7:  using System.Collections;
   8:  using System.IO;
   9:   
  10:  namespace Ia.Ngn.Cl.Model.Nokia.Business
  11:  {
  12:      ////////////////////////////////////////////////////////////////////////////
  13:   
  14:      /// <summary publish="true">
  15:      /// Nokia AmsTransaction Entity Framework class for Next Generation Network (NGN) business model.
  16:      /// </summary>
  17:      /// 
  18:      /// <remarks> 
  19:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  20:      ///
  21:      /// 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
  22:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  23:      ///
  24:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  25:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  26:      /// 
  27:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  28:      /// 
  29:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  30:      /// </remarks> 
  31:      public partial class AmsTransaction
  32:      {
  33:          ////////////////////////////////////////////////////////////////////////////
  34:   
  35:          /// <summary>
  36:          ///
  37:          /// </summary>
  38:          public AmsTransaction() { }
  39:   
  40:          ////////////////////////////////////////////////////////////////////////////    
  41:          ////////////////////////////////////////////////////////////////////////////
  42:   
  43:          /// <summary>
  44:          /// 
  45:          /// </summary>
  46:          public static void Search(string rowInput, out List<Ia.Ngn.Cl.Model.Nokia.AmsTransaction> amsTransactionList, out Ia.Cl.Model.Result result)
  47:          {
  48:              bool inputIsValid;
  49:              string input;
  50:   
  51:              result = new Ia.Cl.Model.Result();
  52:              amsTransactionList = new List<Ia.Ngn.Cl.Model.Nokia.AmsTransaction>();
  53:   
  54:              if (!string.IsNullOrEmpty(rowInput))
  55:              {
  56:                  rowInput = rowInput.Trim();
  57:                  input = rowInput.ToLower();
  58:   
  59:                  if (input.Length > 0)
  60:                  {
  61:                      inputIsValid = true;
  62:   
  63:                      input = rowInput.ToLower();
  64:   
  65:                      try
  66:                      {
  67:                          using (var db = new Ia.Ngn.Cl.Model.Ngn())
  68:                          {
  69:                              amsTransactionList = (from at in db.AmsTransactions
  70:                                                    where at.EventTime.ToString().Contains(input)
  71:                                                    || at.User.Contains(input)
  72:                                                    || at.Application.Contains(input)
  73:                                                    || at.Operation.Contains(input)
  74:                                                    || at.Agent.Contains(input)
  75:                                                    || at.Object.Contains(input)
  76:                                                    || at.Argument.Contains(input)
  77:                                                    || at.Session.Contains(input)
  78:                                                    || at.Result.Contains(input)
  79:                                                    select at).Take(500).ToList();
  80:                          }
  81:                      }
  82:                      catch (Exception ex)
  83:                      {
  84:                          result.AddError("Exception: Retrieval error of data for \"" + rowInput + "\": " + ex.ToString());
  85:                      }
  86:   
  87:                      if (inputIsValid)
  88:                      {
  89:                          if (amsTransactionList == null || amsTransactionList != null && amsTransactionList.Count == 0)
  90:                          {
  91:                              if (result.IsSuccessful)
  92:                              {
  93:                                  result.AddWarning("No data records were found for \"" + rowInput + "\" (لا توجد معلومات عن القيمة المعطاة). ");
  94:                              }
  95:                              else { };// result.AddError(result.Error);
  96:                          }
  97:                          else
  98:                          {
  99:                              if (result.IsSuccessful)
 100:                              {
 101:                                  if (!string.IsNullOrEmpty(result.Message)) result.AddSuccess(result.Message);
 102:                              }
 103:                              //else result.AddError(result.Error);
 104:                          }
 105:                      }
 106:                      else result.AddError("Input format is unknown (قيمة غير مفهومة). ");
 107:                  }
 108:                  else result.AddError("No input was entered (لم يتم إدخال أي شيء). ");
 109:              }
 110:              else result.AddError("Input is null or empty (لم يتم إدخال أي شيء). ");
 111:          }
 112:   
 113:          ////////////////////////////////////////////////////////////////////////////
 114:          ////////////////////////////////////////////////////////////////////////////   
 115:      }
 116:  }