Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HiveDataContext.cs @ 4133

Last change on this file since 4133 was 3931, checked in by kgrading, 14 years ago

added minor speedups and better transaction handling to the server (#828)

File size: 70.2 KB
Line 
1#pragma warning disable 1591
2//------------------------------------------------------------------------------
3// <auto-generated>
4//     This code was generated by a tool.
5//     Runtime Version:2.0.50727.4927
6//
7//     Changes to this file may cause incorrect behavior and will be lost if
8//     the code is regenerated.
9// </auto-generated>
10//------------------------------------------------------------------------------
11
12namespace HeuristicLab.Hive.Server.LINQDataAccess
13{
14  using System.Data.Linq;
15  using System.Data.Linq.Mapping;
16  using System.Data;
17  using System.Collections.Generic;
18  using System.Reflection;
19  using System.Linq;
20  using System.Linq.Expressions;
21  using System.ComponentModel;
22  using System;
23 
24 
25  [System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive.Linq.Test")]
26  public partial class HiveDataContext : System.Data.Linq.DataContext
27  {
28   
29    private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
30   
31    #region Extensibility Method Definitions
32    partial void OnCreated();
33    partial void InsertAssignedResource(AssignedResource instance);
34    partial void UpdateAssignedResource(AssignedResource instance);
35    partial void DeleteAssignedResource(AssignedResource instance);
36    partial void InsertUptimeStatistic(UptimeStatistic instance);
37    partial void UpdateUptimeStatistic(UptimeStatistic instance);
38    partial void DeleteUptimeStatistic(UptimeStatistic instance);
39    partial void InsertClientConfig(ClientConfig instance);
40    partial void UpdateClientConfig(ClientConfig instance);
41    partial void DeleteClientConfig(ClientConfig instance);
42    partial void InsertClientGroup_Resource(ClientGroup_Resource instance);
43    partial void UpdateClientGroup_Resource(ClientGroup_Resource instance);
44    partial void DeleteClientGroup_Resource(ClientGroup_Resource instance);
45    partial void InsertPluginInfo(PluginInfo instance);
46    partial void UpdatePluginInfo(PluginInfo instance);
47    partial void DeletePluginInfo(PluginInfo instance);
48    partial void InsertProject(Project instance);
49    partial void UpdateProject(Project instance);
50    partial void DeleteProject(Project instance);
51    partial void InsertRequiredPlugin(RequiredPlugin instance);
52    partial void UpdateRequiredPlugin(RequiredPlugin instance);
53    partial void DeleteRequiredPlugin(RequiredPlugin instance);
54    partial void InsertResource(Resource instance);
55    partial void UpdateResource(Resource instance);
56    partial void DeleteResource(Resource instance);
57    partial void InsertJob(Job instance);
58    partial void UpdateJob(Job instance);
59    partial void DeleteJob(Job instance);
60    partial void InsertUptimeCalendar(UptimeCalendar instance);
61    partial void UpdateUptimeCalendar(UptimeCalendar instance);
62    partial void DeleteUptimeCalendar(UptimeCalendar instance);
63    #endregion
64   
65    public HiveDataContext(string connection) :
66        base(connection, mappingSource)
67    {
68      OnCreated();
69    }
70   
71    public HiveDataContext(System.Data.IDbConnection connection) :
72        base(connection, mappingSource)
73    {
74      OnCreated();
75    }
76   
77    public HiveDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
78        base(connection, mappingSource)
79    {
80      OnCreated();
81    }
82   
83    public HiveDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
84        base(connection, mappingSource)
85    {
86      OnCreated();
87    }
88   
89    public System.Data.Linq.Table<AssignedResource> AssignedResources
90    {
91      get
92      {
93        return this.GetTable<AssignedResource>();
94      }
95    }
96   
97    public System.Data.Linq.Table<UptimeStatistic> UptimeStatistics
98    {
99      get
100      {
101        return this.GetTable<UptimeStatistic>();
102      }
103    }
104   
105    public System.Data.Linq.Table<ClientConfig> ClientConfigs
106    {
107      get
108      {
109        return this.GetTable<ClientConfig>();
110      }
111    }
112   
113    public System.Data.Linq.Table<ClientGroup_Resource> ClientGroup_Resources
114    {
115      get
116      {
117        return this.GetTable<ClientGroup_Resource>();
118      }
119    }
120   
121    public System.Data.Linq.Table<PluginInfo> PluginInfos
122    {
123      get
124      {
125        return this.GetTable<PluginInfo>();
126      }
127    }
128   
129    public System.Data.Linq.Table<Project> Projects
130    {
131      get
132      {
133        return this.GetTable<Project>();
134      }
135    }
136   
137    public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
138    {
139      get
140      {
141        return this.GetTable<RequiredPlugin>();
142      }
143    }
144   
145    public System.Data.Linq.Table<Resource> Resources
146    {
147      get
148      {
149        return this.GetTable<Resource>();
150      }
151    }
152   
153    public System.Data.Linq.Table<Job> Jobs
154    {
155      get
156      {
157        return this.GetTable<Job>();
158      }
159    }
160   
161    public System.Data.Linq.Table<UptimeCalendar> UptimeCalendars
162    {
163      get
164      {
165        return this.GetTable<UptimeCalendar>();
166      }
167    }
168  }
169 
170  [Table(Name="dbo.AssignedResources")]
171  public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
172  {
173   
174    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
175   
176    private System.Guid _ResourceId;
177   
178    private System.Guid _JobId;
179   
180    private System.Guid _AssignedRessourcesId;
181   
182    private EntityRef<Resource> _Resource;
183   
184    private EntityRef<Job> _Job;
185   
186    #region Extensibility Method Definitions
187    partial void OnLoaded();
188    partial void OnValidate(System.Data.Linq.ChangeAction action);
189    partial void OnCreated();
190    partial void OnResourceIdChanging(System.Guid value);
191    partial void OnResourceIdChanged();
192    partial void OnJobIdChanging(System.Guid value);
193    partial void OnJobIdChanged();
194    partial void OnAssignedRessourcesIdChanging(System.Guid value);
195    partial void OnAssignedRessourcesIdChanged();
196    #endregion
197   
198    public AssignedResource()
199    {
200      this._Resource = default(EntityRef<Resource>);
201      this._Job = default(EntityRef<Job>);
202      OnCreated();
203    }
204   
205    [Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
206    public System.Guid ResourceId
207    {
208      get
209      {
210        return this._ResourceId;
211      }
212      set
213      {
214        if ((this._ResourceId != value))
215        {
216          if (this._Resource.HasLoadedOrAssignedValue)
217          {
218            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
219          }
220          this.OnResourceIdChanging(value);
221          this.SendPropertyChanging();
222          this._ResourceId = value;
223          this.SendPropertyChanged("ResourceId");
224          this.OnResourceIdChanged();
225        }
226      }
227    }
228   
229    [Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
230    public System.Guid JobId
231    {
232      get
233      {
234        return this._JobId;
235      }
236      set
237      {
238        if ((this._JobId != value))
239        {
240          if (this._Job.HasLoadedOrAssignedValue)
241          {
242            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
243          }
244          this.OnJobIdChanging(value);
245          this.SendPropertyChanging();
246          this._JobId = value;
247          this.SendPropertyChanged("JobId");
248          this.OnJobIdChanged();
249        }
250      }
251    }
252   
253    [Column(Storage="_AssignedRessourcesId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
254    public System.Guid AssignedRessourcesId
255    {
256      get
257      {
258        return this._AssignedRessourcesId;
259      }
260      set
261      {
262        if ((this._AssignedRessourcesId != value))
263        {
264          this.OnAssignedRessourcesIdChanging(value);
265          this.SendPropertyChanging();
266          this._AssignedRessourcesId = value;
267          this.SendPropertyChanged("AssignedRessourcesId");
268          this.OnAssignedRessourcesIdChanged();
269        }
270      }
271    }
272   
273    [Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
274    public Resource Resource
275    {
276      get
277      {
278        return this._Resource.Entity;
279      }
280      set
281      {
282        Resource previousValue = this._Resource.Entity;
283        if (((previousValue != value)
284              || (this._Resource.HasLoadedOrAssignedValue == false)))
285        {
286          this.SendPropertyChanging();
287          if ((previousValue != null))
288          {
289            this._Resource.Entity = null;
290            previousValue.AssignedResources.Remove(this);
291          }
292          this._Resource.Entity = value;
293          if ((value != null))
294          {
295            value.AssignedResources.Add(this);
296            this._ResourceId = value.ResourceId;
297          }
298          else
299          {
300            this._ResourceId = default(System.Guid);
301          }
302          this.SendPropertyChanged("Resource");
303        }
304      }
305    }
306   
307    [Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]
308    public Job Job
309    {
310      get
311      {
312        return this._Job.Entity;
313      }
314      set
315      {
316        Job previousValue = this._Job.Entity;
317        if (((previousValue != value)
318              || (this._Job.HasLoadedOrAssignedValue == false)))
319        {
320          this.SendPropertyChanging();
321          if ((previousValue != null))
322          {
323            this._Job.Entity = null;
324            previousValue.AssignedResources.Remove(this);
325          }
326          this._Job.Entity = value;
327          if ((value != null))
328          {
329            value.AssignedResources.Add(this);
330            this._JobId = value.JobId;
331          }
332          else
333          {
334            this._JobId = default(System.Guid);
335          }
336          this.SendPropertyChanged("Job");
337        }
338      }
339    }
340   
341    public event PropertyChangingEventHandler PropertyChanging;
342   
343    public event PropertyChangedEventHandler PropertyChanged;
344   
345    protected virtual void SendPropertyChanging()
346    {
347      if ((this.PropertyChanging != null))
348      {
349        this.PropertyChanging(this, emptyChangingEventArgs);
350      }
351    }
352   
353    protected virtual void SendPropertyChanged(String propertyName)
354    {
355      if ((this.PropertyChanged != null))
356      {
357        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
358      }
359    }
360  }
361 
362  [Table(Name="dbo.UptimeStatistics")]
363  public partial class UptimeStatistic : INotifyPropertyChanging, INotifyPropertyChanged
364  {
365   
366    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
367   
368    private System.Guid _UptimeStatisticsId;
369   
370    private System.DateTime _Login;
371   
372    private System.DateTime _Logout;
373   
374    private System.Guid _ResourceId;
375   
376    private EntityRef<Client> _Client;
377   
378    #region Extensibility Method Definitions
379    partial void OnLoaded();
380    partial void OnValidate(System.Data.Linq.ChangeAction action);
381    partial void OnCreated();
382    partial void OnUptimeStatisticsIdChanging(System.Guid value);
383    partial void OnUptimeStatisticsIdChanged();
384    partial void OnLoginChanging(System.DateTime value);
385    partial void OnLoginChanged();
386    partial void OnLogoutChanging(System.DateTime value);
387    partial void OnLogoutChanged();
388    partial void OnResourceIdChanging(System.Guid value);
389    partial void OnResourceIdChanged();
390    #endregion
391   
392    public UptimeStatistic()
393    {
394      this._Client = default(EntityRef<Client>);
395      OnCreated();
396    }
397   
398    [Column(Storage="_UptimeStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
399    public System.Guid UptimeStatisticsId
400    {
401      get
402      {
403        return this._UptimeStatisticsId;
404      }
405      set
406      {
407        if ((this._UptimeStatisticsId != value))
408        {
409          this.OnUptimeStatisticsIdChanging(value);
410          this.SendPropertyChanging();
411          this._UptimeStatisticsId = value;
412          this.SendPropertyChanged("UptimeStatisticsId");
413          this.OnUptimeStatisticsIdChanged();
414        }
415      }
416    }
417   
418    [Column(Storage="_Login", DbType="DateTime")]
419    public System.DateTime Login
420    {
421      get
422      {
423        return this._Login;
424      }
425      set
426      {
427        if ((this._Login != value))
428        {
429          this.OnLoginChanging(value);
430          this.SendPropertyChanging();
431          this._Login = value;
432          this.SendPropertyChanged("Login");
433          this.OnLoginChanged();
434        }
435      }
436    }
437   
438    [Column(Storage="_Logout", DbType="DateTime")]
439    public System.DateTime Logout
440    {
441      get
442      {
443        return this._Logout;
444      }
445      set
446      {
447        if ((this._Logout != value))
448        {
449          this.OnLogoutChanging(value);
450          this.SendPropertyChanging();
451          this._Logout = value;
452          this.SendPropertyChanged("Logout");
453          this.OnLogoutChanged();
454        }
455      }
456    }
457   
458    [Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
459    public System.Guid ResourceId
460    {
461      get
462      {
463        return this._ResourceId;
464      }
465      set
466      {
467        if ((this._ResourceId != value))
468        {
469          if (this._Client.HasLoadedOrAssignedValue)
470          {
471            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
472          }
473          this.OnResourceIdChanging(value);
474          this.SendPropertyChanging();
475          this._ResourceId = value;
476          this.SendPropertyChanged("ResourceId");
477          this.OnResourceIdChanged();
478        }
479      }
480    }
481   
482    [Association(Name="Client_UptimeStatistic", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
483    public Client Client
484    {
485      get
486      {
487        return this._Client.Entity;
488      }
489      set
490      {
491        Client previousValue = this._Client.Entity;
492        if (((previousValue != value)
493              || (this._Client.HasLoadedOrAssignedValue == false)))
494        {
495          this.SendPropertyChanging();
496          if ((previousValue != null))
497          {
498            this._Client.Entity = null;
499            previousValue.UptimeStatistics.Remove(this);
500          }
501          this._Client.Entity = value;
502          if ((value != null))
503          {
504            value.UptimeStatistics.Add(this);
505            this._ResourceId = value.ResourceId;
506          }
507          else
508          {
509            this._ResourceId = default(System.Guid);
510          }
511          this.SendPropertyChanged("Client");
512        }
513      }
514    }
515   
516    public event PropertyChangingEventHandler PropertyChanging;
517   
518    public event PropertyChangedEventHandler PropertyChanged;
519   
520    protected virtual void SendPropertyChanging()
521    {
522      if ((this.PropertyChanging != null))
523      {
524        this.PropertyChanging(this, emptyChangingEventArgs);
525      }
526    }
527   
528    protected virtual void SendPropertyChanged(String propertyName)
529    {
530      if ((this.PropertyChanged != null))
531      {
532        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
533      }
534    }
535  }
536 
537  [Table(Name="dbo.ClientConfig")]
538  public partial class ClientConfig : INotifyPropertyChanging, INotifyPropertyChanged
539  {
540   
541    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
542   
543    private System.Guid _ClientConfigId;
544   
545    private System.Xml.Linq.XElement _UpDownTimeCalendar;
546   
547    private System.Nullable<int> _HeartBeatIntervall;
548   
549    private EntitySet<Client> _Clients;
550   
551    #region Extensibility Method Definitions
552    partial void OnLoaded();
553    partial void OnValidate(System.Data.Linq.ChangeAction action);
554    partial void OnCreated();
555    partial void OnClientConfigIdChanging(System.Guid value);
556    partial void OnClientConfigIdChanged();
557    partial void OnUpDownTimeCalendarChanging(System.Xml.Linq.XElement value);
558    partial void OnUpDownTimeCalendarChanged();
559    partial void OnHeartBeatIntervallChanging(System.Nullable<int> value);
560    partial void OnHeartBeatIntervallChanged();
561    #endregion
562   
563    public ClientConfig()
564    {
565      this._Clients = new EntitySet<Client>(new Action<Client>(this.attach_Clients), new Action<Client>(this.detach_Clients));
566      OnCreated();
567    }
568   
569    [Column(Storage="_ClientConfigId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
570    public System.Guid ClientConfigId
571    {
572      get
573      {
574        return this._ClientConfigId;
575      }
576      set
577      {
578        if ((this._ClientConfigId != value))
579        {
580          this.OnClientConfigIdChanging(value);
581          this.SendPropertyChanging();
582          this._ClientConfigId = value;
583          this.SendPropertyChanged("ClientConfigId");
584          this.OnClientConfigIdChanged();
585        }
586      }
587    }
588   
589    [Column(Storage="_UpDownTimeCalendar", DbType="Xml", UpdateCheck=UpdateCheck.Never)]
590    public System.Xml.Linq.XElement UpDownTimeCalendar
591    {
592      get
593      {
594        return this._UpDownTimeCalendar;
595      }
596      set
597      {
598        if ((this._UpDownTimeCalendar != value))
599        {
600          this.OnUpDownTimeCalendarChanging(value);
601          this.SendPropertyChanging();
602          this._UpDownTimeCalendar = value;
603          this.SendPropertyChanged("UpDownTimeCalendar");
604          this.OnUpDownTimeCalendarChanged();
605        }
606      }
607    }
608   
609    [Column(Storage="_HeartBeatIntervall", DbType="Int")]
610    public System.Nullable<int> HeartBeatIntervall
611    {
612      get
613      {
614        return this._HeartBeatIntervall;
615      }
616      set
617      {
618        if ((this._HeartBeatIntervall != value))
619        {
620          this.OnHeartBeatIntervallChanging(value);
621          this.SendPropertyChanging();
622          this._HeartBeatIntervall = value;
623          this.SendPropertyChanged("HeartBeatIntervall");
624          this.OnHeartBeatIntervallChanged();
625        }
626      }
627    }
628   
629    [Association(Name="ClientConfig_Client", Storage="_Clients", ThisKey="ClientConfigId", OtherKey="ClientConfigId")]
630    public EntitySet<Client> Clients
631    {
632      get
633      {
634        return this._Clients;
635      }
636      set
637      {
638        this._Clients.Assign(value);
639      }
640    }
641   
642    public event PropertyChangingEventHandler PropertyChanging;
643   
644    public event PropertyChangedEventHandler PropertyChanged;
645   
646    protected virtual void SendPropertyChanging()
647    {
648      if ((this.PropertyChanging != null))
649      {
650        this.PropertyChanging(this, emptyChangingEventArgs);
651      }
652    }
653   
654    protected virtual void SendPropertyChanged(String propertyName)
655    {
656      if ((this.PropertyChanged != null))
657      {
658        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
659      }
660    }
661   
662    private void attach_Clients(Client entity)
663    {
664      this.SendPropertyChanging();
665      entity.ClientConfig = this;
666    }
667   
668    private void detach_Clients(Client entity)
669    {
670      this.SendPropertyChanging();
671      entity.ClientConfig = null;
672    }
673  }
674 
675  [Table(Name="dbo.ClientGroup_Resource")]
676  public partial class ClientGroup_Resource : INotifyPropertyChanging, INotifyPropertyChanged
677  {
678   
679    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
680   
681    private System.Guid _ClientGroup_RessourceId;
682   
683    private System.Guid _ClientGroupId;
684   
685    private System.Guid _ResourceId;
686   
687    private EntityRef<ClientGroup> _ClientGroup;
688   
689    private EntityRef<Resource> _Resource;
690   
691    #region Extensibility Method Definitions
692    partial void OnLoaded();
693    partial void OnValidate(System.Data.Linq.ChangeAction action);
694    partial void OnCreated();
695    partial void OnClientGroup_RessourceIdChanging(System.Guid value);
696    partial void OnClientGroup_RessourceIdChanged();
697    partial void OnClientGroupIdChanging(System.Guid value);
698    partial void OnClientGroupIdChanged();
699    partial void OnResourceIdChanging(System.Guid value);
700    partial void OnResourceIdChanged();
701    #endregion
702   
703    public ClientGroup_Resource()
704    {
705      this._ClientGroup = default(EntityRef<ClientGroup>);
706      this._Resource = default(EntityRef<Resource>);
707      OnCreated();
708    }
709   
710    [Column(Storage="_ClientGroup_RessourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
711    public System.Guid ClientGroup_RessourceId
712    {
713      get
714      {
715        return this._ClientGroup_RessourceId;
716      }
717      set
718      {
719        if ((this._ClientGroup_RessourceId != value))
720        {
721          this.OnClientGroup_RessourceIdChanging(value);
722          this.SendPropertyChanging();
723          this._ClientGroup_RessourceId = value;
724          this.SendPropertyChanged("ClientGroup_RessourceId");
725          this.OnClientGroup_RessourceIdChanged();
726        }
727      }
728    }
729   
730    [Column(Storage="_ClientGroupId", DbType="UniqueIdentifier NOT NULL")]
731    public System.Guid ClientGroupId
732    {
733      get
734      {
735        return this._ClientGroupId;
736      }
737      set
738      {
739        if ((this._ClientGroupId != value))
740        {
741          if (this._ClientGroup.HasLoadedOrAssignedValue)
742          {
743            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
744          }
745          this.OnClientGroupIdChanging(value);
746          this.SendPropertyChanging();
747          this._ClientGroupId = value;
748          this.SendPropertyChanged("ClientGroupId");
749          this.OnClientGroupIdChanged();
750        }
751      }
752    }
753   
754    [Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
755    public System.Guid ResourceId
756    {
757      get
758      {
759        return this._ResourceId;
760      }
761      set
762      {
763        if ((this._ResourceId != value))
764        {
765          if (this._Resource.HasLoadedOrAssignedValue)
766          {
767            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
768          }
769          this.OnResourceIdChanging(value);
770          this.SendPropertyChanging();
771          this._ResourceId = value;
772          this.SendPropertyChanged("ResourceId");
773          this.OnResourceIdChanged();
774        }
775      }
776    }
777   
778    [Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup", ThisKey="ClientGroupId", OtherKey="ResourceId", IsForeignKey=true)]
779    public ClientGroup ClientGroup
780    {
781      get
782      {
783        return this._ClientGroup.Entity;
784      }
785      set
786      {
787        ClientGroup previousValue = this._ClientGroup.Entity;
788        if (((previousValue != value)
789              || (this._ClientGroup.HasLoadedOrAssignedValue == false)))
790        {
791          this.SendPropertyChanging();
792          if ((previousValue != null))
793          {
794            this._ClientGroup.Entity = null;
795            previousValue.ClientGroup_Resources_Children.Remove(this);
796          }
797          this._ClientGroup.Entity = value;
798          if ((value != null))
799          {
800            value.ClientGroup_Resources_Children.Add(this);
801            this._ClientGroupId = value.ResourceId;
802          }
803          else
804          {
805            this._ClientGroupId = default(System.Guid);
806          }
807          this.SendPropertyChanged("ClientGroup");
808        }
809      }
810    }
811   
812    [Association(Name="Resource_ClientGroup_Resource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
813    public Resource Resource
814    {
815      get
816      {
817        return this._Resource.Entity;
818      }
819      set
820      {
821        Resource previousValue = this._Resource.Entity;
822        if (((previousValue != value)
823              || (this._Resource.HasLoadedOrAssignedValue == false)))
824        {
825          this.SendPropertyChanging();
826          if ((previousValue != null))
827          {
828            this._Resource.Entity = null;
829            previousValue.ClientGroup_Resources_Parents.Remove(this);
830          }
831          this._Resource.Entity = value;
832          if ((value != null))
833          {
834            value.ClientGroup_Resources_Parents.Add(this);
835            this._ResourceId = value.ResourceId;
836          }
837          else
838          {
839            this._ResourceId = default(System.Guid);
840          }
841          this.SendPropertyChanged("Resource");
842        }
843      }
844    }
845   
846    public event PropertyChangingEventHandler PropertyChanging;
847   
848    public event PropertyChangedEventHandler PropertyChanged;
849   
850    protected virtual void SendPropertyChanging()
851    {
852      if ((this.PropertyChanging != null))
853      {
854        this.PropertyChanging(this, emptyChangingEventArgs);
855      }
856    }
857   
858    protected virtual void SendPropertyChanged(String propertyName)
859    {
860      if ((this.PropertyChanged != null))
861      {
862        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
863      }
864    }
865  }
866 
867  [Table(Name="dbo.PluginInfo")]
868  public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged
869  {
870   
871    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
872   
873    private System.Guid _PluginId;
874   
875    private string _Name;
876   
877    private string _Version;
878   
879    private string _BuildDate;
880   
881    private EntitySet<RequiredPlugin> _RequiredPlugins;
882   
883    #region Extensibility Method Definitions
884    partial void OnLoaded();
885    partial void OnValidate(System.Data.Linq.ChangeAction action);
886    partial void OnCreated();
887    partial void OnPluginIdChanging(System.Guid value);
888    partial void OnPluginIdChanged();
889    partial void OnNameChanging(string value);
890    partial void OnNameChanged();
891    partial void OnVersionChanging(string value);
892    partial void OnVersionChanged();
893    partial void OnBuildDateChanging(string value);
894    partial void OnBuildDateChanged();
895    #endregion
896   
897    public PluginInfo()
898    {
899      this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
900      OnCreated();
901    }
902   
903    [Column(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
904    public System.Guid PluginId
905    {
906      get
907      {
908        return this._PluginId;
909      }
910      set
911      {
912        if ((this._PluginId != value))
913        {
914          this.OnPluginIdChanging(value);
915          this.SendPropertyChanging();
916          this._PluginId = value;
917          this.SendPropertyChanged("PluginId");
918          this.OnPluginIdChanged();
919        }
920      }
921    }
922   
923    [Column(Storage="_Name", DbType="VarChar(MAX)")]
924    public string Name
925    {
926      get
927      {
928        return this._Name;
929      }
930      set
931      {
932        if ((this._Name != value))
933        {
934          this.OnNameChanging(value);
935          this.SendPropertyChanging();
936          this._Name = value;
937          this.SendPropertyChanged("Name");
938          this.OnNameChanged();
939        }
940      }
941    }
942   
943    [Column(Storage="_Version", DbType="VarChar(MAX)")]
944    public string Version
945    {
946      get
947      {
948        return this._Version;
949      }
950      set
951      {
952        if ((this._Version != value))
953        {
954          this.OnVersionChanging(value);
955          this.SendPropertyChanging();
956          this._Version = value;
957          this.SendPropertyChanged("Version");
958          this.OnVersionChanged();
959        }
960      }
961    }
962   
963    [Column(Storage="_BuildDate", DbType="VarChar(20)")]
964    public string BuildDate
965    {
966      get
967      {
968        return this._BuildDate;
969      }
970      set
971      {
972        if ((this._BuildDate != value))
973        {
974          this.OnBuildDateChanging(value);
975          this.SendPropertyChanging();
976          this._BuildDate = value;
977          this.SendPropertyChanged("BuildDate");
978          this.OnBuildDateChanged();
979        }
980      }
981    }
982   
983    [Association(Name="PluginInfo_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")]
984    public EntitySet<RequiredPlugin> RequiredPlugins
985    {
986      get
987      {
988        return this._RequiredPlugins;
989      }
990      set
991      {
992        this._RequiredPlugins.Assign(value);
993      }
994    }
995   
996    public event PropertyChangingEventHandler PropertyChanging;
997   
998    public event PropertyChangedEventHandler PropertyChanged;
999   
1000    protected virtual void SendPropertyChanging()
1001    {
1002      if ((this.PropertyChanging != null))
1003      {
1004        this.PropertyChanging(this, emptyChangingEventArgs);
1005      }
1006    }
1007   
1008    protected virtual void SendPropertyChanged(String propertyName)
1009    {
1010      if ((this.PropertyChanged != null))
1011      {
1012        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1013      }
1014    }
1015   
1016    private void attach_RequiredPlugins(RequiredPlugin entity)
1017    {
1018      this.SendPropertyChanging();
1019      entity.PluginInfo = this;
1020    }
1021   
1022    private void detach_RequiredPlugins(RequiredPlugin entity)
1023    {
1024      this.SendPropertyChanging();
1025      entity.PluginInfo = null;
1026    }
1027  }
1028 
1029  [Table(Name="dbo.Project")]
1030  public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged
1031  {
1032   
1033    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1034   
1035    private System.Guid _ProjectId;
1036   
1037    private string _Name;
1038   
1039    private EntitySet<Job> _Jobs;
1040   
1041    #region Extensibility Method Definitions
1042    partial void OnLoaded();
1043    partial void OnValidate(System.Data.Linq.ChangeAction action);
1044    partial void OnCreated();
1045    partial void OnProjectIdChanging(System.Guid value);
1046    partial void OnProjectIdChanged();
1047    partial void OnNameChanging(string value);
1048    partial void OnNameChanged();
1049    #endregion
1050   
1051    public Project()
1052    {
1053      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
1054      OnCreated();
1055    }
1056   
1057    [Column(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
1058    public System.Guid ProjectId
1059    {
1060      get
1061      {
1062        return this._ProjectId;
1063      }
1064      set
1065      {
1066        if ((this._ProjectId != value))
1067        {
1068          this.OnProjectIdChanging(value);
1069          this.SendPropertyChanging();
1070          this._ProjectId = value;
1071          this.SendPropertyChanged("ProjectId");
1072          this.OnProjectIdChanged();
1073        }
1074      }
1075    }
1076   
1077    [Column(Storage="_Name", DbType="VarChar(MAX)")]
1078    public string Name
1079    {
1080      get
1081      {
1082        return this._Name;
1083      }
1084      set
1085      {
1086        if ((this._Name != value))
1087        {
1088          this.OnNameChanging(value);
1089          this.SendPropertyChanging();
1090          this._Name = value;
1091          this.SendPropertyChanged("Name");
1092          this.OnNameChanged();
1093        }
1094      }
1095    }
1096   
1097    [Association(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]
1098    public EntitySet<Job> Jobs
1099    {
1100      get
1101      {
1102        return this._Jobs;
1103      }
1104      set
1105      {
1106        this._Jobs.Assign(value);
1107      }
1108    }
1109   
1110    public event PropertyChangingEventHandler PropertyChanging;
1111   
1112    public event PropertyChangedEventHandler PropertyChanged;
1113   
1114    protected virtual void SendPropertyChanging()
1115    {
1116      if ((this.PropertyChanging != null))
1117      {
1118        this.PropertyChanging(this, emptyChangingEventArgs);
1119      }
1120    }
1121   
1122    protected virtual void SendPropertyChanged(String propertyName)
1123    {
1124      if ((this.PropertyChanged != null))
1125      {
1126        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1127      }
1128    }
1129   
1130    private void attach_Jobs(Job entity)
1131    {
1132      this.SendPropertyChanging();
1133      entity.Project = this;
1134    }
1135   
1136    private void detach_Jobs(Job entity)
1137    {
1138      this.SendPropertyChanging();
1139      entity.Project = null;
1140    }
1141  }
1142 
1143  [Table(Name="dbo.RequiredPlugins")]
1144  public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged
1145  {
1146   
1147    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1148   
1149    private System.Guid _RequiredPluginId;
1150   
1151    private System.Guid _JobId;
1152   
1153    private System.Guid _PluginId;
1154   
1155    private EntityRef<PluginInfo> _PluginInfo;
1156   
1157    private EntityRef<Job> _Job;
1158   
1159    #region Extensibility Method Definitions
1160    partial void OnLoaded();
1161    partial void OnValidate(System.Data.Linq.ChangeAction action);
1162    partial void OnCreated();
1163    partial void OnRequiredPluginIdChanging(System.Guid value);
1164    partial void OnRequiredPluginIdChanged();
1165    partial void OnJobIdChanging(System.Guid value);
1166    partial void OnJobIdChanged();
1167    partial void OnPluginIdChanging(System.Guid value);
1168    partial void OnPluginIdChanged();
1169    #endregion
1170   
1171    public RequiredPlugin()
1172    {
1173      this._PluginInfo = default(EntityRef<PluginInfo>);
1174      this._Job = default(EntityRef<Job>);
1175      OnCreated();
1176    }
1177   
1178    [Column(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
1179    public System.Guid RequiredPluginId
1180    {
1181      get
1182      {
1183        return this._RequiredPluginId;
1184      }
1185      set
1186      {
1187        if ((this._RequiredPluginId != value))
1188        {
1189          this.OnRequiredPluginIdChanging(value);
1190          this.SendPropertyChanging();
1191          this._RequiredPluginId = value;
1192          this.SendPropertyChanged("RequiredPluginId");
1193          this.OnRequiredPluginIdChanged();
1194        }
1195      }
1196    }
1197   
1198    [Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
1199    public System.Guid JobId
1200    {
1201      get
1202      {
1203        return this._JobId;
1204      }
1205      set
1206      {
1207        if ((this._JobId != value))
1208        {
1209          if (this._Job.HasLoadedOrAssignedValue)
1210          {
1211            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1212          }
1213          this.OnJobIdChanging(value);
1214          this.SendPropertyChanging();
1215          this._JobId = value;
1216          this.SendPropertyChanged("JobId");
1217          this.OnJobIdChanged();
1218        }
1219      }
1220    }
1221   
1222    [Column(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
1223    public System.Guid PluginId
1224    {
1225      get
1226      {
1227        return this._PluginId;
1228      }
1229      set
1230      {
1231        if ((this._PluginId != value))
1232        {
1233          if (this._PluginInfo.HasLoadedOrAssignedValue)
1234          {
1235            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1236          }
1237          this.OnPluginIdChanging(value);
1238          this.SendPropertyChanging();
1239          this._PluginId = value;
1240          this.SendPropertyChanged("PluginId");
1241          this.OnPluginIdChanged();
1242        }
1243      }
1244    }
1245   
1246    [Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]
1247    public PluginInfo PluginInfo
1248    {
1249      get
1250      {
1251        return this._PluginInfo.Entity;
1252      }
1253      set
1254      {
1255        PluginInfo previousValue = this._PluginInfo.Entity;
1256        if (((previousValue != value)
1257              || (this._PluginInfo.HasLoadedOrAssignedValue == false)))
1258        {
1259          this.SendPropertyChanging();
1260          if ((previousValue != null))
1261          {
1262            this._PluginInfo.Entity = null;
1263            previousValue.RequiredPlugins.Remove(this);
1264          }
1265          this._PluginInfo.Entity = value;
1266          if ((value != null))
1267          {
1268            value.RequiredPlugins.Add(this);
1269            this._PluginId = value.PluginId;
1270          }
1271          else
1272          {
1273            this._PluginId = default(System.Guid);
1274          }
1275          this.SendPropertyChanged("PluginInfo");
1276        }
1277      }
1278    }
1279   
1280    [Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
1281    public Job Job
1282    {
1283      get
1284      {
1285        return this._Job.Entity;
1286      }
1287      set
1288      {
1289        Job previousValue = this._Job.Entity;
1290        if (((previousValue != value)
1291              || (this._Job.HasLoadedOrAssignedValue == false)))
1292        {
1293          this.SendPropertyChanging();
1294          if ((previousValue != null))
1295          {
1296            this._Job.Entity = null;
1297            previousValue.RequiredPlugins.Remove(this);
1298          }
1299          this._Job.Entity = value;
1300          if ((value != null))
1301          {
1302            value.RequiredPlugins.Add(this);
1303            this._JobId = value.JobId;
1304          }
1305          else
1306          {
1307            this._JobId = default(System.Guid);
1308          }
1309          this.SendPropertyChanged("Job");
1310        }
1311      }
1312    }
1313   
1314    public event PropertyChangingEventHandler PropertyChanging;
1315   
1316    public event PropertyChangedEventHandler PropertyChanged;
1317   
1318    protected virtual void SendPropertyChanging()
1319    {
1320      if ((this.PropertyChanging != null))
1321      {
1322        this.PropertyChanging(this, emptyChangingEventArgs);
1323      }
1324    }
1325   
1326    protected virtual void SendPropertyChanged(String propertyName)
1327    {
1328      if ((this.PropertyChanged != null))
1329      {
1330        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1331      }
1332    }
1333  }
1334 
1335  [Table(Name="dbo.Resource")]
1336  [InheritanceMapping(Code="RESOURCE", Type=typeof(Resource))]
1337  [InheritanceMapping(Code="CLIENT", Type=typeof(Client), IsDefault=true)]
1338  [InheritanceMapping(Code="GROUP", Type=typeof(ClientGroup))]
1339  public partial class Resource : INotifyPropertyChanging, INotifyPropertyChanged
1340  {
1341   
1342    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1343   
1344    protected System.Guid _ResourceId;
1345   
1346    private string _Name;
1347   
1348    private string _ResourceType;
1349   
1350    private EntitySet<AssignedResource> _AssignedResources;
1351   
1352    private EntitySet<ClientGroup_Resource> _ClientGroup_Resources_Parents;
1353   
1354    private EntitySet<UptimeCalendar> _UptimeCalendars;
1355   
1356    #region Extensibility Method Definitions
1357    partial void OnLoaded();
1358    partial void OnValidate(System.Data.Linq.ChangeAction action);
1359    partial void OnCreated();
1360    partial void OnResourceIdChanging(System.Guid value);
1361    partial void OnResourceIdChanged();
1362    partial void OnNameChanging(string value);
1363    partial void OnNameChanged();
1364    partial void OnResourceTypeChanging(string value);
1365    partial void OnResourceTypeChanged();
1366    #endregion
1367   
1368    public Resource()
1369    {
1370      this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
1371      this._ClientGroup_Resources_Parents = new EntitySet<ClientGroup_Resource>(new Action<ClientGroup_Resource>(this.attach_ClientGroup_Resources_Parents), new Action<ClientGroup_Resource>(this.detach_ClientGroup_Resources_Parents));
1372      this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
1373      OnCreated();
1374    }
1375   
1376    [Column(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
1377    public System.Guid ResourceId
1378    {
1379      get
1380      {
1381        return this._ResourceId;
1382      }
1383      set
1384      {
1385        if ((this._ResourceId != value))
1386        {
1387          this.OnResourceIdChanging(value);
1388          this.SendPropertyChanging();
1389          this._ResourceId = value;
1390          this.SendPropertyChanged("ResourceId");
1391          this.OnResourceIdChanged();
1392        }
1393      }
1394    }
1395   
1396    [Column(Storage="_Name", DbType="VarChar(MAX)")]
1397    public string Name
1398    {
1399      get
1400      {
1401        return this._Name;
1402      }
1403      set
1404      {
1405        if ((this._Name != value))
1406        {
1407          this.OnNameChanging(value);
1408          this.SendPropertyChanging();
1409          this._Name = value;
1410          this.SendPropertyChanged("Name");
1411          this.OnNameChanged();
1412        }
1413      }
1414    }
1415   
1416    [Column(Storage="_ResourceType", IsDiscriminator=true)]
1417    public string ResourceType
1418    {
1419      get
1420      {
1421        return this._ResourceType;
1422      }
1423      set
1424      {
1425        if ((this._ResourceType != value))
1426        {
1427          this.OnResourceTypeChanging(value);
1428          this.SendPropertyChanging();
1429          this._ResourceType = value;
1430          this.SendPropertyChanged("ResourceType");
1431          this.OnResourceTypeChanged();
1432        }
1433      }
1434    }
1435   
1436    [Association(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
1437    public EntitySet<AssignedResource> AssignedResources
1438    {
1439      get
1440      {
1441        return this._AssignedResources;
1442      }
1443      set
1444      {
1445        this._AssignedResources.Assign(value);
1446      }
1447    }
1448   
1449    [Association(Name="Resource_ClientGroup_Resource", Storage="_ClientGroup_Resources_Parents", ThisKey="ResourceId", OtherKey="ResourceId")]
1450    public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Parents
1451    {
1452      get
1453      {
1454        return this._ClientGroup_Resources_Parents;
1455      }
1456      set
1457      {
1458        this._ClientGroup_Resources_Parents.Assign(value);
1459      }
1460    }
1461   
1462    [Association(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
1463    public EntitySet<UptimeCalendar> UptimeCalendars
1464    {
1465      get
1466      {
1467        return this._UptimeCalendars;
1468      }
1469      set
1470      {
1471        this._UptimeCalendars.Assign(value);
1472      }
1473    }
1474   
1475    public event PropertyChangingEventHandler PropertyChanging;
1476   
1477    public event PropertyChangedEventHandler PropertyChanged;
1478   
1479    protected virtual void SendPropertyChanging()
1480    {
1481      if ((this.PropertyChanging != null))
1482      {
1483        this.PropertyChanging(this, emptyChangingEventArgs);
1484      }
1485    }
1486   
1487    protected virtual void SendPropertyChanged(String propertyName)
1488    {
1489      if ((this.PropertyChanged != null))
1490      {
1491        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1492      }
1493    }
1494   
1495    private void attach_AssignedResources(AssignedResource entity)
1496    {
1497      this.SendPropertyChanging();
1498      entity.Resource = this;
1499    }
1500   
1501    private void detach_AssignedResources(AssignedResource entity)
1502    {
1503      this.SendPropertyChanging();
1504      entity.Resource = null;
1505    }
1506   
1507    private void attach_ClientGroup_Resources_Parents(ClientGroup_Resource entity)
1508    {
1509      this.SendPropertyChanging();
1510      entity.Resource = this;
1511    }
1512   
1513    private void detach_ClientGroup_Resources_Parents(ClientGroup_Resource entity)
1514    {
1515      this.SendPropertyChanging();
1516      entity.Resource = null;
1517    }
1518   
1519    private void attach_UptimeCalendars(UptimeCalendar entity)
1520    {
1521      this.SendPropertyChanging();
1522      entity.Resource = this;
1523    }
1524   
1525    private void detach_UptimeCalendars(UptimeCalendar entity)
1526    {
1527      this.SendPropertyChanging();
1528      entity.Resource = null;
1529    }
1530  }
1531 
1532  public partial class Client : Resource
1533  {
1534   
1535    private System.Nullable<int> _CPUSpeed;
1536   
1537    private System.Nullable<int> _Memory;
1538   
1539    private System.Nullable<System.DateTime> _Login;
1540   
1541    private string _Status;
1542   
1543    private string _CalendarSyncStatus;
1544   
1545    private System.Nullable<System.Guid> _UseCalendarFromResourceId;
1546   
1547    private System.Nullable<System.Guid> _ClientConfigId;
1548   
1549    private System.Nullable<int> _NumberOfCores;
1550   
1551    private System.Nullable<int> _NumberOfFreeCores;
1552   
1553    private System.Nullable<int> _FreeMemory;
1554   
1555    private EntitySet<UptimeStatistic> _UptimeStatistics;
1556   
1557    private EntitySet<Job> _Jobs;
1558   
1559    private EntityRef<ClientConfig> _ClientConfig;
1560   
1561    #region Extensibility Method Definitions
1562    partial void OnLoaded();
1563    partial void OnValidate(System.Data.Linq.ChangeAction action);
1564    partial void OnCreated();
1565    partial void OnCPUSpeedChanging(System.Nullable<int> value);
1566    partial void OnCPUSpeedChanged();
1567    partial void OnMemoryChanging(System.Nullable<int> value);
1568    partial void OnMemoryChanged();
1569    partial void OnLoginChanging(System.Nullable<System.DateTime> value);
1570    partial void OnLoginChanged();
1571    partial void OnStatusChanging(string value);
1572    partial void OnStatusChanged();
1573    partial void OnCalendarSyncStatusChanging(string value);
1574    partial void OnCalendarSyncStatusChanged();
1575    partial void OnUseCalendarFromResourceIdChanging(System.Nullable<System.Guid> value);
1576    partial void OnUseCalendarFromResourceIdChanged();
1577    partial void OnClientConfigIdChanging(System.Nullable<System.Guid> value);
1578    partial void OnClientConfigIdChanged();
1579    partial void OnNumberOfCoresChanging(System.Nullable<int> value);
1580    partial void OnNumberOfCoresChanged();
1581    partial void OnNumberOfFreeCoresChanging(System.Nullable<int> value);
1582    partial void OnNumberOfFreeCoresChanged();
1583    partial void OnFreeMemoryChanging(System.Nullable<int> value);
1584    partial void OnFreeMemoryChanged();
1585    #endregion
1586   
1587    public Client()
1588    {
1589      this._UptimeStatistics = new EntitySet<UptimeStatistic>(new Action<UptimeStatistic>(this.attach_UptimeStatistics), new Action<UptimeStatistic>(this.detach_UptimeStatistics));
1590      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
1591      this._ClientConfig = default(EntityRef<ClientConfig>);
1592      OnCreated();
1593    }
1594   
1595    [Column(Storage="_CPUSpeed", DbType="Int")]
1596    public System.Nullable<int> CPUSpeed
1597    {
1598      get
1599      {
1600        return this._CPUSpeed;
1601      }
1602      set
1603      {
1604        if ((this._CPUSpeed != value))
1605        {
1606          this.OnCPUSpeedChanging(value);
1607          this.SendPropertyChanging();
1608          this._CPUSpeed = value;
1609          this.SendPropertyChanged("CPUSpeed");
1610          this.OnCPUSpeedChanged();
1611        }
1612      }
1613    }
1614   
1615    [Column(Storage="_Memory", DbType="Int")]
1616    public System.Nullable<int> Memory
1617    {
1618      get
1619      {
1620        return this._Memory;
1621      }
1622      set
1623      {
1624        if ((this._Memory != value))
1625        {
1626          this.OnMemoryChanging(value);
1627          this.SendPropertyChanging();
1628          this._Memory = value;
1629          this.SendPropertyChanged("Memory");
1630          this.OnMemoryChanged();
1631        }
1632      }
1633    }
1634   
1635    [Column(Storage="_Login", DbType="DateTime")]
1636    public System.Nullable<System.DateTime> Login
1637    {
1638      get
1639      {
1640        return this._Login;
1641      }
1642      set
1643      {
1644        if ((this._Login != value))
1645        {
1646          this.OnLoginChanging(value);
1647          this.SendPropertyChanging();
1648          this._Login = value;
1649          this.SendPropertyChanged("Login");
1650          this.OnLoginChanged();
1651        }
1652      }
1653    }
1654   
1655    [Column(Storage="_Status", DbType="VarChar(MAX)")]
1656    public string Status
1657    {
1658      get
1659      {
1660        return this._Status;
1661      }
1662      set
1663      {
1664        if ((this._Status != value))
1665        {
1666          this.OnStatusChanging(value);
1667          this.SendPropertyChanging();
1668          this._Status = value;
1669          this.SendPropertyChanged("Status");
1670          this.OnStatusChanged();
1671        }
1672      }
1673    }
1674   
1675    [Column(Storage="_CalendarSyncStatus", DbType="VarChar(MAX)")]
1676    public string CalendarSyncStatus
1677    {
1678      get
1679      {
1680        return this._CalendarSyncStatus;
1681      }
1682      set
1683      {
1684        if ((this._CalendarSyncStatus != value))
1685        {
1686          this.OnCalendarSyncStatusChanging(value);
1687          this.SendPropertyChanging();
1688          this._CalendarSyncStatus = value;
1689          this.SendPropertyChanged("CalendarSyncStatus");
1690          this.OnCalendarSyncStatusChanged();
1691        }
1692      }
1693    }
1694   
1695    [Column(Storage="_UseCalendarFromResourceId", DbType="UniqueIdentifier")]
1696    public System.Nullable<System.Guid> UseCalendarFromResourceId
1697    {
1698      get
1699      {
1700        return this._UseCalendarFromResourceId;
1701      }
1702      set
1703      {
1704        if ((this._UseCalendarFromResourceId != value))
1705        {
1706          this.OnUseCalendarFromResourceIdChanging(value);
1707          this.SendPropertyChanging();
1708          this._UseCalendarFromResourceId = value;
1709          this.SendPropertyChanged("UseCalendarFromResourceId");
1710          this.OnUseCalendarFromResourceIdChanged();
1711        }
1712      }
1713    }
1714   
1715    [Column(Storage="_ClientConfigId", DbType="UniqueIdentifier")]
1716    public System.Nullable<System.Guid> ClientConfigId
1717    {
1718      get
1719      {
1720        return this._ClientConfigId;
1721      }
1722      set
1723      {
1724        if ((this._ClientConfigId != value))
1725        {
1726          if (this._ClientConfig.HasLoadedOrAssignedValue)
1727          {
1728            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1729          }
1730          this.OnClientConfigIdChanging(value);
1731          this.SendPropertyChanging();
1732          this._ClientConfigId = value;
1733          this.SendPropertyChanged("ClientConfigId");
1734          this.OnClientConfigIdChanged();
1735        }
1736      }
1737    }
1738   
1739    [Column(Storage="_NumberOfCores", DbType="Int")]
1740    public System.Nullable<int> NumberOfCores
1741    {
1742      get
1743      {
1744        return this._NumberOfCores;
1745      }
1746      set
1747      {
1748        if ((this._NumberOfCores != value))
1749        {
1750          this.OnNumberOfCoresChanging(value);
1751          this.SendPropertyChanging();
1752          this._NumberOfCores = value;
1753          this.SendPropertyChanged("NumberOfCores");
1754          this.OnNumberOfCoresChanged();
1755        }
1756      }
1757    }
1758   
1759    [Column(Storage="_NumberOfFreeCores", DbType="Int")]
1760    public System.Nullable<int> NumberOfFreeCores
1761    {
1762      get
1763      {
1764        return this._NumberOfFreeCores;
1765      }
1766      set
1767      {
1768        if ((this._NumberOfFreeCores != value))
1769        {
1770          this.OnNumberOfFreeCoresChanging(value);
1771          this.SendPropertyChanging();
1772          this._NumberOfFreeCores = value;
1773          this.SendPropertyChanged("NumberOfFreeCores");
1774          this.OnNumberOfFreeCoresChanged();
1775        }
1776      }
1777    }
1778   
1779    [Column(Storage="_FreeMemory", DbType="Int")]
1780    public System.Nullable<int> FreeMemory
1781    {
1782      get
1783      {
1784        return this._FreeMemory;
1785      }
1786      set
1787      {
1788        if ((this._FreeMemory != value))
1789        {
1790          this.OnFreeMemoryChanging(value);
1791          this.SendPropertyChanging();
1792          this._FreeMemory = value;
1793          this.SendPropertyChanged("FreeMemory");
1794          this.OnFreeMemoryChanged();
1795        }
1796      }
1797    }
1798   
1799    [Association(Name="Client_UptimeStatistic", Storage="_UptimeStatistics", ThisKey="ResourceId", OtherKey="ResourceId")]
1800    public EntitySet<UptimeStatistic> UptimeStatistics
1801    {
1802      get
1803      {
1804        return this._UptimeStatistics;
1805      }
1806      set
1807      {
1808        this._UptimeStatistics.Assign(value);
1809      }
1810    }
1811   
1812    [Association(Name="Client_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="ResourceId", DeleteRule="SET NULL")]
1813    public EntitySet<Job> Jobs
1814    {
1815      get
1816      {
1817        return this._Jobs;
1818      }
1819      set
1820      {
1821        this._Jobs.Assign(value);
1822      }
1823    }
1824   
1825    [Association(Name="ClientConfig_Client", Storage="_ClientConfig", ThisKey="ClientConfigId", OtherKey="ClientConfigId", IsForeignKey=true, DeleteRule="SET NULL")]
1826    public ClientConfig ClientConfig
1827    {
1828      get
1829      {
1830        return this._ClientConfig.Entity;
1831      }
1832      set
1833      {
1834        ClientConfig previousValue = this._ClientConfig.Entity;
1835        if (((previousValue != value)
1836              || (this._ClientConfig.HasLoadedOrAssignedValue == false)))
1837        {
1838          this.SendPropertyChanging();
1839          if ((previousValue != null))
1840          {
1841            this._ClientConfig.Entity = null;
1842            previousValue.Clients.Remove(this);
1843          }
1844          this._ClientConfig.Entity = value;
1845          if ((value != null))
1846          {
1847            value.Clients.Add(this);
1848            this._ClientConfigId = value.ClientConfigId;
1849          }
1850          else
1851          {
1852            this._ClientConfigId = default(Nullable<System.Guid>);
1853          }
1854          this.SendPropertyChanged("ClientConfig");
1855        }
1856      }
1857    }
1858   
1859    private void attach_UptimeStatistics(UptimeStatistic entity)
1860    {
1861      this.SendPropertyChanging();
1862      entity.Client = this;
1863    }
1864   
1865    private void detach_UptimeStatistics(UptimeStatistic entity)
1866    {
1867      this.SendPropertyChanging();
1868      entity.Client = null;
1869    }
1870   
1871    private void attach_Jobs(Job entity)
1872    {
1873      this.SendPropertyChanging();
1874      entity.Client = this;
1875    }
1876   
1877    private void detach_Jobs(Job entity)
1878    {
1879      this.SendPropertyChanging();
1880      entity.Client = null;
1881    }
1882  }
1883 
1884  public partial class ClientGroup : Resource
1885  {
1886   
1887    private EntitySet<ClientGroup_Resource> _ClientGroup_Resources_Children;
1888   
1889    #region Extensibility Method Definitions
1890    partial void OnLoaded();
1891    partial void OnValidate(System.Data.Linq.ChangeAction action);
1892    partial void OnCreated();
1893    #endregion
1894   
1895    public ClientGroup()
1896    {
1897      this._ClientGroup_Resources_Children = new EntitySet<ClientGroup_Resource>(new Action<ClientGroup_Resource>(this.attach_ClientGroup_Resources_Children), new Action<ClientGroup_Resource>(this.detach_ClientGroup_Resources_Children));
1898      OnCreated();
1899    }
1900   
1901    [Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup_Resources_Children", ThisKey="ResourceId", OtherKey="ClientGroupId")]
1902    public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Children
1903    {
1904      get
1905      {
1906        return this._ClientGroup_Resources_Children;
1907      }
1908      set
1909      {
1910        this._ClientGroup_Resources_Children.Assign(value);
1911      }
1912    }
1913   
1914    private void attach_ClientGroup_Resources_Children(ClientGroup_Resource entity)
1915    {
1916      this.SendPropertyChanging();
1917      entity.ClientGroup = this;
1918    }
1919   
1920    private void detach_ClientGroup_Resources_Children(ClientGroup_Resource entity)
1921    {
1922      this.SendPropertyChanging();
1923      entity.ClientGroup = null;
1924    }
1925  }
1926 
1927  [Table(Name="dbo.Job")]
1928  public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
1929  {
1930   
1931    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1932   
1933    private System.Guid _JobId;
1934   
1935    private System.Nullable<System.Guid> _ParentJobId;
1936   
1937    private string _JobState;
1938   
1939    private System.Nullable<System.Guid> _ResourceId;
1940   
1941    private System.Nullable<double> _Percentage;
1942   
1943    private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
1944   
1945    private System.Nullable<System.DateTime> _DateCreated;
1946   
1947    private System.Nullable<System.DateTime> _DateCalculated;
1948   
1949    private System.Nullable<System.DateTime> _DateFinished;
1950   
1951    private int _Priority;
1952   
1953    private System.Nullable<System.Guid> _ProjectId;
1954   
1955    private System.Nullable<System.Guid> _UserId;
1956   
1957    private int _CoresNeeded;
1958   
1959    private int _MemoryNeeded;
1960   
1961    private EntitySet<AssignedResource> _AssignedResources;
1962   
1963    private EntitySet<RequiredPlugin> _RequiredPlugins;
1964   
1965    private EntitySet<Job> _Jobs;
1966   
1967    private EntityRef<Job> _Job1;
1968   
1969    private EntityRef<Project> _Project;
1970   
1971    private EntityRef<Client> _Client;
1972   
1973    #region Extensibility Method Definitions
1974    partial void OnLoaded();
1975    partial void OnValidate(System.Data.Linq.ChangeAction action);
1976    partial void OnCreated();
1977    partial void OnJobIdChanging(System.Guid value);
1978    partial void OnJobIdChanged();
1979    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
1980    partial void OnParentJobIdChanged();
1981    partial void OnJobStateChanging(string value);
1982    partial void OnJobStateChanged();
1983    partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
1984    partial void OnResourceIdChanged();
1985    partial void OnPercentageChanging(System.Nullable<double> value);
1986    partial void OnPercentageChanged();
1987    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
1988    partial void OnSerializedJobChanged();
1989    partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
1990    partial void OnDateCreatedChanged();
1991    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
1992    partial void OnDateCalculatedChanged();
1993    partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
1994    partial void OnDateFinishedChanged();
1995    partial void OnPriorityChanging(int value);
1996    partial void OnPriorityChanged();
1997    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
1998    partial void OnProjectIdChanged();
1999    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
2000    partial void OnUserIdChanged();
2001    partial void OnCoresNeededChanging(int value);
2002    partial void OnCoresNeededChanged();
2003    partial void OnMemoryNeededChanging(int value);
2004    partial void OnMemoryNeededChanged();
2005    #endregion
2006   
2007    public Job()
2008    {
2009      this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
2010      this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
2011      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
2012      this._Job1 = default(EntityRef<Job>);
2013      this._Project = default(EntityRef<Project>);
2014      this._Client = default(EntityRef<Client>);
2015      OnCreated();
2016    }
2017   
2018    [Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
2019    public System.Guid JobId
2020    {
2021      get
2022      {
2023        return this._JobId;
2024      }
2025      set
2026      {
2027        if ((this._JobId != value))
2028        {
2029          this.OnJobIdChanging(value);
2030          this.SendPropertyChanging();
2031          this._JobId = value;
2032          this.SendPropertyChanged("JobId");
2033          this.OnJobIdChanged();
2034        }
2035      }
2036    }
2037   
2038    [Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
2039    public System.Nullable<System.Guid> ParentJobId
2040    {
2041      get
2042      {
2043        return this._ParentJobId;
2044      }
2045      set
2046      {
2047        if ((this._ParentJobId != value))
2048        {
2049          if (this._Job1.HasLoadedOrAssignedValue)
2050          {
2051            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
2052          }
2053          this.OnParentJobIdChanging(value);
2054          this.SendPropertyChanging();
2055          this._ParentJobId = value;
2056          this.SendPropertyChanged("ParentJobId");
2057          this.OnParentJobIdChanged();
2058        }
2059      }
2060    }
2061   
2062    [Column(Storage="_JobState", DbType="VarChar(MAX)")]
2063    public string JobState
2064    {
2065      get
2066      {
2067        return this._JobState;
2068      }
2069      set
2070      {
2071        if ((this._JobState != value))
2072        {
2073          this.OnJobStateChanging(value);
2074          this.SendPropertyChanging();
2075          this._JobState = value;
2076          this.SendPropertyChanged("JobState");
2077          this.OnJobStateChanged();
2078        }
2079      }
2080    }
2081   
2082    [Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
2083    public System.Nullable<System.Guid> ResourceId
2084    {
2085      get
2086      {
2087        return this._ResourceId;
2088      }
2089      set
2090      {
2091        if ((this._ResourceId != value))
2092        {
2093          if (this._Client.HasLoadedOrAssignedValue)
2094          {
2095            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
2096          }
2097          this.OnResourceIdChanging(value);
2098          this.SendPropertyChanging();
2099          this._ResourceId = value;
2100          this.SendPropertyChanged("ResourceId");
2101          this.OnResourceIdChanged();
2102        }
2103      }
2104    }
2105   
2106    [Column(Storage="_Percentage", DbType="Float")]
2107    public System.Nullable<double> Percentage
2108    {
2109      get
2110      {
2111        return this._Percentage;
2112      }
2113      set
2114      {
2115        if ((this._Percentage != value))
2116        {
2117          this.OnPercentageChanging(value);
2118          this.SendPropertyChanging();
2119          this._Percentage = value;
2120          this.SendPropertyChanged("Percentage");
2121          this.OnPercentageChanged();
2122        }
2123      }
2124    }
2125   
2126    [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)]
2127    public System.Data.Linq.Binary SerializedJob
2128    {
2129      get
2130      {
2131        return this._SerializedJob.Value;
2132      }
2133      set
2134      {
2135        if ((this._SerializedJob.Value != value))
2136        {
2137          this.OnSerializedJobChanging(value);
2138          this.SendPropertyChanging();
2139          this._SerializedJob.Value = value;
2140          this.SendPropertyChanged("SerializedJob");
2141          this.OnSerializedJobChanged();
2142        }
2143      }
2144    }
2145   
2146    [Column(Storage="_DateCreated", DbType="DateTime")]
2147    public System.Nullable<System.DateTime> DateCreated
2148    {
2149      get
2150      {
2151        return this._DateCreated;
2152      }
2153      set
2154      {
2155        if ((this._DateCreated != value))
2156        {
2157          this.OnDateCreatedChanging(value);
2158          this.SendPropertyChanging();
2159          this._DateCreated = value;
2160          this.SendPropertyChanged("DateCreated");
2161          this.OnDateCreatedChanged();
2162        }
2163      }
2164    }
2165   
2166    [Column(Storage="_DateCalculated", DbType="DateTime")]
2167    public System.Nullable<System.DateTime> DateCalculated
2168    {
2169      get
2170      {
2171        return this._DateCalculated;
2172      }
2173      set
2174      {
2175        if ((this._DateCalculated != value))
2176        {
2177          this.OnDateCalculatedChanging(value);
2178          this.SendPropertyChanging();
2179          this._DateCalculated = value;
2180          this.SendPropertyChanged("DateCalculated");
2181          this.OnDateCalculatedChanged();
2182        }
2183      }
2184    }
2185   
2186    [Column(Storage="_DateFinished", DbType="DateTime")]
2187    public System.Nullable<System.DateTime> DateFinished
2188    {
2189      get
2190      {
2191        return this._DateFinished;
2192      }
2193      set
2194      {
2195        if ((this._DateFinished != value))
2196        {
2197          this.OnDateFinishedChanging(value);
2198          this.SendPropertyChanging();
2199          this._DateFinished = value;
2200          this.SendPropertyChanged("DateFinished");
2201          this.OnDateFinishedChanged();
2202        }
2203      }
2204    }
2205   
2206    [Column(Storage="_Priority", DbType="Int NOT NULL")]
2207    public int Priority
2208    {
2209      get
2210      {
2211        return this._Priority;
2212      }
2213      set
2214      {
2215        if ((this._Priority != value))
2216        {
2217          this.OnPriorityChanging(value);
2218          this.SendPropertyChanging();
2219          this._Priority = value;
2220          this.SendPropertyChanged("Priority");
2221          this.OnPriorityChanged();
2222        }
2223      }
2224    }
2225   
2226    [Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
2227    public System.Nullable<System.Guid> ProjectId
2228    {
2229      get
2230      {
2231        return this._ProjectId;
2232      }
2233      set
2234      {
2235        if ((this._ProjectId != value))
2236        {
2237          if (this._Project.HasLoadedOrAssignedValue)
2238          {
2239            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
2240          }
2241          this.OnProjectIdChanging(value);
2242          this.SendPropertyChanging();
2243          this._ProjectId = value;
2244          this.SendPropertyChanged("ProjectId");
2245          this.OnProjectIdChanged();
2246        }
2247      }
2248    }
2249   
2250    [Column(Storage="_UserId", DbType="UniqueIdentifier")]
2251    public System.Nullable<System.Guid> UserId
2252    {
2253      get
2254      {
2255        return this._UserId;
2256      }
2257      set
2258      {
2259        if ((this._UserId != value))
2260        {
2261          this.OnUserIdChanging(value);
2262          this.SendPropertyChanging();
2263          this._UserId = value;
2264          this.SendPropertyChanged("UserId");
2265          this.OnUserIdChanged();
2266        }
2267      }
2268    }
2269   
2270    [Column(Storage="_CoresNeeded", DbType="Int NOT NULL")]
2271    public int CoresNeeded
2272    {
2273      get
2274      {
2275        return this._CoresNeeded;
2276      }
2277      set
2278      {
2279        if ((this._CoresNeeded != value))
2280        {
2281          this.OnCoresNeededChanging(value);
2282          this.SendPropertyChanging();
2283          this._CoresNeeded = value;
2284          this.SendPropertyChanged("CoresNeeded");
2285          this.OnCoresNeededChanged();
2286        }
2287      }
2288    }
2289   
2290    [Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
2291    public int MemoryNeeded
2292    {
2293      get
2294      {
2295        return this._MemoryNeeded;
2296      }
2297      set
2298      {
2299        if ((this._MemoryNeeded != value))
2300        {
2301          this.OnMemoryNeededChanging(value);
2302          this.SendPropertyChanging();
2303          this._MemoryNeeded = value;
2304          this.SendPropertyChanged("MemoryNeeded");
2305          this.OnMemoryNeededChanged();
2306        }
2307      }
2308    }
2309   
2310    [Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
2311    public EntitySet<AssignedResource> AssignedResources
2312    {
2313      get
2314      {
2315        return this._AssignedResources;
2316      }
2317      set
2318      {
2319        this._AssignedResources.Assign(value);
2320      }
2321    }
2322   
2323    [Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
2324    public EntitySet<RequiredPlugin> RequiredPlugins
2325    {
2326      get
2327      {
2328        return this._RequiredPlugins;
2329      }
2330      set
2331      {
2332        this._RequiredPlugins.Assign(value);
2333      }
2334    }
2335   
2336    [Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
2337    public EntitySet<Job> Jobs
2338    {
2339      get
2340      {
2341        return this._Jobs;
2342      }
2343      set
2344      {
2345        this._Jobs.Assign(value);
2346      }
2347    }
2348   
2349    [Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
2350    public Job Job1
2351    {
2352      get
2353      {
2354        return this._Job1.Entity;
2355      }
2356      set
2357      {
2358        Job previousValue = this._Job1.Entity;
2359        if (((previousValue != value)
2360              || (this._Job1.HasLoadedOrAssignedValue == false)))
2361        {
2362          this.SendPropertyChanging();
2363          if ((previousValue != null))
2364          {
2365            this._Job1.Entity = null;
2366            previousValue.Jobs.Remove(this);
2367          }
2368          this._Job1.Entity = value;
2369          if ((value != null))
2370          {
2371            value.Jobs.Add(this);
2372            this._ParentJobId = value.JobId;
2373          }
2374          else
2375          {
2376            this._ParentJobId = default(Nullable<System.Guid>);
2377          }
2378          this.SendPropertyChanged("Job1");
2379        }
2380      }
2381    }
2382   
2383    [Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
2384    public Project Project
2385    {
2386      get
2387      {
2388        return this._Project.Entity;
2389      }
2390      set
2391      {
2392        Project previousValue = this._Project.Entity;
2393        if (((previousValue != value)
2394              || (this._Project.HasLoadedOrAssignedValue == false)))
2395        {
2396          this.SendPropertyChanging();
2397          if ((previousValue != null))
2398          {
2399            this._Project.Entity = null;
2400            previousValue.Jobs.Remove(this);
2401          }
2402          this._Project.Entity = value;
2403          if ((value != null))
2404          {
2405            value.Jobs.Add(this);
2406            this._ProjectId = value.ProjectId;
2407          }
2408          else
2409          {
2410            this._ProjectId = default(Nullable<System.Guid>);
2411          }
2412          this.SendPropertyChanged("Project");
2413        }
2414      }
2415    }
2416   
2417    [Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
2418    public Client Client
2419    {
2420      get
2421      {
2422        return this._Client.Entity;
2423      }
2424      set
2425      {
2426        Client previousValue = this._Client.Entity;
2427        if (((previousValue != value)
2428              || (this._Client.HasLoadedOrAssignedValue == false)))
2429        {
2430          this.SendPropertyChanging();
2431          if ((previousValue != null))
2432          {
2433            this._Client.Entity = null;
2434            previousValue.Jobs.Remove(this);
2435          }
2436          this._Client.Entity = value;
2437          if ((value != null))
2438          {
2439            value.Jobs.Add(this);
2440            this._ResourceId = value.ResourceId;
2441          }
2442          else
2443          {
2444            this._ResourceId = default(Nullable<System.Guid>);
2445          }
2446          this.SendPropertyChanged("Client");
2447        }
2448      }
2449    }
2450   
2451    public event PropertyChangingEventHandler PropertyChanging;
2452   
2453    public event PropertyChangedEventHandler PropertyChanged;
2454   
2455    protected virtual void SendPropertyChanging()
2456    {
2457      if ((this.PropertyChanging != null))
2458      {
2459        this.PropertyChanging(this, emptyChangingEventArgs);
2460      }
2461    }
2462   
2463    protected virtual void SendPropertyChanged(String propertyName)
2464    {
2465      if ((this.PropertyChanged != null))
2466      {
2467        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
2468      }
2469    }
2470   
2471    private void attach_AssignedResources(AssignedResource entity)
2472    {
2473      this.SendPropertyChanging();
2474      entity.Job = this;
2475    }
2476   
2477    private void detach_AssignedResources(AssignedResource entity)
2478    {
2479      this.SendPropertyChanging();
2480      entity.Job = null;
2481    }
2482   
2483    private void attach_RequiredPlugins(RequiredPlugin entity)
2484    {
2485      this.SendPropertyChanging();
2486      entity.Job = this;
2487    }
2488   
2489    private void detach_RequiredPlugins(RequiredPlugin entity)
2490    {
2491      this.SendPropertyChanging();
2492      entity.Job = null;
2493    }
2494   
2495    private void attach_Jobs(Job entity)
2496    {
2497      this.SendPropertyChanging();
2498      entity.Job1 = this;
2499    }
2500   
2501    private void detach_Jobs(Job entity)
2502    {
2503      this.SendPropertyChanging();
2504      entity.Job1 = null;
2505    }
2506  }
2507 
2508  [Table(Name="dbo.UptimeCalendar")]
2509  public partial class UptimeCalendar : INotifyPropertyChanging, INotifyPropertyChanged
2510  {
2511   
2512    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
2513   
2514    private System.Guid _UptimeCalendarId;
2515   
2516    private System.Guid _ResourceId;
2517   
2518    private System.DateTime _StartDate;
2519   
2520    private System.DateTime _EndDate;
2521   
2522    private bool _AllDayEvent;
2523   
2524    private bool _Recurring;
2525   
2526    private System.Guid _RecurringId;
2527   
2528    private EntityRef<Resource> _Resource;
2529   
2530    #region Extensibility Method Definitions
2531    partial void OnLoaded();
2532    partial void OnValidate(System.Data.Linq.ChangeAction action);
2533    partial void OnCreated();
2534    partial void OnUptimeCalendarIdChanging(System.Guid value);
2535    partial void OnUptimeCalendarIdChanged();
2536    partial void OnResourceIdChanging(System.Guid value);
2537    partial void OnResourceIdChanged();
2538    partial void OnStartDateChanging(System.DateTime value);
2539    partial void OnStartDateChanged();
2540    partial void OnEndDateChanging(System.DateTime value);
2541    partial void OnEndDateChanged();
2542    partial void OnAllDayEventChanging(bool value);
2543    partial void OnAllDayEventChanged();
2544    partial void OnRecurringChanging(bool value);
2545    partial void OnRecurringChanged();
2546    partial void OnRecurringIdChanging(System.Guid value);
2547    partial void OnRecurringIdChanged();
2548    #endregion
2549   
2550    public UptimeCalendar()
2551    {
2552      this._Resource = default(EntityRef<Resource>);
2553      OnCreated();
2554    }
2555   
2556    [Column(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
2557    public System.Guid UptimeCalendarId
2558    {
2559      get
2560      {
2561        return this._UptimeCalendarId;
2562      }
2563      set
2564      {
2565        if ((this._UptimeCalendarId != value))
2566        {
2567          this.OnUptimeCalendarIdChanging(value);
2568          this.SendPropertyChanging();
2569          this._UptimeCalendarId = value;
2570          this.SendPropertyChanged("UptimeCalendarId");
2571          this.OnUptimeCalendarIdChanged();
2572        }
2573      }
2574    }
2575   
2576    [Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
2577    public System.Guid ResourceId
2578    {
2579      get
2580      {
2581        return this._ResourceId;
2582      }
2583      set
2584      {
2585        if ((this._ResourceId != value))
2586        {
2587          if (this._Resource.HasLoadedOrAssignedValue)
2588          {
2589            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
2590          }
2591          this.OnResourceIdChanging(value);
2592          this.SendPropertyChanging();
2593          this._ResourceId = value;
2594          this.SendPropertyChanged("ResourceId");
2595          this.OnResourceIdChanged();
2596        }
2597      }
2598    }
2599   
2600    [Column(Storage="_StartDate", DbType="DateTime NOT NULL")]
2601    public System.DateTime StartDate
2602    {
2603      get
2604      {
2605        return this._StartDate;
2606      }
2607      set
2608      {
2609        if ((this._StartDate != value))
2610        {
2611          this.OnStartDateChanging(value);
2612          this.SendPropertyChanging();
2613          this._StartDate = value;
2614          this.SendPropertyChanged("StartDate");
2615          this.OnStartDateChanged();
2616        }
2617      }
2618    }
2619   
2620    [Column(Storage="_EndDate", DbType="DateTime NOT NULL")]
2621    public System.DateTime EndDate
2622    {
2623      get
2624      {
2625        return this._EndDate;
2626      }
2627      set
2628      {
2629        if ((this._EndDate != value))
2630        {
2631          this.OnEndDateChanging(value);
2632          this.SendPropertyChanging();
2633          this._EndDate = value;
2634          this.SendPropertyChanged("EndDate");
2635          this.OnEndDateChanged();
2636        }
2637      }
2638    }
2639   
2640    [Column(Storage="_AllDayEvent", DbType="Bit NOT NULL")]
2641    public bool AllDayEvent
2642    {
2643      get
2644      {
2645        return this._AllDayEvent;
2646      }
2647      set
2648      {
2649        if ((this._AllDayEvent != value))
2650        {
2651          this.OnAllDayEventChanging(value);
2652          this.SendPropertyChanging();
2653          this._AllDayEvent = value;
2654          this.SendPropertyChanged("AllDayEvent");
2655          this.OnAllDayEventChanged();
2656        }
2657      }
2658    }
2659   
2660    [Column(Storage="_Recurring", DbType="Bit NOT NULL")]
2661    public bool Recurring
2662    {
2663      get
2664      {
2665        return this._Recurring;
2666      }
2667      set
2668      {
2669        if ((this._Recurring != value))
2670        {
2671          this.OnRecurringChanging(value);
2672          this.SendPropertyChanging();
2673          this._Recurring = value;
2674          this.SendPropertyChanged("Recurring");
2675          this.OnRecurringChanged();
2676        }
2677      }
2678    }
2679   
2680    [Column(Storage="_RecurringId", DbType="UniqueIdentifier")]
2681    public System.Guid RecurringId
2682    {
2683      get
2684      {
2685        return this._RecurringId;
2686      }
2687      set
2688      {
2689        if ((this._RecurringId != value))
2690        {
2691          this.OnRecurringIdChanging(value);
2692          this.SendPropertyChanging();
2693          this._RecurringId = value;
2694          this.SendPropertyChanged("RecurringId");
2695          this.OnRecurringIdChanged();
2696        }
2697      }
2698    }
2699   
2700    [Association(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
2701    public Resource Resource
2702    {
2703      get
2704      {
2705        return this._Resource.Entity;
2706      }
2707      set
2708      {
2709        Resource previousValue = this._Resource.Entity;
2710        if (((previousValue != value)
2711              || (this._Resource.HasLoadedOrAssignedValue == false)))
2712        {
2713          this.SendPropertyChanging();
2714          if ((previousValue != null))
2715          {
2716            this._Resource.Entity = null;
2717            previousValue.UptimeCalendars.Remove(this);
2718          }
2719          this._Resource.Entity = value;
2720          if ((value != null))
2721          {
2722            value.UptimeCalendars.Add(this);
2723            this._ResourceId = value.ResourceId;
2724          }
2725          else
2726          {
2727            this._ResourceId = default(System.Guid);
2728          }
2729          this.SendPropertyChanged("Resource");
2730        }
2731      }
2732    }
2733   
2734    public event PropertyChangingEventHandler PropertyChanging;
2735   
2736    public event PropertyChangedEventHandler PropertyChanged;
2737   
2738    protected virtual void SendPropertyChanging()
2739    {
2740      if ((this.PropertyChanging != null))
2741      {
2742        this.PropertyChanging(this, emptyChangingEventArgs);
2743      }
2744    }
2745   
2746    protected virtual void SendPropertyChanged(String propertyName)
2747    {
2748      if ((this.PropertyChanged != null))
2749      {
2750        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
2751      }
2752    }
2753  }
2754}
2755#pragma warning restore 1591
Note: See TracBrowser for help on using the repository browser.