///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5PL_GPLVwVaPfPaP_2320_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5PL_GPLVwVaPfPaP_2320 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5PL_GPLVwVaPfPaP_2320_Array functionReturn = new FR_L5PL_GPLVwVaPfPaP_2320_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_PriceListVersions_with_Versions_and_Prices_for_ProductID_and_PriceListID", ex); } return(functionReturn); }
protected static FR_L5PL_GPLVwVaPfPaP_2320_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5PL_GPLVwVaPfPaP_2320 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PL_GPLVwVaPfPaP_2320_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_PriceLists.Atomic.Retrieval.SQL.cls_Get_PriceListVersions_with_Versions_and_Prices_for_ProductID_and_PriceListID.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, "ProductID", Parameter.ProductID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "PriceListID", Parameter.PriceListID); List <L5PL_GPLVwVaPfPaP_2320> results = new List <L5PL_GPLVwVaPfPaP_2320>(); 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[] { "CMN_SLS_Pricelist_ReleaseID", "Release_Version", "PricelistRelease_ValidFrom", "PricelistRelease_ValidTo", "IsPricelistAlwaysActive", "CMN_SLS_PriceID", "PriceAmount", "CMN_Currency_RefID" }); while (reader.Read()) { L5PL_GPLVwVaPfPaP_2320 resultItem = new L5PL_GPLVwVaPfPaP_2320(); //0:Parameter CMN_SLS_Pricelist_ReleaseID of type Guid resultItem.CMN_SLS_Pricelist_ReleaseID = reader.GetGuid(0); //1:Parameter Release_Version of type String resultItem.Release_Version = reader.GetString(1); //2:Parameter PricelistRelease_ValidFrom of type String resultItem.PricelistRelease_ValidFrom = reader.GetString(2); //3:Parameter PricelistRelease_ValidTo of type String resultItem.PricelistRelease_ValidTo = reader.GetString(3); //4:Parameter IsPricelistAlwaysActive of type bool resultItem.IsPricelistAlwaysActive = reader.GetBoolean(4); //5:Parameter CMN_SLS_PriceID of type Guid resultItem.CMN_SLS_PriceID = reader.GetGuid(5); //6:Parameter PriceAmount of type String resultItem.PriceAmount = reader.GetString(6); //7:Parameter CMN_Currency_RefID of type Guid resultItem.CMN_Currency_RefID = reader.GetGuid(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_PriceListVersions_with_Versions_and_Prices_for_ProductID_and_PriceListID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }