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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » ServiceRequestOntDetail

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

Service Request Ont Detail Entity Framework class for Next Generation Network (NGN) entity model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.ComponentModel.DataAnnotations;
   4:  using System.ComponentModel.DataAnnotations.Schema;
   5:   
   6:  namespace Ia.Ngn.Cl.Model
   7:  {
   8:      ////////////////////////////////////////////////////////////////////////////
   9:   
  10:      /// <summary publish="true">
  11:      /// Service Request Ont Detail Entity Framework class for Next Generation Network (NGN) entity model.
  12:      /// </summary>
  13:      /// 
  14:      /// <remarks> 
  15:      /// Copyright © 2006-2018 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 ServiceRequestOntDetail //: ITriggerable
  28:      {
  29:          /// <summary/>
  30:          public ServiceRequestOntDetail()
  31:          {
  32:              //this.Triggers().Inserting += entry => { TriggeredInstanceQueue.Enqueue(entry.Entity); };
  33:              //this.Triggers().Updating += entry => { TriggeredInstanceQueue.Enqueue(entry.Entity); };
  34:              //this.Triggers().Deleting += entry => { TriggeredInstanceQueue.Enqueue(entry.Entity); };
  35:          }
  36:   
  37:          /// <summary/>
  38:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  39:          public string Id { get; set; }
  40:   
  41:          /// <summary/>
  42:          public int ServiceType { get; set; }
  43:   
  44:          /// <summary/>
  45:          public int ServicePosition { get; set; }
  46:   
  47:          /// <summary/>
  48:          public string Service { get; set; }
  49:   
  50:          /// <summary/>
  51:          public DateTime Created { get; set; }
  52:   
  53:          /// <summary/>
  54:          public DateTime Updated { get; set; }
  55:   
  56:          /// <summary/>
  57:          [ForeignKey("ServiceRequestOnt_Id")]
  58:          public virtual ServiceRequestOnt ServiceRequestOnt { get; set; }
  59:   
  60:          /// <summary/>
  61:          [NotMapped]
  62:          public static Queue<ServiceRequestOntDetail> TriggeredInstanceQueue = new Queue<ServiceRequestOntDetail>();
  63:   
  64:          ////////////////////////////////////////////////////////////////////////////
  65:   
  66:          /// <summary>
  67:          ///
  68:          /// </summary>
  69:          public void Copy(ServiceRequestOntDetail serviceRequestOntDetail)
  70:          {
  71:              this.ServiceRequestOnt = serviceRequestOntDetail.ServiceRequestOnt;
  72:              this.Id = serviceRequestOntDetail.Id;
  73:              this.Created = serviceRequestOntDetail.Created;
  74:              this.Updated = serviceRequestOntDetail.Updated;
  75:   
  76:              this.ServiceType = serviceRequestOntDetail.ServiceType;
  77:              this.ServicePosition = serviceRequestOntDetail.ServicePosition;
  78:              this.Service = serviceRequestOntDetail.Service;
  79:          }
  80:   
  81:          ////////////////////////////////////////////////////////////////////////////
  82:   
  83:          /// <summary>
  84:          ///
  85:          /// </summary>
  86:          public bool Update(ServiceRequestOntDetail updatedServiceRequestOntDetail)
  87:          {
  88:              // below: this will not update Id, Created
  89:              bool updated;
  90:   
  91:              updated = false;
  92:   
  93:              if (this.ServiceRequestOnt != updatedServiceRequestOntDetail.ServiceRequestOnt) { this.ServiceRequestOnt = updatedServiceRequestOntDetail.ServiceRequestOnt; updated = true; }
  94:   
  95:              if (this.ServiceType != updatedServiceRequestOntDetail.ServiceType) { this.ServiceType = updatedServiceRequestOntDetail.ServiceType; updated = true; }
  96:              if (this.ServicePosition != updatedServiceRequestOntDetail.ServicePosition) { this.ServicePosition = updatedServiceRequestOntDetail.ServicePosition; updated = true; }
  97:              if (this.Service != updatedServiceRequestOntDetail.Service) { this.Service = updatedServiceRequestOntDetail.Service; updated = true; }
  98:   
  99:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 100:   
 101:              return updated;
 102:          }
 103:   
 104:          ////////////////////////////////////////////////////////////////////////////
 105:          ////////////////////////////////////////////////////////////////////////////
 106:      }
 107:   
 108:      ////////////////////////////////////////////////////////////////////////////
 109:      ////////////////////////////////////////////////////////////////////////////
 110:  }