Sage.Integration.Northwind.Adapter.Data.SalesOrders.DataSets.OrderTableAdapters.OrdersTableAdapter.Delete C# (CSharp) Method

Delete() private method

private Delete ( int Original_OrderID, string Original_CustomerID, global Original_EmployeeID, global Original_OrderDate, global Original_RequiredDate, global Original_ShippedDate, global Original_ShipVia, global Original_Freight, string Original_ShipName, string Original_ShipAddress, string Original_ShipCity, string Original_ShipRegion, string Original_ShipPostalCode, string Original_ShipCountry, global Original_CreateID, string Original_CreateUser, global Original_ModifyID, string Original_ModifyUser ) : int
Original_OrderID int
Original_CustomerID string
Original_EmployeeID global
Original_OrderDate global
Original_RequiredDate global
Original_ShippedDate global
Original_ShipVia global
Original_Freight global
Original_ShipName string
Original_ShipAddress string
Original_ShipCity string
Original_ShipRegion string
Original_ShipPostalCode string
Original_ShipCountry string
Original_CreateID global
Original_CreateUser string
Original_ModifyID global
Original_ModifyUser string
return int
        public virtual int Delete(
                    int Original_OrderID, 
                    string Original_CustomerID, 
                    global::System.Nullable<int> Original_EmployeeID, 
                    global::System.Nullable<global::System.DateTime> Original_OrderDate, 
                    global::System.Nullable<global::System.DateTime> Original_RequiredDate, 
                    global::System.Nullable<global::System.DateTime> Original_ShippedDate, 
                    global::System.Nullable<int> Original_ShipVia, 
                    global::System.Nullable<decimal> Original_Freight, 
                    string Original_ShipName, 
                    string Original_ShipAddress, 
                    string Original_ShipCity, 
                    string Original_ShipRegion, 
                    string Original_ShipPostalCode, 
                    string Original_ShipCountry, 
                    global::System.Nullable<int> Original_CreateID, 
                    string Original_CreateUser, 
                    global::System.Nullable<int> Original_ModifyID, 
                    string Original_ModifyUser) {
            this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_OrderID));
            if ((Original_CustomerID == null)) {
                this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_CustomerID));
            }
            if ((Original_EmployeeID.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_EmployeeID.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
            }
            if ((Original_OrderDate.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[6].Value = ((System.DateTime)(Original_OrderDate.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
            }
            if ((Original_RequiredDate.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[8].Value = ((System.DateTime)(Original_RequiredDate.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
            }
            if ((Original_ShippedDate.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[10].Value = ((System.DateTime)(Original_ShippedDate.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
            }
            if ((Original_ShipVia.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[12].Value = ((int)(Original_ShipVia.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[12].Value = global::System.DBNull.Value;
            }
            if ((Original_Freight.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[14].Value = ((decimal)(Original_Freight.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[14].Value = global::System.DBNull.Value;
            }
            if ((Original_ShipName == null)) {
                this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[16].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[16].Value = ((string)(Original_ShipName));
            }
            if ((Original_ShipAddress == null)) {
                this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[18].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[18].Value = ((string)(Original_ShipAddress));
            }
            if ((Original_ShipCity == null)) {
                this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[20].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[20].Value = ((string)(Original_ShipCity));
            }
            if ((Original_ShipRegion == null)) {
                this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[22].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[22].Value = ((string)(Original_ShipRegion));
            }
            if ((Original_ShipPostalCode == null)) {
                this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[24].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[24].Value = ((string)(Original_ShipPostalCode));
            }
            if ((Original_ShipCountry == null)) {
                this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[26].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[26].Value = ((string)(Original_ShipCountry));
            }
            if ((Original_CreateID.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[27].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[28].Value = ((int)(Original_CreateID.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[27].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[28].Value = global::System.DBNull.Value;
            }
            if ((Original_CreateUser == null)) {
                this.Adapter.DeleteCommand.Parameters[29].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[30].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[29].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[30].Value = ((string)(Original_CreateUser));
            }
            if ((Original_ModifyID.HasValue == true)) {
                this.Adapter.DeleteCommand.Parameters[31].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[32].Value = ((int)(Original_ModifyID.Value));
            }
            else {
                this.Adapter.DeleteCommand.Parameters[31].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[32].Value = global::System.DBNull.Value;
            }
            if ((Original_ModifyUser == null)) {
                this.Adapter.DeleteCommand.Parameters[33].Value = ((object)(1));
                this.Adapter.DeleteCommand.Parameters[34].Value = global::System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[33].Value = ((object)(0));
                this.Adapter.DeleteCommand.Parameters[34].Value = ((string)(Original_ModifyUser));
            }
            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
                        != global::System.Data.ConnectionState.Open)) {
                this.Adapter.DeleteCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
                    this.Adapter.DeleteCommand.Connection.Close();
                }
            }
        }