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

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

Administration support class for Fixed Telecommunications Network (FTN) web application (Intranet) model.

    1:  
    2: namespace Ia.Ftn.Wa.Models.Business
    3: {
    4:     ////////////////////////////////////////////////////////////////////////////
    5:  
    6:     /// <summary publish="true">
    7:     /// Administration support class for Fixed Telecommunications Network (FTN) web application (Intranet) model.
    8:     /// </summary>
    9:     /// 
   10:     /// <remarks> 
   11:     /// Copyright © 2006-2024 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   12:     ///
   13:     /// 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
   14:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   15:     ///
   16:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   17:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   18:     /// 
   19:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   20:     /// 
   21:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   22:     /// </remarks> 
   23:     public class Default
   24:     {
   25:         private static readonly string key = "HeartbeatAssemblyNameToCreatedDateTimeDictionary";
   26:  
   27:         /// <summary/>
   28:         public static Dictionary<string, DateTime> HeartbeatAssemblyNameToCreatedDateTimeDictionary
   29:         {
   30:             get
   31:             {
   32:                 var dictionary = (Dictionary<string, DateTime>)Ia.Cl.Models.Cache.Instance.Get(key);
   33:  
   34:                 if (dictionary == null) dictionary = new Dictionary<string, DateTime>();
   35:  
   36:                 return dictionary;
   37:             }
   38:             set
   39:             {
   40:                 Ia.Cl.Models.Cache.Instance.Set(key, value);
   41:             }
   42:         }
   43:  
   44:         ////////////////////////////////////////////////////////////////////////////
   45:  
   46:         /// <summary>
   47:         ///
   48:         /// </summary>
   49:         public Default()
   50:         {
   51:         }
   52:  
   53:         ////////////////////////////////////////////////////////////////////////////
   54:  
   55:         /// <summary>
   56:         ///
   57:         /// </summary>
   58:         public static void ManageEnqueueHeartbeat()
   59:         {
   60:             Ia.Ftn.Cl.Models.Data.MessageQueue.SecretaryApplication.Enqueue(Ia.Ftn.Cl.Models.Business.MessageQueue.Application.FtnApplication, Ia.Ftn.Cl.Models.Business.MessageQueue.Process.Heartbeat);
   61:         }
   62:  
   63:         ////////////////////////////////////////////////////////////////////////////
   64:  
   65:         /// <summary>
   66:         ///
   67:         /// </summary>
   68:         public static void ManageMessageQueue()
   69:         {
   70:             var queueCount = Ia.Ftn.Cl.Models.Data.MessageQueue.FtnApplication.Count;
   71:  
   72:             if (queueCount > 0)
   73:             {
   74:                 var message = Ia.Ftn.Cl.Models.Data.MessageQueue.FtnApplication.Dequeue;
   75:  
   76:                 if (message != null)
   77:                 {
   78:                     if (message.Process == Ia.Ftn.Cl.Models.Business.MessageQueue.Process.ReadService)
   79:                     {
   80:  
   81:                     }
   82:                     else if (message.Process == Ia.Ftn.Cl.Models.Business.MessageQueue.Process.Message)
   83:                     {
   84:                         HeartbeatAssemblyNameToCreatedDateTimeDictionary = message.DeserializePayload<Dictionary<string, DateTime>>();
   85:                     }
   86:                     else if (message.Process == Ia.Ftn.Cl.Models.Business.MessageQueue.Process.ActiveApplicationRunningPermissionState)
   87:                     {
   88:                         //Ia.Ftn.Cl.Model.Business.Default.PermitActiveApplicationsToRun = message.State;
   89:  
   90:                         //r.AddSuccess("PermitActiveApplicationsToRun: " + message.State);
   91:                     }
   92:                     else
   93:                     {
   94:                         throw new ArgumentOutOfRangeException("MSMQ process " + message.Process.ToString() + " is undefined");
   95:                     }
   96:                 }
   97:             }
   98:         }
   99:  
  100:         ////////////////////////////////////////////////////////////////////////////
  101:         ////////////////////////////////////////////////////////////////////////////   
  102:     }
  103:  
  104:     ////////////////////////////////////////////////////////////////////////////
  105:     ////////////////////////////////////////////////////////////////////////////   
  106: }