Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/09 12:32:03 (15 years ago)
Author:
svonolfe
Message:

Further improved handling of job objects (#372)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/dsHiveServer.Designer.cs

    r2066 r2083  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:2.0.50727.3082
     4//     Runtime Version:2.0.50727.3053
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    17791779            private global::System.Data.DataColumn columnPercentage;
    17801780           
    1781             private global::System.Data.DataColumn columnSerializedJob;
    1782            
    17831781            private global::System.Data.DataColumn columnDateCreated;
    17841782           
     
    18611859           
    18621860            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    1863             public global::System.Data.DataColumn SerializedJobColumn {
    1864                 get {
    1865                     return this.columnSerializedJob;
    1866                 }
    1867             }
    1868            
    1869             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    18701861            public global::System.Data.DataColumn DateCreatedColumn {
    18711862                get {
     
    19451936           
    19461937            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    1947             public JobRow AddJobRow(System.Guid JobId, JobRow parentJobRowByR_44, string JobState, ClientRow parentClientRowByR_21, double Percentage, byte[] SerializedJob, System.DateTime DateCreated, System.DateTime DateCalculated, int Priority, ProjectRow parentProjectRowByR_49, System.Guid UserId, int CoresNeeded, int MemoryNeeded) {
     1938            public JobRow AddJobRow(System.Guid JobId, JobRow parentJobRowByR_44, string JobState, ClientRow parentClientRowByR_21, double Percentage, System.DateTime DateCreated, System.DateTime DateCalculated, int Priority, ProjectRow parentProjectRowByR_49, System.Guid UserId, int CoresNeeded, int MemoryNeeded) {
    19481939                JobRow rowJobRow = ((JobRow)(this.NewRow()));
    19491940                object[] columnValuesArray = new object[] {
     
    19531944                        null,
    19541945                        Percentage,
    1955                         SerializedJob,
    19561946                        DateCreated,
    19571947                        DateCalculated,
     
    19681958                }
    19691959                if ((parentProjectRowByR_49 != null)) {
    1970                     columnValuesArray[9] = parentProjectRowByR_49[0];
     1960                    columnValuesArray[8] = parentProjectRowByR_49[0];
    19711961                }
    19721962                rowJobRow.ItemArray = columnValuesArray;
     
    20001990                this.columnResourceId = base.Columns["ResourceId"];
    20011991                this.columnPercentage = base.Columns["Percentage"];
    2002                 this.columnSerializedJob = base.Columns["SerializedJob"];
    20031992                this.columnDateCreated = base.Columns["DateCreated"];
    20041993                this.columnDateCalculated = base.Columns["DateCalculated"];
     
    20222011                this.columnPercentage = new global::System.Data.DataColumn("Percentage", typeof(double), null, global::System.Data.MappingType.Element);
    20232012                base.Columns.Add(this.columnPercentage);
    2024                 this.columnSerializedJob = new global::System.Data.DataColumn("SerializedJob", typeof(byte[]), null, global::System.Data.MappingType.Element);
    2025                 base.Columns.Add(this.columnSerializedJob);
    20262013                this.columnDateCreated = new global::System.Data.DataColumn("DateCreated", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
    20272014                base.Columns.Add(this.columnDateCreated);
     
    43274314           
    43284315            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4329             public byte[] SerializedJob {
    4330                 get {
    4331                     try {
    4332                         return ((byte[])(this[this.tableJob.SerializedJobColumn]));
    4333                     }
    4334                     catch (global::System.InvalidCastException e) {
    4335                         throw new global::System.Data.StrongTypingException("The value for column \'SerializedJob\' in table \'Job\' is DBNull.", e);
    4336                     }
    4337                 }
    4338                 set {
    4339                     this[this.tableJob.SerializedJobColumn] = value;
    4340                 }
    4341             }
    4342            
    4343             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    43444316            public System.DateTime DateCreated {
    43454317                get {
     
    45144486            public void SetPercentageNull() {
    45154487                this[this.tableJob.PercentageColumn] = global::System.Convert.DBNull;
    4516             }
    4517            
    4518             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4519             public bool IsSerializedJobNull() {
    4520                 return this.IsNull(this.tableJob.SerializedJobColumn);
    4521             }
    4522            
    4523             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4524             public void SetSerializedJobNull() {
    4525                 this[this.tableJob.SerializedJobColumn] = global::System.Convert.DBNull;
    45264488            }
    45274489           
     
    74217383            tableMapping.ColumnMappings.Add("ResourceId", "ResourceId");
    74227384            tableMapping.ColumnMappings.Add("Percentage", "Percentage");
    7423             tableMapping.ColumnMappings.Add("SerializedJob", "SerializedJob");
    74247385            tableMapping.ColumnMappings.Add("DateCreated", "DateCreated");
    74257386            tableMapping.ColumnMappings.Add("DateCalculated", "DateCalculated");
     
    74327393            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
    74337394            this._adapter.DeleteCommand.Connection = this.Connection;
    7434             this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[Job] WHERE (([JobId] = @Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([ParentJobId] = @Original_ParentJobId)) AND ((@IsNull_ResourceId = 1 AND [ResourceId] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage = 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@IsNull_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_DateCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Priority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = 1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryNeeded] = @Original_MemoryNeeded)))";
     7395            this._adapter.DeleteCommand.CommandText = @"DELETE FROM [Job] WHERE (([JobId] = @Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([ParentJobId] = @Original_ParentJobId)) AND ((@IsNull_ResourceId = 1 AND [ResourceId] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage = 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@IsNull_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_DateCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Priority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = 1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryNeeded] = @Original_MemoryNeeded)))";
    74357396            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
    74367397            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
     
    74577418            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
    74587419            this._adapter.InsertCommand.Connection = this.Connection;
    7459             this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[Job] ([JobId], [ParentJobId], [JobState], [ResourceId], [Percentage], [SerializedJob], [DateCreated], [DateCalculated], [Priority], [ProjectId], [UserId], [CoresNeeded], [MemoryNeeded]) VALUES (@JobId, @ParentJobId, @JobState, @ResourceId, @Percentage, @SerializedJob, @DateCreated, @DateCalculated, @Priority, @ProjectId, @UserId, @CoresNeeded, @MemoryNeeded);
    7460 WITH ClientGroups(ClientGroupId) AS (SELECT ClientGroupId FROM ClientGroup_Resource WHERE (ResourceId = @ResourceId) UNION ALL SELECT g.ClientGroupId FROM ClientGroup_Resource AS g INNER JOIN ClientGroups AS gr ON gr.ClientGroupId = g.ResourceId) SELECT JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) ORDER BY Priority";
     7420            this._adapter.InsertCommand.CommandText = @"INSERT INTO [Job] ([JobId], [ParentJobId], [ResourceId], [JobState], [Percentage], [DateCreated], [DateCalculated], [Priority], [ProjectId], [UserId], [CoresNeeded], [MemoryNeeded]) VALUES (@JobId, @ParentJobId, @ResourceId, @JobState, @Percentage, @DateCreated, @DateCalculated, @Priority, @ProjectId, @UserId, @CoresNeeded, @MemoryNeeded);
     7421SELECT JobId, ParentJobId, ResourceId, JobState, Percentage, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId)";
    74617422            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
    74627423            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    74637424            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ParentJobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7425            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    74647426            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobState", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7465             this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    74667427            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Percentage", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Percentage", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7467             this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SerializedJob", global::System.Data.SqlDbType.VarBinary, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SerializedJob", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    74687428            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateCreated", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateCreated", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    74697429            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateCalculated", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateCalculated", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    74757435            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
    74767436            this._adapter.UpdateCommand.Connection = this.Connection;
    7477             this._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[Job] SET [JobId] = @JobId, [ParentJobId] = @ParentJobId, [JobState]" +
    7478                 " = @JobState, [ResourceId] = @ResourceId, [Percentage] = @Percentage, [Serialize" +
    7479                 "dJob] = @SerializedJob, [DateCreated] = @DateCreated, [DateCalculated] = @DateCa" +
    7480                 "lculated, [Priority] = @Priority, [ProjectId] = @ProjectId, [UserId] = @UserId, " +
    7481                 "[CoresNeeded] = @CoresNeeded, [MemoryNeeded] = @MemoryNeeded WHERE (([JobId] = @" +
    7482                 "Original_JobId) AND ((@IsNull_ParentJobId = 1 AND [ParentJobId] IS NULL) OR ([Pa" +
    7483                 "rentJobId] = @Original_ParentJobId)) AND ((@IsNull_ResourceId = 1 AND [ResourceI" +
    7484                 "d] IS NULL) OR ([ResourceId] = @Original_ResourceId)) AND ((@IsNull_Percentage =" +
    7485                 " 1 AND [Percentage] IS NULL) OR ([Percentage] = @Original_Percentage)) AND ((@Is" +
    7486                 "Null_DateCreated = 1 AND [DateCreated] IS NULL) OR ([DateCreated] = @Original_Da" +
    7487                 "teCreated)) AND ((@IsNull_DateCalculated = 1 AND [DateCalculated] IS NULL) OR ([" +
    7488                 "DateCalculated] = @Original_DateCalculated)) AND ((@IsNull_Priority = 1 AND [Pri" +
    7489                 "ority] IS NULL) OR ([Priority] = @Original_Priority)) AND ((@IsNull_ProjectId = " +
    7490                 "1 AND [ProjectId] IS NULL) OR ([ProjectId] = @Original_ProjectId)) AND ((@IsNull" +
    7491                 "_UserId = 1 AND [UserId] IS NULL) OR ([UserId] = @Original_UserId)) AND ((@IsNul" +
    7492                 "l_CoresNeeded = 1 AND [CoresNeeded] IS NULL) OR ([CoresNeeded] = @Original_Cores" +
    7493                 "Needed)) AND ((@IsNull_MemoryNeeded = 1 AND [MemoryNeeded] IS NULL) OR ([MemoryN" +
    7494                 "eeded] = @Original_MemoryNeeded)));\r\nWITH ClientGroups(ClientGroupId) AS (SELECT" +
    7495                 " ClientGroupId FROM ClientGroup_Resource WHERE (ResourceId = @ResourceId) UNION " +
    7496                 "ALL SELECT g.ClientGroupId FROM ClientGroup_Resource AS g INNER JOIN ClientGroup" +
    7497                 "s AS gr ON gr.ClientGroupId = g.ResourceId) SELECT JobId, ParentJobId, JobState," +
    7498                 " ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, P" +
    7499                 "rojectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (JobId = @JobId) ORDE" +
    7500                 "R BY Priority";
     7437            this._adapter.UpdateCommand.CommandText = "UPDATE [Job] SET [JobId] = @JobId, [ParentJobId] = @ParentJobId, [ResourceId] = @" +
     7438                "ResourceId, [JobState] = @JobState, [Percentage] = @Percentage, [DateCreated] = " +
     7439                "@DateCreated, [DateCalculated] = @DateCalculated, [Priority] = @Priority, [Proje" +
     7440                "ctId] = @ProjectId, [UserId] = @UserId, [CoresNeeded] = @CoresNeeded, [MemoryNee" +
     7441                "ded] = @MemoryNeeded WHERE (([JobId] = @Original_JobId) AND ((@IsNull_ParentJobI" +
     7442                "d = 1 AND [ParentJobId] IS NULL) OR ([ParentJobId] = @Original_ParentJobId)) AND" +
     7443                " ((@IsNull_ResourceId = 1 AND [ResourceId] IS NULL) OR ([ResourceId] = @Original" +
     7444                "_ResourceId)) AND ((@IsNull_Percentage = 1 AND [Percentage] IS NULL) OR ([Percen" +
     7445                "tage] = @Original_Percentage)) AND ((@IsNull_DateCreated = 1 AND [DateCreated] I" +
     7446                "S NULL) OR ([DateCreated] = @Original_DateCreated)) AND ((@IsNull_DateCalculated" +
     7447                " = 1 AND [DateCalculated] IS NULL) OR ([DateCalculated] = @Original_DateCalculat" +
     7448                "ed)) AND ((@IsNull_Priority = 1 AND [Priority] IS NULL) OR ([Priority] = @Origin" +
     7449                "al_Priority)) AND ((@IsNull_ProjectId = 1 AND [ProjectId] IS NULL) OR ([ProjectI" +
     7450                "d] = @Original_ProjectId)) AND ((@IsNull_UserId = 1 AND [UserId] IS NULL) OR ([U" +
     7451                "serId] = @Original_UserId)) AND ((@IsNull_CoresNeeded = 1 AND [CoresNeeded] IS N" +
     7452                "ULL) OR ([CoresNeeded] = @Original_CoresNeeded)) AND ((@IsNull_MemoryNeeded = 1 " +
     7453                "AND [MemoryNeeded] IS NULL) OR ([MemoryNeeded] = @Original_MemoryNeeded)));\r\nSEL" +
     7454                "ECT JobId, ParentJobId, ResourceId, JobState, Percentage, DateCreated, DateCalcu" +
     7455                "lated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded FROM Job WHERE (Jo" +
     7456                "bId = @JobId)";
    75017457            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
    75027458            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75037459            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ParentJobId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7460            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75047461            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobState", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7505             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75067462            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Percentage", global::System.Data.SqlDbType.Float, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Percentage", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7507             this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SerializedJob", global::System.Data.SqlDbType.VarBinary, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SerializedJob", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75087463            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateCreated", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateCreated", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75097464            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateCalculated", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateCalculated", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    75447499        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    75457500        private void InitCommandCollection() {
    7546             this._commandCollection = new global::System.Data.SqlClient.SqlCommand[10];
     7501            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[12];
    75477502            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
    75487503            this._commandCollection[0].Connection = this.Connection;
    7549             this._commandCollection[0].CommandText = @"WITH ClientGroups(ClientGroupId)
    7550 AS
    7551 (
    7552 -- Anchor member definition
    7553     SELECT ClientGroupId
    7554     FROM ClientGroup_Resource
    7555     WHERE ResourceId = @ResourceId
    7556     UNION ALL
    7557 -- Recursive member definition
    7558     SELECT g.ClientGroupId
    7559     FROM ClientGroup_Resource AS g
    7560     INNER JOIN  ClientGroups AS gr
    7561         ON gr.ClientGroupId = g.ResourceId
    7562 )
    7563 
    7564 SELECT * FROM dbo.Job WHERE JobState =@State AND CoresNeeded <= @CoresNeeded
    7565  AND MemoryNeeded <= @MemoryNeeded AND
    7566 (
    7567  -- no assigned resources - can be executed everywhere
    7568  NOT EXISTS (SELECT * FROM AssignedResources
    7569  WHERE JobId = Job.JobId)
    7570  
    7571  -- the resource itself is assigned to the job
    7572  OR  EXISTS ((SELECT * FROM AssignedResources
    7573   WHERE JobId = Job.JobId
    7574   AND ResourceId = @ResourceId))
    7575  
    7576   -- a group of the resource is assigned to the job
    7577  OR  EXISTS ((SELECT * FROM AssignedResources 
    7578   WHERE JobId = Job.JobId AND
    7579   ResourceId IN (SELECT * FROM ClientGroups))))
    7580 ORDER BY Priority";
     7504            this._commandCollection[0].CommandText = "SELECT     JobId, ParentJobId, ResourceId, JobState, Percentage, DateCreated, Dat" +
     7505                "eCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded\r\nFROM       " +
     7506                "  Job";
    75817507            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
    7582             this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7583             this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CoresNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "CoresNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7584             this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MemoryNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "MemoryNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    7585             this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75867508            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
    75877509            this._commandCollection[1].Connection = this.Connection;
    7588             this._commandCollection[1].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7589                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7590                 "ROM Job";
     7510            this._commandCollection[1].CommandText = @"SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, ParentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (JobState = 'calculating' OR JobState = 'abort' OR JobState = 'requestSnapshot ' OR JobState = 'requestSnapshotSent') AND (ResourceId = @ResourceId)";
    75917511            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
     7512            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    75927513            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
    75937514            this._commandCollection[2].Connection = this.Connection;
    7594             this._commandCollection[2].CommandText = @"SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, ParentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId FROM Job WHERE (JobState = 'calculating' OR JobState = 'abort' OR JobState = 'requestSnapshot ' OR JobState = 'requestSnapshotSent') AND (ResourceId = @ResourceId)";
     7515            this._commandCollection[2].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
     7516                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7517                "ResourceId = @ResourceId)";
    75957518            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
    75967519            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    75987521            this._commandCollection[3].Connection = this.Connection;
    75997522            this._commandCollection[3].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7600                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7601                 "ROM Job WHERE (ResourceId = @ResourceId)";
     7523                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7524                "JobId = @Id)";
    76027525            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
    7603             this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7526            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    76047527            this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
    76057528            this._commandCollection[4].Connection = this.Connection;
    76067529            this._commandCollection[4].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7607                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7608                 "ROM Job WHERE (JobId = @Id)";
     7530                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7531                "JobId = @Id)";
    76097532            this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
    76107533            this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     
    76127535            this._commandCollection[5].Connection = this.Connection;
    76137536            this._commandCollection[5].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7614                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7615                 "ROM Job WHERE (JobId = @Id)";
     7537                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7538                "ParentJobId = @Id)";
    76167539            this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
    7617             this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7540            this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    76187541            this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
    76197542            this._commandCollection[6].Connection = this.Connection;
    76207543            this._commandCollection[6].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7621                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7622                 "ROM Job WHERE (ParentJobId = @Id)";
     7544                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7545                "ProjectId = @ProjectId)";
    76237546            this._commandCollection[6].CommandType = global::System.Data.CommandType.Text;
    7624             this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7547            this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    76257548            this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand();
    76267549            this._commandCollection[7].Connection = this.Connection;
    76277550            this._commandCollection[7].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7628                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7629                 "ROM Job WHERE (ProjectId = @ProjectId)";
     7551                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7552                "JobState = @State)";
    76307553            this._commandCollection[7].CommandType = global::System.Data.CommandType.Text;
    7631             this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7554            this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    76327555            this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand();
    76337556            this._commandCollection[8].Connection = this.Connection;
    7634             this._commandCollection[8].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7635                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7636                 "ROM Job WHERE (JobState = @State)";
     7557            this._commandCollection[8].CommandText = @"WITH ClientGroups(ClientGroupId) AS (SELECT ClientGroupId FROM ClientGroup_Resource WHERE (ResourceId = @ResourceId) UNION ALL SELECT g.ClientGroupId FROM ClientGroup_Resource AS g INNER JOIN ClientGroups AS gr ON gr.ClientGroupId = g.ResourceId) SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, ParentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (JobState = @State) AND (CoresNeeded <= @CoresNeeded) AND (MemoryNeeded <= @MemoryNeeded) AND (NOT EXISTS (SELECT ResourceId, JobId FROM AssignedResources WHERE (JobId = Job.JobId))) OR (JobState = @State) AND (CoresNeeded <= @CoresNeeded) AND (MemoryNeeded <= @MemoryNeeded) AND EXISTS (SELECT ResourceId, JobId FROM AssignedResources AS AssignedResources_2 WHERE (JobId = Job.JobId) AND (ResourceId = @ResourceId)) OR (JobState = @State) AND (CoresNeeded <= @CoresNeeded) AND (MemoryNeeded <= @MemoryNeeded) AND EXISTS (SELECT ResourceId, JobId FROM AssignedResources AS AssignedResources_1 WHERE (JobId = Job.JobId) AND (ResourceId IN (SELECT ClientGroupId FROM ClientGroups AS ClientGroups_1))) ORDER BY Priority";
    76377558            this._commandCollection[8].CommandType = global::System.Data.CommandType.Text;
    7638             this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7559            this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@State", global::System.Data.SqlDbType.VarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "JobState", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7560            this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CoresNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "CoresNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7561            this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MemoryNeeded", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "MemoryNeeded", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7562            this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    76397563            this._commandCollection[9] = new global::System.Data.SqlClient.SqlCommand();
    76407564            this._commandCollection[9].Connection = this.Connection;
    76417565            this._commandCollection[9].CommandText = "SELECT CoresNeeded, DateCalculated, DateCreated, JobId, JobState, MemoryNeeded, P" +
    7642                 "arentJobId, Percentage, Priority, ProjectId, ResourceId, SerializedJob, UserId F" +
    7643                 "ROM Job WHERE (UserId = @UserId)";
     7566                "arentJobId, Percentage, Priority, ProjectId, ResourceId, UserId FROM Job WHERE (" +
     7567                "UserId = @UserId)";
    76447568            this._commandCollection[9].CommandType = global::System.Data.CommandType.Text;
    76457569            this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "UserId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7570            this._commandCollection[10] = new global::System.Data.SqlClient.SqlCommand();
     7571            this._commandCollection[10].Connection = this.Connection;
     7572            this._commandCollection[10].CommandText = "SELECT SerializedJob FROM Job WHERE JobId = @JobId";
     7573            this._commandCollection[10].CommandType = global::System.Data.CommandType.Text;
     7574            this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7575            this._commandCollection[11] = new global::System.Data.SqlClient.SqlCommand();
     7576            this._commandCollection[11].Connection = this.Connection;
     7577            this._commandCollection[11].CommandText = "UPDATE Job SET SerializedJob = @SerializedJob WHERE JobId = @JobId";
     7578            this._commandCollection[11].CommandType = global::System.Data.CommandType.Text;
     7579            this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SerializedJob", global::System.Data.SqlDbType.VarBinary, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "SerializedJob", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     7580            this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
    76467581        }
    76477582       
     
    76497584        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    76507585        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
    7651         public virtual int FillByStateCoresMemoryResource(dsHiveServer.JobDataTable dataTable, string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
     7586        public virtual int Fill(dsHiveServer.JobDataTable dataTable) {
    76527587            this.Adapter.SelectCommand = this.CommandCollection[0];
    7653             if ((State == null)) {
    7654                 this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
    7655             }
    7656             else {
    7657                 this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    7658             }
    7659             if ((CoresNeeded.HasValue == true)) {
    7660                 this.Adapter.SelectCommand.Parameters[1].Value = ((int)(CoresNeeded.Value));
    7661             }
    7662             else {
    7663                 this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
    7664             }
    7665             if ((MemoryNeeded.HasValue == true)) {
    7666                 this.Adapter.SelectCommand.Parameters[2].Value = ((int)(MemoryNeeded.Value));
    7667             }
    7668             else {
    7669                 this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
    7670             }
    7671             this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    76727588            if ((this.ClearBeforeFill == true)) {
    76737589                dataTable.Clear();
     
    76807596        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    76817597        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
    7682         public virtual dsHiveServer.JobDataTable GetDataByStateCoresMemoryResource(string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
     7598        public virtual dsHiveServer.JobDataTable GetData() {
    76837599            this.Adapter.SelectCommand = this.CommandCollection[0];
    7684             if ((State == null)) {
    7685                 this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
    7686             }
    7687             else {
    7688                 this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    7689             }
    7690             if ((CoresNeeded.HasValue == true)) {
    7691                 this.Adapter.SelectCommand.Parameters[1].Value = ((int)(CoresNeeded.Value));
    7692             }
    7693             else {
    7694                 this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
    7695             }
    7696             if ((MemoryNeeded.HasValue == true)) {
    7697                 this.Adapter.SelectCommand.Parameters[2].Value = ((int)(MemoryNeeded.Value));
    7698             }
    7699             else {
    7700                 this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
    7701             }
    7702             this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    77037600            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    77047601            this.Adapter.Fill(dataTable);
     
    77097606        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77107607        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7711         public virtual int Fill(dsHiveServer.JobDataTable dataTable) {
     7608        public virtual int FillByCalculatingClient(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ResourceId) {
    77127609            this.Adapter.SelectCommand = this.CommandCollection[1];
     7610            if ((ResourceId.HasValue == true)) {
     7611                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ResourceId.Value));
     7612            }
     7613            else {
     7614                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7615            }
    77137616            if ((this.ClearBeforeFill == true)) {
    77147617                dataTable.Clear();
     
    77217624        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77227625        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7723         public virtual dsHiveServer.JobDataTable GetData() {
     7626        public virtual dsHiveServer.JobDataTable GetDataByCalculatingClient(global::System.Nullable<global::System.Guid> ResourceId) {
    77247627            this.Adapter.SelectCommand = this.CommandCollection[1];
     7628            if ((ResourceId.HasValue == true)) {
     7629                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ResourceId.Value));
     7630            }
     7631            else {
     7632                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7633            }
    77257634            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    77267635            this.Adapter.Fill(dataTable);
     
    77317640        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77327641        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7733         public virtual int FillByCalculatingClient(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ResourceId) {
     7642        public virtual int FillByClient(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ResourceId) {
    77347643            this.Adapter.SelectCommand = this.CommandCollection[2];
    77357644            if ((ResourceId.HasValue == true)) {
     
    77497658        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77507659        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7751         public virtual dsHiveServer.JobDataTable GetDataByCalculatingClient(global::System.Nullable<global::System.Guid> ResourceId) {
     7660        public virtual dsHiveServer.JobDataTable GetDataByClient(global::System.Nullable<global::System.Guid> ResourceId) {
    77527661            this.Adapter.SelectCommand = this.CommandCollection[2];
    77537662            if ((ResourceId.HasValue == true)) {
     
    77657674        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77667675        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7767         public virtual int FillByClient(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ResourceId) {
     7676        public virtual int FillById(dsHiveServer.JobDataTable dataTable, System.Guid Id) {
    77687677            this.Adapter.SelectCommand = this.CommandCollection[3];
    7769             if ((ResourceId.HasValue == true)) {
    7770                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ResourceId.Value));
    7771             }
    7772             else {
    7773                 this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
    7774             }
     7678            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
    77757679            if ((this.ClearBeforeFill == true)) {
    77767680                dataTable.Clear();
     
    77837687        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    77847688        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7785         public virtual dsHiveServer.JobDataTable GetDataByClient(global::System.Nullable<global::System.Guid> ResourceId) {
     7689        public virtual dsHiveServer.JobDataTable GetDataById(System.Guid Id) {
    77867690            this.Adapter.SelectCommand = this.CommandCollection[3];
    7787             if ((ResourceId.HasValue == true)) {
    7788                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ResourceId.Value));
    7789             }
    7790             else {
    7791                 this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
    7792             }
     7691            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
    77937692            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    77947693            this.Adapter.Fill(dataTable);
     
    77997698        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78007699        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7801         public virtual int FillById(dsHiveServer.JobDataTable dataTable, System.Guid Id) {
     7700        public virtual int FillByJob(dsHiveServer.JobDataTable dataTable, System.Guid Id) {
    78027701            this.Adapter.SelectCommand = this.CommandCollection[4];
    78037702            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
     
    78127711        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78137712        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7814         public virtual dsHiveServer.JobDataTable GetDataById(System.Guid Id) {
     7713        public virtual dsHiveServer.JobDataTable GetDataByJob(System.Guid Id) {
    78157714            this.Adapter.SelectCommand = this.CommandCollection[4];
    78167715            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
     
    78237722        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78247723        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7825         public virtual int FillByJob(dsHiveServer.JobDataTable dataTable, System.Guid Id) {
     7724        public virtual int FillByParentJob(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> Id) {
    78267725            this.Adapter.SelectCommand = this.CommandCollection[5];
    7827             this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
     7726            if ((Id.HasValue == true)) {
     7727                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id.Value));
     7728            }
     7729            else {
     7730                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7731            }
    78287732            if ((this.ClearBeforeFill == true)) {
    78297733                dataTable.Clear();
     
    78367740        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78377741        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7838         public virtual dsHiveServer.JobDataTable GetDataByJob(System.Guid Id) {
     7742        public virtual dsHiveServer.JobDataTable GetDataByParentJob(global::System.Nullable<global::System.Guid> Id) {
    78397743            this.Adapter.SelectCommand = this.CommandCollection[5];
    7840             this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
     7744            if ((Id.HasValue == true)) {
     7745                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id.Value));
     7746            }
     7747            else {
     7748                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7749            }
    78417750            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    78427751            this.Adapter.Fill(dataTable);
     
    78477756        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78487757        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7849         public virtual int FillByParentJob(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> Id) {
     7758        public virtual int FillByProjectId(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ProjectId) {
    78507759            this.Adapter.SelectCommand = this.CommandCollection[6];
    7851             if ((Id.HasValue == true)) {
    7852                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id.Value));
     7760            if ((ProjectId.HasValue == true)) {
     7761                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ProjectId.Value));
    78537762            }
    78547763            else {
     
    78657774        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78667775        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7867         public virtual dsHiveServer.JobDataTable GetDataByParentJob(global::System.Nullable<global::System.Guid> Id) {
     7776        public virtual dsHiveServer.JobDataTable GetDataByProjectId(global::System.Nullable<global::System.Guid> ProjectId) {
    78687777            this.Adapter.SelectCommand = this.CommandCollection[6];
    7869             if ((Id.HasValue == true)) {
    7870                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id.Value));
     7778            if ((ProjectId.HasValue == true)) {
     7779                this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ProjectId.Value));
    78717780            }
    78727781            else {
     
    78817790        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    78827791        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7883         public virtual int FillByProjectId(dsHiveServer.JobDataTable dataTable, global::System.Nullable<global::System.Guid> ProjectId) {
     7792        public virtual int FillByState(dsHiveServer.JobDataTable dataTable, string State) {
    78847793            this.Adapter.SelectCommand = this.CommandCollection[7];
    7885             if ((ProjectId.HasValue == true)) {
    7886                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ProjectId.Value));
    7887             }
    7888             else {
     7794            if ((State == null)) {
    78897795                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7796            }
     7797            else {
     7798                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    78907799            }
    78917800            if ((this.ClearBeforeFill == true)) {
     
    78997808        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    79007809        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7901         public virtual dsHiveServer.JobDataTable GetDataByProjectId(global::System.Nullable<global::System.Guid> ProjectId) {
     7810        public virtual dsHiveServer.JobDataTable GetDataByState(string State) {
    79027811            this.Adapter.SelectCommand = this.CommandCollection[7];
    7903             if ((ProjectId.HasValue == true)) {
    7904                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ProjectId.Value));
    7905             }
    7906             else {
     7812            if ((State == null)) {
    79077813                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     7814            }
     7815            else {
     7816                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    79087817            }
    79097818            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
     
    79157824        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    79167825        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
    7917         public virtual int FillByState(dsHiveServer.JobDataTable dataTable, string State) {
     7826        public virtual int FillByStateCoresMemoryResource(dsHiveServer.JobDataTable dataTable, string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
    79187827            this.Adapter.SelectCommand = this.CommandCollection[8];
    79197828            if ((State == null)) {
     
    79237832                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    79247833            }
     7834            if ((CoresNeeded.HasValue == true)) {
     7835                this.Adapter.SelectCommand.Parameters[1].Value = ((int)(CoresNeeded.Value));
     7836            }
     7837            else {
     7838                this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     7839            }
     7840            if ((MemoryNeeded.HasValue == true)) {
     7841                this.Adapter.SelectCommand.Parameters[2].Value = ((int)(MemoryNeeded.Value));
     7842            }
     7843            else {
     7844                this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
     7845            }
     7846            this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    79257847            if ((this.ClearBeforeFill == true)) {
    79267848                dataTable.Clear();
     
    79337855        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    79347856        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
    7935         public virtual dsHiveServer.JobDataTable GetDataByState(string State) {
     7857        public virtual dsHiveServer.JobDataTable GetDataByStateCoresMemoryResource(string State, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded, System.Guid ResourceId) {
    79367858            this.Adapter.SelectCommand = this.CommandCollection[8];
    79377859            if ((State == null)) {
     
    79417863                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(State));
    79427864            }
     7865            if ((CoresNeeded.HasValue == true)) {
     7866                this.Adapter.SelectCommand.Parameters[1].Value = ((int)(CoresNeeded.Value));
     7867            }
     7868            else {
     7869                this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     7870            }
     7871            if ((MemoryNeeded.HasValue == true)) {
     7872                this.Adapter.SelectCommand.Parameters[2].Value = ((int)(MemoryNeeded.Value));
     7873            }
     7874            else {
     7875                this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
     7876            }
     7877            this.Adapter.SelectCommand.Parameters[3].Value = ((System.Guid)(ResourceId));
    79437878            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
    79447879            this.Adapter.Fill(dataTable);
     
    81098044        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    81108045        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
    8111         public virtual int Insert(System.Guid JobId, global::System.Nullable<global::System.Guid> ParentJobId, string JobState, global::System.Nullable<global::System.Guid> ResourceId, global::System.Nullable<double> Percentage, byte[] SerializedJob, global::System.Nullable<global::System.DateTime> DateCreated, global::System.Nullable<global::System.DateTime> DateCalculated, global::System.Nullable<int> Priority, global::System.Nullable<global::System.Guid> ProjectId, global::System.Nullable<global::System.Guid> UserId, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded) {
     8046        public virtual int Insert(System.Guid JobId, global::System.Nullable<global::System.Guid> ParentJobId, global::System.Nullable<global::System.Guid> ResourceId, string JobState, global::System.Nullable<double> Percentage, global::System.Nullable<global::System.DateTime> DateCreated, global::System.Nullable<global::System.DateTime> DateCalculated, global::System.Nullable<int> Priority, global::System.Nullable<global::System.Guid> ProjectId, global::System.Nullable<global::System.Guid> UserId, global::System.Nullable<int> CoresNeeded, global::System.Nullable<int> MemoryNeeded) {
    81128047            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(JobId));
    81138048            if ((ParentJobId.HasValue == true)) {
     
    81178052                this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
    81188053            }
     8054            if ((ResourceId.HasValue == true)) {
     8055                this.Adapter.InsertCommand.Parameters[2].Value = ((System.Guid)(ResourceId.Value));
     8056            }
     8057            else {
     8058                this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
     8059            }
    81198060            if ((JobState == null)) {
    8120                 this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
    8121             }
    8122             else {
    8123                 this.Adapter.InsertCommand.Parameters[2].Value = ((string)(JobState));
    8124             }
    8125             if ((ResourceId.HasValue == true)) {
    8126                 this.Adapter.InsertCommand.Parameters[3].Value = ((System.Guid)(ResourceId.Value));
    8127             }
    8128             else {
    81298061                this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
     8062            }
     8063            else {
     8064                this.Adapter.InsertCommand.Parameters[3].Value = ((string)(JobState));
    81308065            }
    81318066            if ((Percentage.HasValue == true)) {
     
    81358070                this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
    81368071            }
    8137             if ((SerializedJob == null)) {
     8072            if ((DateCreated.HasValue == true)) {
     8073                this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(DateCreated.Value));
     8074            }
     8075            else {
    81388076                this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value;
    81398077            }
    8140             else {
    8141                 this.Adapter.InsertCommand.Parameters[5].Value = ((byte[])(SerializedJob));
    8142             }
    8143             if ((DateCreated.HasValue == true)) {
    8144                 this.Adapter.InsertCommand.Parameters[6].Value = ((System.DateTime)(DateCreated.Value));
     8078            if ((DateCalculated.HasValue == true)) {
     8079                this.Adapter.InsertCommand.Parameters[6].Value = ((System.DateTime)(DateCalculated.Value));
    81458080            }
    81468081            else {
    81478082                this.Adapter.InsertCommand.Parameters[6].Value = global::System.DBNull.Value;
    81488083            }
    8149             if ((DateCalculated.HasValue == true)) {
    8150                 this.Adapter.InsertCommand.Parameters[7].Value = ((System.DateTime)(DateCalculated.Value));
     8084            if ((Priority.HasValue == true)) {
     8085                this.Adapter.InsertCommand.Parameters[7].Value = ((int)(Priority.Value));
    81518086            }
    81528087            else {
    81538088                this.Adapter.InsertCommand.Parameters[7].Value = global::System.DBNull.Value;
    81548089            }
    8155             if ((Priority.HasValue == true)) {
    8156                 this.Adapter.InsertCommand.Parameters[8].Value = ((int)(Priority.Value));
     8090            if ((ProjectId.HasValue == true)) {
     8091                this.Adapter.InsertCommand.Parameters[8].Value = ((System.Guid)(ProjectId.Value));
    81578092            }
    81588093            else {
    81598094                this.Adapter.InsertCommand.Parameters[8].Value = global::System.DBNull.Value;
    81608095            }
    8161             if ((ProjectId.HasValue == true)) {
    8162                 this.Adapter.InsertCommand.Parameters[9].Value = ((System.Guid)(ProjectId.Value));
     8096            if ((UserId.HasValue == true)) {
     8097                this.Adapter.InsertCommand.Parameters[9].Value = ((System.Guid)(UserId.Value));
    81638098            }
    81648099            else {
    81658100                this.Adapter.InsertCommand.Parameters[9].Value = global::System.DBNull.Value;
    81668101            }
    8167             if ((UserId.HasValue == true)) {
    8168                 this.Adapter.InsertCommand.Parameters[10].Value = ((System.Guid)(UserId.Value));
     8102            if ((CoresNeeded.HasValue == true)) {
     8103                this.Adapter.InsertCommand.Parameters[10].Value = ((int)(CoresNeeded.Value));
    81698104            }
    81708105            else {
    81718106                this.Adapter.InsertCommand.Parameters[10].Value = global::System.DBNull.Value;
    81728107            }
    8173             if ((CoresNeeded.HasValue == true)) {
    8174                 this.Adapter.InsertCommand.Parameters[11].Value = ((int)(CoresNeeded.Value));
     8108            if ((MemoryNeeded.HasValue == true)) {
     8109                this.Adapter.InsertCommand.Parameters[11].Value = ((int)(MemoryNeeded.Value));
    81758110            }
    81768111            else {
    81778112                this.Adapter.InsertCommand.Parameters[11].Value = global::System.DBNull.Value;
    8178             }
    8179             if ((MemoryNeeded.HasValue == true)) {
    8180                 this.Adapter.InsertCommand.Parameters[12].Value = ((int)(MemoryNeeded.Value));
    8181             }
    8182             else {
    8183                 this.Adapter.InsertCommand.Parameters[12].Value = global::System.DBNull.Value;
    81848113            }
    81858114            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
     
    82058134                    System.Guid JobId,
    82068135                    global::System.Nullable<global::System.Guid> ParentJobId,
     8136                    global::System.Nullable<global::System.Guid> ResourceId,
    82078137                    string JobState,
    8208                     global::System.Nullable<global::System.Guid> ResourceId,
    82098138                    global::System.Nullable<double> Percentage,
    8210                     byte[] SerializedJob,
    82118139                    global::System.Nullable<global::System.DateTime> DateCreated,
    82128140                    global::System.Nullable<global::System.DateTime> DateCalculated,
     
    82348162                this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
    82358163            }
     8164            if ((ResourceId.HasValue == true)) {
     8165                this.Adapter.UpdateCommand.Parameters[2].Value = ((System.Guid)(ResourceId.Value));
     8166            }
     8167            else {
     8168                this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
     8169            }
    82368170            if ((JobState == null)) {
    8237                 this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
    8238             }
    8239             else {
    8240                 this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(JobState));
    8241             }
    8242             if ((ResourceId.HasValue == true)) {
    8243                 this.Adapter.UpdateCommand.Parameters[3].Value = ((System.Guid)(ResourceId.Value));
    8244             }
    8245             else {
    82468171                this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
     8172            }
     8173            else {
     8174                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(JobState));
    82478175            }
    82488176            if ((Percentage.HasValue == true)) {
     
    82528180                this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
    82538181            }
    8254             if ((SerializedJob == null)) {
     8182            if ((DateCreated.HasValue == true)) {
     8183                this.Adapter.UpdateCommand.Parameters[5].Value = ((System.DateTime)(DateCreated.Value));
     8184            }
     8185            else {
    82558186                this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value;
    82568187            }
    8257             else {
    8258                 this.Adapter.UpdateCommand.Parameters[5].Value = ((byte[])(SerializedJob));
    8259             }
    8260             if ((DateCreated.HasValue == true)) {
    8261                 this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(DateCreated.Value));
     8188            if ((DateCalculated.HasValue == true)) {
     8189                this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(DateCalculated.Value));
    82628190            }
    82638191            else {
    82648192                this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value;
    82658193            }
    8266             if ((DateCalculated.HasValue == true)) {
    8267                 this.Adapter.UpdateCommand.Parameters[7].Value = ((System.DateTime)(DateCalculated.Value));
     8194            if ((Priority.HasValue == true)) {
     8195                this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Priority.Value));
    82688196            }
    82698197            else {
    82708198                this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value;
    82718199            }
    8272             if ((Priority.HasValue == true)) {
    8273                 this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Priority.Value));
     8200            if ((ProjectId.HasValue == true)) {
     8201                this.Adapter.UpdateCommand.Parameters[8].Value = ((System.Guid)(ProjectId.Value));
    82748202            }
    82758203            else {
    82768204                this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
    82778205            }
    8278             if ((ProjectId.HasValue == true)) {
    8279                 this.Adapter.UpdateCommand.Parameters[9].Value = ((System.Guid)(ProjectId.Value));
     8206            if ((UserId.HasValue == true)) {
     8207                this.Adapter.UpdateCommand.Parameters[9].Value = ((System.Guid)(UserId.Value));
    82808208            }
    82818209            else {
    82828210                this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value;
    82838211            }
    8284             if ((UserId.HasValue == true)) {
    8285                 this.Adapter.UpdateCommand.Parameters[10].Value = ((System.Guid)(UserId.Value));
     8212            if ((CoresNeeded.HasValue == true)) {
     8213                this.Adapter.UpdateCommand.Parameters[10].Value = ((int)(CoresNeeded.Value));
    82868214            }
    82878215            else {
    82888216                this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
    82898217            }
    8290             if ((CoresNeeded.HasValue == true)) {
    8291                 this.Adapter.UpdateCommand.Parameters[11].Value = ((int)(CoresNeeded.Value));
     8218            if ((MemoryNeeded.HasValue == true)) {
     8219                this.Adapter.UpdateCommand.Parameters[11].Value = ((int)(MemoryNeeded.Value));
    82928220            }
    82938221            else {
    82948222                this.Adapter.UpdateCommand.Parameters[11].Value = global::System.DBNull.Value;
    82958223            }
    8296             if ((MemoryNeeded.HasValue == true)) {
    8297                 this.Adapter.UpdateCommand.Parameters[12].Value = ((int)(MemoryNeeded.Value));
    8298             }
    8299             else {
    8300                 this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value;
    8301             }
    8302             this.Adapter.UpdateCommand.Parameters[13].Value = ((System.Guid)(Original_JobId));
     8224            this.Adapter.UpdateCommand.Parameters[12].Value = ((System.Guid)(Original_JobId));
    83038225            if ((Original_ParentJobId.HasValue == true)) {
    8304                 this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(0));
    8305                 this.Adapter.UpdateCommand.Parameters[15].Value = ((System.Guid)(Original_ParentJobId.Value));
    8306             }
    8307             else {
    8308                 this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(1));
    8309                 this.Adapter.UpdateCommand.Parameters[15].Value = global::System.DBNull.Value;
     8226                this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0));
     8227                this.Adapter.UpdateCommand.Parameters[14].Value = ((System.Guid)(Original_ParentJobId.Value));
     8228            }
     8229            else {
     8230                this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1));
     8231                this.Adapter.UpdateCommand.Parameters[14].Value = global::System.DBNull.Value;
    83108232            }
    83118233            if ((Original_ResourceId.HasValue == true)) {
    8312                 this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(0));
    8313                 this.Adapter.UpdateCommand.Parameters[17].Value = ((System.Guid)(Original_ResourceId.Value));
    8314             }
    8315             else {
    8316                 this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(1));
    8317                 this.Adapter.UpdateCommand.Parameters[17].Value = global::System.DBNull.Value;
     8234                this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0));
     8235                this.Adapter.UpdateCommand.Parameters[16].Value = ((System.Guid)(Original_ResourceId.Value));
     8236            }
     8237            else {
     8238                this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1));
     8239                this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value;
    83188240            }
    83198241            if ((Original_Percentage.HasValue == true)) {
    8320                 this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(0));
    8321                 this.Adapter.UpdateCommand.Parameters[19].Value = ((double)(Original_Percentage.Value));
    8322             }
    8323             else {
    8324                 this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(1));
    8325                 this.Adapter.UpdateCommand.Parameters[19].Value = global::System.DBNull.Value;
     8242                this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0));
     8243                this.Adapter.UpdateCommand.Parameters[18].Value = ((double)(Original_Percentage.Value));
     8244            }
     8245            else {
     8246                this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1));
     8247                this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value;
    83268248            }
    83278249            if ((Original_DateCreated.HasValue == true)) {
    8328                 this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0));
    8329                 this.Adapter.UpdateCommand.Parameters[21].Value = ((System.DateTime)(Original_DateCreated.Value));
    8330             }
    8331             else {
    8332                 this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(1));
    8333                 this.Adapter.UpdateCommand.Parameters[21].Value = global::System.DBNull.Value;
     8250                this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(0));
     8251                this.Adapter.UpdateCommand.Parameters[20].Value = ((System.DateTime)(Original_DateCreated.Value));
     8252            }
     8253            else {
     8254                this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(1));
     8255                this.Adapter.UpdateCommand.Parameters[20].Value = global::System.DBNull.Value;
    83348256            }
    83358257            if ((Original_DateCalculated.HasValue == true)) {
    8336                 this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(0));
    8337                 this.Adapter.UpdateCommand.Parameters[23].Value = ((System.DateTime)(Original_DateCalculated.Value));
    8338             }
    8339             else {
    8340                 this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(1));
    8341                 this.Adapter.UpdateCommand.Parameters[23].Value = global::System.DBNull.Value;
     8258                this.Adapter.UpdateCommand.Parameters[21].Value = ((object)(0));
     8259                this.Adapter.UpdateCommand.Parameters[22].Value = ((System.DateTime)(Original_DateCalculated.Value));
     8260            }
     8261            else {
     8262                this.Adapter.UpdateCommand.Parameters[21].Value = ((object)(1));
     8263                this.Adapter.UpdateCommand.Parameters[22].Value = global::System.DBNull.Value;
    83428264            }
    83438265            if ((Original_Priority.HasValue == true)) {
    8344                 this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(0));
    8345                 this.Adapter.UpdateCommand.Parameters[25].Value = ((int)(Original_Priority.Value));
    8346             }
    8347             else {
    8348                 this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(1));
    8349                 this.Adapter.UpdateCommand.Parameters[25].Value = global::System.DBNull.Value;
     8266                this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(0));
     8267                this.Adapter.UpdateCommand.Parameters[24].Value = ((int)(Original_Priority.Value));
     8268            }
     8269            else {
     8270                this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(1));
     8271                this.Adapter.UpdateCommand.Parameters[24].Value = global::System.DBNull.Value;
    83508272            }
    83518273            if ((Original_ProjectId.HasValue == true)) {
    8352                 this.Adapter.UpdateCommand.Parameters[26].Value = ((object)(0));
    8353                 this.Adapter.UpdateCommand.Parameters[27].Value = ((System.Guid)(Original_ProjectId.Value));
    8354             }
    8355             else {
    8356                 this.Adapter.UpdateCommand.Parameters[26].Value = ((object)(1));
    8357                 this.Adapter.UpdateCommand.Parameters[27].Value = global::System.DBNull.Value;
     8274                this.Adapter.UpdateCommand.Parameters[25].Value = ((object)(0));
     8275                this.Adapter.UpdateCommand.Parameters[26].Value = ((System.Guid)(Original_ProjectId.Value));
     8276            }
     8277            else {
     8278                this.Adapter.UpdateCommand.Parameters[25].Value = ((object)(1));
     8279                this.Adapter.UpdateCommand.Parameters[26].Value = global::System.DBNull.Value;
    83588280            }
    83598281            if ((Original_UserId.HasValue == true)) {
    8360                 this.Adapter.UpdateCommand.Parameters[28].Value = ((object)(0));
    8361                 this.Adapter.UpdateCommand.Parameters[29].Value = ((System.Guid)(Original_UserId.Value));
    8362             }
    8363             else {
    8364                 this.Adapter.UpdateCommand.Parameters[28].Value = ((object)(1));
    8365                 this.Adapter.UpdateCommand.Parameters[29].Value = global::System.DBNull.Value;
     8282                this.Adapter.UpdateCommand.Parameters[27].Value = ((object)(0));
     8283                this.Adapter.UpdateCommand.Parameters[28].Value = ((System.Guid)(Original_UserId.Value));
     8284            }
     8285            else {
     8286                this.Adapter.UpdateCommand.Parameters[27].Value = ((object)(1));
     8287                this.Adapter.UpdateCommand.Parameters[28].Value = global::System.DBNull.Value;
    83668288            }
    83678289            if ((Original_CoresNeeded.HasValue == true)) {
    8368                 this.Adapter.UpdateCommand.Parameters[30].Value = ((object)(0));
    8369                 this.Adapter.UpdateCommand.Parameters[31].Value = ((int)(Original_CoresNeeded.Value));
    8370             }
    8371             else {
    8372                 this.Adapter.UpdateCommand.Parameters[30].Value = ((object)(1));
    8373                 this.Adapter.UpdateCommand.Parameters[31].Value = global::System.DBNull.Value;
     8290                this.Adapter.UpdateCommand.Parameters[29].Value = ((object)(0));
     8291                this.Adapter.UpdateCommand.Parameters[30].Value = ((int)(Original_CoresNeeded.Value));
     8292            }
     8293            else {
     8294                this.Adapter.UpdateCommand.Parameters[29].Value = ((object)(1));
     8295                this.Adapter.UpdateCommand.Parameters[30].Value = global::System.DBNull.Value;
    83748296            }
    83758297            if ((Original_MemoryNeeded.HasValue == true)) {
    8376                 this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(0));
    8377                 this.Adapter.UpdateCommand.Parameters[33].Value = ((int)(Original_MemoryNeeded.Value));
    8378             }
    8379             else {
    8380                 this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(1));
    8381                 this.Adapter.UpdateCommand.Parameters[33].Value = global::System.DBNull.Value;
     8298                this.Adapter.UpdateCommand.Parameters[31].Value = ((object)(0));
     8299                this.Adapter.UpdateCommand.Parameters[32].Value = ((int)(Original_MemoryNeeded.Value));
     8300            }
     8301            else {
     8302                this.Adapter.UpdateCommand.Parameters[31].Value = ((object)(1));
     8303                this.Adapter.UpdateCommand.Parameters[32].Value = global::System.DBNull.Value;
    83828304            }
    83838305            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
     
    84028324        public virtual int Update(
    84038325                    global::System.Nullable<global::System.Guid> ParentJobId,
     8326                    global::System.Nullable<global::System.Guid> ResourceId,
    84048327                    string JobState,
    8405                     global::System.Nullable<global::System.Guid> ResourceId,
    84068328                    global::System.Nullable<double> Percentage,
    8407                     byte[] SerializedJob,
    84088329                    global::System.Nullable<global::System.DateTime> DateCreated,
    84098330                    global::System.Nullable<global::System.DateTime> DateCalculated,
     
    84248345                    global::System.Nullable<int> Original_CoresNeeded,
    84258346                    global::System.Nullable<int> Original_MemoryNeeded) {
    8426             return this.Update(Original_JobId, ParentJobId, JobState, ResourceId, Percentage, SerializedJob, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded, Original_JobId, Original_ParentJobId, Original_ResourceId, Original_Percentage, Original_DateCreated, Original_DateCalculated, Original_Priority, Original_ProjectId, Original_UserId, Original_CoresNeeded, Original_MemoryNeeded);
     8347            return this.Update(Original_JobId, ParentJobId, ResourceId, JobState, Percentage, DateCreated, DateCalculated, Priority, ProjectId, UserId, CoresNeeded, MemoryNeeded, Original_JobId, Original_ParentJobId, Original_ResourceId, Original_Percentage, Original_DateCreated, Original_DateCalculated, Original_Priority, Original_ProjectId, Original_UserId, Original_CoresNeeded, Original_MemoryNeeded);
     8348        }
     8349       
     8350        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     8351        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
     8352        public virtual byte[] GetSerializedJobById(System.Guid JobId) {
     8353            global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[10];
     8354            command.Parameters[0].Value = ((System.Guid)(JobId));
     8355            global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
     8356            if (((command.Connection.State & global::System.Data.ConnectionState.Open)
     8357                        != global::System.Data.ConnectionState.Open)) {
     8358                command.Connection.Open();
     8359            }
     8360            object returnValue;
     8361            try {
     8362                returnValue = command.ExecuteScalar();
     8363            }
     8364            finally {
     8365                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
     8366                    command.Connection.Close();
     8367                }
     8368            }
     8369            if (((returnValue == null)
     8370                        || (returnValue.GetType() == typeof(global::System.DBNull)))) {
     8371                return null;
     8372            }
     8373            else {
     8374                return ((byte[])(returnValue));
     8375            }
     8376        }
     8377       
     8378        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     8379        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
     8380        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)]
     8381        public virtual int UpdateSerializedJob(byte[] SerializedJob, System.Guid JobId) {
     8382            global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[11];
     8383            if ((SerializedJob == null)) {
     8384                command.Parameters[0].Value = global::System.DBNull.Value;
     8385            }
     8386            else {
     8387                command.Parameters[0].Value = ((byte[])(SerializedJob));
     8388            }
     8389            command.Parameters[1].Value = ((System.Guid)(JobId));
     8390            global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
     8391            if (((command.Connection.State & global::System.Data.ConnectionState.Open)
     8392                        != global::System.Data.ConnectionState.Open)) {
     8393                command.Connection.Open();
     8394            }
     8395            int returnValue;
     8396            try {
     8397                returnValue = command.ExecuteNonQuery();
     8398            }
     8399            finally {
     8400                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
     8401                    command.Connection.Close();
     8402                }
     8403            }
     8404            return returnValue;
    84278405        }
    84288406    }
Note: See TracChangeset for help on using the changeset viewer.