///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5SH_GCwDfT_1454_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5SH_GCwDfT_1454 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5SH_GCwDfT_1454_Array functionReturn = new FR_L5SH_GCwDfT_1454_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Get_Client_Orders_with_Details_for_TenantID", ex); } return(functionReturn); }
protected static FR_L5SH_GCwDfT_1454_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5SH_GCwDfT_1454 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5SH_GCwDfT_1454_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOBilling_Shipment.Atomic.Retrieval.SQL.cls_Get_Client_Orders_with_Details_for_TenantID.sql"; command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd(); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket); command.CommandTimeout = QueryTimeout; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "OrderNumber", Parameter.OrderNumber); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Customer", Parameter.Customer); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "PeriodFrom", Parameter.PeriodFrom); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "PeriodTo", Parameter.PeriodTo); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DeliveryFrom", Parameter.DeliveryFrom); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DeliveryTo", Parameter.DeliveryTo); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ShipmentStatusID_Shipped", Parameter.ShipmentStatusID_Shipped); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ShipmentStatusID_Created", Parameter.ShipmentStatusID_Created); List <L5SH_GCwDfT_1454_raw> results = new List <L5SH_GCwDfT_1454_raw>(); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); try { reader.SetOrdinals(new string[] { "LOG_SHP_Shipment_HeaderID", "StatusShipmentDate", "ShipmentHeader_Number", "ShipmentHeader_Creation_Timestamp", "CustomerName", "OrderDate", "InternalCustomerNumber", "CMN_BPT_CTM_CustomerID", "CreatedByName", "CMN_PRO_Product_RefID", "ShipmentPosition_ValueWithoutTax", "CurrencySymbol", "TaxRate" }); while (reader.Read()) { L5SH_GCwDfT_1454_raw resultItem = new L5SH_GCwDfT_1454_raw(); //0:Parameter LOG_SHP_Shipment_HeaderID of type Guid resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(0); //1:Parameter StatusShipmentDate of type DateTime resultItem.StatusShipmentDate = reader.GetDate(1); //2:Parameter ShipmentHeader_Number of type string resultItem.ShipmentHeader_Number = reader.GetString(2); //3:Parameter ShipmentHeader_Creation_Timestamp of type DateTime resultItem.ShipmentHeader_Creation_Timestamp = reader.GetDate(3); //4:Parameter CustomerName of type string resultItem.CustomerName = reader.GetString(4); //5:Parameter OrderDate of type DateTime resultItem.OrderDate = reader.GetDate(5); //6:Parameter InternalCustomerNumber of type string resultItem.InternalCustomerNumber = reader.GetString(6); //7:Parameter CMN_BPT_CTM_CustomerID of type Guid resultItem.CMN_BPT_CTM_CustomerID = reader.GetGuid(7); //8:Parameter CreatedByName of type string resultItem.CreatedByName = reader.GetString(8); //9:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(9); //10:Parameter ShipmentPosition_ValueWithoutTax of type decimal resultItem.ShipmentPosition_ValueWithoutTax = reader.GetDecimal(10); //11:Parameter CurrencySymbol of type string resultItem.CurrencySymbol = reader.GetString(11); //12:Parameter TaxRate of type double resultItem.TaxRate = reader.GetDouble(12); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Client_Orders_with_Details_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5SH_GCwDfT_1454_raw.Convert(results).ToArray(); return(returnStatus); }