diff --git a/bsmd.database/Waste.cs b/bsmd.database/Waste.cs index 8ab257d8..0f5cb68a 100644 --- a/bsmd.database/Waste.cs +++ b/bsmd.database/Waste.cs @@ -114,11 +114,7 @@ namespace bsmd.database [ShowReport] [ENI2Validation] [Validation(ValidationCode.NOT_NULL)] - public double? WasteAmountGeneratedTillNextPort_MTQ { get; set; } - - [Obsolete] - [ENI2Validation] - public double? WasteDisposedAtLastPort_MTQ { get; set; } + public double? WasteAmountGeneratedTillNextPort_MTQ { get; set; } public string Identifier { get; set; } @@ -179,9 +175,8 @@ namespace bsmd.database scmd.Parameters.AddWithNullableValue("@P5", this.WasteCapacity_MTQ); scmd.Parameters.AddWithNullableValue("@P6", this.WasteAmountRetained_MTQ); scmd.Parameters.AddWithNullableValue("@P7", this.WasteDisposalPort); - scmd.Parameters.AddWithNullableValue("@P8", this.WasteAmountGeneratedTillNextPort_MTQ); - scmd.Parameters.AddWithNullableValue("@P9", this.WasteDisposedAtLastPort_MTQ); - scmd.Parameters.AddWithNullableValue("@P10", this.Identifier); + scmd.Parameters.AddWithNullableValue("@P8", this.WasteAmountGeneratedTillNextPort_MTQ); + scmd.Parameters.AddWithNullableValue("@P9", this.Identifier); if (this.IsNew) { @@ -189,16 +184,16 @@ namespace bsmd.database scmd.Parameters.AddWithValue("@ID", this.Id); scmd.CommandText = string.Format("INSERT INTO {0} (Id, WASId, WasteType, WasteDescription, " + "WasteDisposalAmount_MTQ, WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, " + - "WasteAmountGeneratedTillNextPort_MTQ, WasteDisposedAtLastPort_MTQ, Identifier) " + - " VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10 )", this.Tablename); + "WasteAmountGeneratedTillNextPort_MTQ, Identifier) " + + " VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9 )", this.Tablename); } else { scmd.Parameters.AddWithValue("@ID", this.Id); scmd.CommandText = string.Format("UPDATE {0} SET WasteType = @P2, WasteDescription = @P3, " + "WasteDisposalAmount_MTQ = @P4, WasteCapacity_MTQ = @P5, WasteAmountRetained_MTQ = @P6," + - "WasteDisposalPort = @P7, WasteAmountGeneratedTillNextPort_MTQ = @P8, WasteDisposedAtLastPort_MTQ = @P9, " + - "Identifier = @P10 WHERE Id = @ID", this.Tablename); + "WasteDisposalPort = @P7, WasteAmountGeneratedTillNextPort_MTQ = @P8, " + + "Identifier = @P9 WHERE Id = @ID", this.Tablename); } } @@ -206,7 +201,7 @@ namespace bsmd.database { string query = string.Format("SELECT Id, WasteType, WasteDescription, WasteDisposalAmount_MTQ, " + "WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, WasteAmountGeneratedTillNextPort_MTQ, " + - "WasteDisposedAtLastPort_MTQ, Identifier FROM {0} ", this.Tablename); + "Identifier FROM {0} ", this.Tablename); switch (filter) { @@ -238,9 +233,8 @@ namespace bsmd.database if (!reader.IsDBNull(4)) waste.WasteCapacity_MTQ = (float) reader.GetDouble(4); if (!reader.IsDBNull(5)) waste.WasteAmountRetained_MTQ = (float) reader.GetDouble(5); if (!reader.IsDBNull(6)) waste.WasteDisposalPort = reader.GetString(6); - if (!reader.IsDBNull(7)) waste.WasteAmountGeneratedTillNextPort_MTQ = (float) reader.GetDouble(7); - if (!reader.IsDBNull(8)) waste.WasteDisposedAtLastPort_MTQ = (float)reader.GetDouble(8); - if (!reader.IsDBNull(9)) waste.Identifier = reader.GetString(9); + if (!reader.IsDBNull(7)) waste.WasteAmountGeneratedTillNextPort_MTQ = (float) reader.GetDouble(7); + if (!reader.IsDBNull(8)) waste.Identifier = reader.GetString(8); result.Add(waste); } reader.Close();