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

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

Nokia AmsTransaction Entity Framework class for Fixed Telecommunications Network (FTN) business model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Data;
    4: using System.Linq;
    5:  
    6: namespace Ia.Ftn.Cl.Models.Nokia.Business
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     /// Nokia AmsTransaction Entity Framework class for Fixed Telecommunications Network (FTN) business model.
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2024 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 AmsTransaction
   28:     {
   29:         ////////////////////////////////////////////////////////////////////////////
   30:  
   31:         /// <summary>
   32:         ///
   33:         /// </summary>
   34:         public AmsTransaction() { }
   35:  
   36:         ////////////////////////////////////////////////////////////////////////////    
   37:         ////////////////////////////////////////////////////////////////////////////
   38:  
   39:         /// <summary>
   40:         /// 
   41:         /// </summary>
   42:         public static List<Ia.Ftn.Cl.Models.Nokia.AmsTransaction> Search(string rawInput, out Ia.Cl.Models.Result result)
   43:         {
   44:             bool inputIsValid;
   45:             string input;
   46:             List<Ia.Ftn.Cl.Models.Nokia.AmsTransaction> amsTransactionList;
   47:  
   48:             result = new Ia.Cl.Models.Result();
   49:             amsTransactionList = new List<Ia.Ftn.Cl.Models.Nokia.AmsTransaction>();
   50:  
   51:             if (!string.IsNullOrEmpty(rawInput))
   52:             {
   53:                 rawInput = rawInput.Trim();
   54:                 input = rawInput.ToLower();
   55:  
   56:                 if (input.Length > 0)
   57:                 {
   58:                     inputIsValid = true;
   59:  
   60:                     input = rawInput.ToLower();
   61:  
   62:                     try
   63:                     {
   64:                         using (var db = new Ia.Ftn.Cl.Db())
   65:                         {
   66:                             amsTransactionList = (from at in db.AmsTransactions
   67:                                                   where at.EventTime.ToString().Contains(input)
   68:                                                   || at.User.Contains(input)
   69:                                                   || at.Application.Contains(input)
   70:                                                   || at.Operation.Contains(input)
   71:                                                   || at.Agent.Contains(input)
   72:                                                   || at.Object.Contains(input)
   73:                                                   || at.Argument.Contains(input)
   74:                                                   || at.Session.Contains(input)
   75:                                                   || at.Result.Contains(input)
   76:                                                   select at).Take(500).ToList();
   77:                         }
   78:                     }
   79:                     catch (Exception ex)
   80:                     {
   81:                         result.AddError("Exception: Retrieval error of data for \"" + rawInput + "\": " + ex.ToString());
   82:                     }
   83:  
   84:                     if (inputIsValid)
   85:                     {
   86:                         if (amsTransactionList == null || amsTransactionList != null && amsTransactionList.Count == 0)
   87:                         {
   88:                             if (result.IsSuccessful)
   89:                             {
   90:                                 result.AddWarning("No data records were found for \"" + rawInput + "\" (لا توجد معلومات عن القيمة المعطاة). ");
   91:                             }
   92:                             else { };// result.AddError(result.Error);
   93:                         }
   94:                         else
   95:                         {
   96:                             if (result.IsSuccessful)
   97:                             {
   98:                                 if (!string.IsNullOrEmpty(result.Message)) result.AddSuccess(result.Message);
   99:                             }
  100:                             //else result.AddError(result.Error);
  101:                         }
  102:                     }
  103:                     else result.AddError("Input format is unknown (قيمة غير مفهومة). ");
  104:                 }
  105:                 else result.AddError("No input was entered (لم يتم إدخال أي شيء). ");
  106:             }
  107:             else result.AddError("Input is null or empty (لم يتم إدخال أي شيء). ");
  108:  
  109:             return amsTransactionList;
  110:         }
  111:  
  112:         ////////////////////////////////////////////////////////////////////////////
  113:         ////////////////////////////////////////////////////////////////////////////   
  114:     }
  115: }