public virtual int Delete(int Original_ProductID, string Original_ProductName, System.Nullable<int> Original_SupplierID, System.Nullable<int> Original_CategoryID, string Original_QuantityPerUnit, System.Nullable<decimal> Original_UnitPrice, System.Nullable<short> Original_UnitsInStock, System.Nullable<short> Original_UnitsOnOrder, System.Nullable<short> Original_ReorderLevel, bool Original_Discontinued, System.Nullable<int> Original_CreateID, string Original_CreateUser, System.Nullable<int> Original_ModifyID, string Original_ModifyUser) {
this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ProductID));
if ((Original_ProductName == null)) {
throw new System.ArgumentNullException("Original_ProductName");
}
else {
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_ProductName));
}
if ((Original_SupplierID.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_SupplierID.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[4].Value = System.DBNull.Value;
}
if ((Original_CategoryID.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[6].Value = ((int)(Original_CategoryID.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[6].Value = System.DBNull.Value;
}
if ((Original_QuantityPerUnit == null)) {
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[8].Value = System.DBNull.Value;
}
else {
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[8].Value = ((string)(Original_QuantityPerUnit));
}
if ((Original_UnitPrice.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[10].Value = ((decimal)(Original_UnitPrice.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[10].Value = System.DBNull.Value;
}
if ((Original_UnitsInStock.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[12].Value = ((short)(Original_UnitsInStock.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[12].Value = System.DBNull.Value;
}
if ((Original_UnitsOnOrder.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[14].Value = ((short)(Original_UnitsOnOrder.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[14].Value = System.DBNull.Value;
}
if ((Original_ReorderLevel.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[16].Value = ((short)(Original_ReorderLevel.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[16].Value = System.DBNull.Value;
}
this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[18].Value = ((bool)(Original_Discontinued));
if ((Original_CreateID.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[20].Value = ((int)(Original_CreateID.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[20].Value = System.DBNull.Value;
}
if ((Original_CreateUser == null)) {
this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[22].Value = System.DBNull.Value;
}
else {
this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[22].Value = ((string)(Original_CreateUser));
}
if ((Original_ModifyID.HasValue == true)) {
this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[24].Value = ((int)(Original_ModifyID.Value));
}
else {
this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[24].Value = System.DBNull.Value;
}
if ((Original_ModifyUser == null)) {
this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[26].Value = System.DBNull.Value;
}
else {
this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[26].Value = ((string)(Original_ModifyUser));
}
System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open)
!= System.Data.ConnectionState.Open)) {
this.Adapter.DeleteCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
this.Adapter.DeleteCommand.Connection.Close();
}
}
}