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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » ServiceRequestType

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

Service Request Type 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 Type Entity Framework class for Next Generation Network (NGN) entity model.
  12:      /// </summary>
  13:      /// 
  14:      /// <remarks> 
  15:      /// Copyright © 2006-2017 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 ServiceRequestType //: ITriggerable
  28:      {
  29:          /// <summary/>
  30:          public ServiceRequestType()
  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 int Id { get; set; }
  40:   
  41:          /// <summary/>
  42:          public int TypeId { get; set; }
  43:   
  44:          /// <summary/>
  45:          public string Value { get; set; }
  46:   
  47:          /// <summary/>
  48:          public DateTime Created { get; set; }
  49:   
  50:          /// <summary/>
  51:          public DateTime Updated { get; set; }
  52:   
  53:          /// <summary/>
  54:          public System.Guid UserId { get; set; }
  55:   
  56:          /// <summary/>
  57:          [ForeignKey("ServiceRequest_Id")]
  58:          public virtual ServiceRequest ServiceRequest { get; set; }
  59:   
  60:          /// <summary/>
  61:          [NotMapped]
  62:          public static Queue<ServiceRequestType> TriggeredInstanceQueue = new Queue<ServiceRequestType>();
  63:   
  64:          ////////////////////////////////////////////////////////////////////////////
  65:   
  66:          /// <summary>
  67:          ///
  68:          /// </summary>
  69:          public bool Update(ServiceRequestType updatedServiceRequestType)
  70:          {
  71:              // below: this will not update Id, Created
  72:              bool updated;
  73:   
  74:              updated = false;
  75:   
  76:              if (this.TypeId != updatedServiceRequestType.TypeId) { this.TypeId = updatedServiceRequestType.TypeId; updated = true; }
  77:              if (this.Value != updatedServiceRequestType.Value) { this.Value = updatedServiceRequestType.Value; updated = true; }
  78:              if (this.UserId != updatedServiceRequestType.UserId) { this.UserId = updatedServiceRequestType.UserId; updated = true; }
  79:   
  80:              // below: ?? 
  81:              //if (this.ServiceRequest == null || this.ServiceRequest != updatedServiceRequestType.ServiceRequest) { this.ServiceRequest = updatedServiceRequestType.ServiceRequest; updated = true; }
  82:   
  83:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  84:   
  85:              return updated;
  86:          }
  87:   
  88:          ////////////////////////////////////////////////////////////////////////////
  89:          ////////////////////////////////////////////////////////////////////////////
  90:      }
  91:   
  92:      ////////////////////////////////////////////////////////////////////////////
  93:      ////////////////////////////////////////////////////////////////////////////
  94:  }