protected static FR_L2DM_GADWVfP_1431_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L2DM_GADWVfP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L2DM_GADWVfP_1431_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_Dimension.Atomic.Retrieval.SQL.cls_Get_All_Dimensions_With_Values_for_Product.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); List <L2DM_GADWVfP_1431_raw> results = new List <L2DM_GADWVfP_1431_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[] { "CMN_PRO_DimensionID", "Product_RefID", "Abbreviation", "DimensionName_DictID", "Dimension_Ordersequence", "IsDimensionTemplate", "Dimension_Creation_Timestamp", "Dimension_Modification_Timestamp", "CMN_PRO_Dimension_ValueID", "Dimensions_RefID", "DimensionValue_Text_DictID", "DimensionValue_Ordersequence", "DimensionValue_Creation_Timestamp", "DimensionValue_Modification_Timestamp" }); while (reader.Read()) { L2DM_GADWVfP_1431_raw resultItem = new L2DM_GADWVfP_1431_raw(); //0:Parameter CMN_PRO_DimensionID of type Guid resultItem.CMN_PRO_DimensionID = reader.GetGuid(0); //1:Parameter Product_RefID of type Guid resultItem.Product_RefID = reader.GetGuid(1); //2:Parameter Abbreviation of type string resultItem.Abbreviation = reader.GetString(2); //3:Parameter DimensionName of type Dict resultItem.DimensionName = reader.GetDictionary(3); resultItem.DimensionName.SourceTable = "cmn_pro_dimensions"; loader.Append(resultItem.DimensionName); //4:Parameter Dimension_Ordersequence of type int resultItem.Dimension_Ordersequence = reader.GetInteger(4); //5:Parameter IsDimensionTemplate of type bool resultItem.IsDimensionTemplate = reader.GetBoolean(5); //6:Parameter Dimension_Creation_Timestamp of type DateTime resultItem.Dimension_Creation_Timestamp = reader.GetDate(6); //7:Parameter Dimension_Modification_Timestamp of type DateTime resultItem.Dimension_Modification_Timestamp = reader.GetDate(7); //8:Parameter CMN_PRO_Dimension_ValueID of type Guid resultItem.CMN_PRO_Dimension_ValueID = reader.GetGuid(8); //9:Parameter Dimensions_RefID of type Guid resultItem.Dimensions_RefID = reader.GetGuid(9); //10:Parameter DimensionValue_Text of type Dict resultItem.DimensionValue_Text = reader.GetDictionary(10); resultItem.DimensionValue_Text.SourceTable = "cmn_pro_dimension_values"; loader.Append(resultItem.DimensionValue_Text); //11:Parameter DimensionValue_Ordersequence of type int resultItem.DimensionValue_Ordersequence = reader.GetInteger(11); //12:Parameter DimensionValue_Creation_Timestamp of type DateTime resultItem.DimensionValue_Creation_Timestamp = reader.GetDate(12); //13:Parameter DimensionValue_Modification_Timestamp of type DateTime resultItem.DimensionValue_Modification_Timestamp = reader.GetDate(13); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_All_Dimensions_With_Values_for_Product", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L2DM_GADWVfP_1431_raw.Convert(results).ToArray(); return(returnStatus); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L2DM_GADWVfP_1431_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L2DM_GADWVfP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L2DM_GADWVfP_1431_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L2DM_GADWVfP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L2DM_GADWVfP_1431_Array functionReturn = new FR_L2DM_GADWVfP_1431_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_All_Dimensions_With_Values_for_Product", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L2DM_GADWVfP_1431_Array Invoke(string ConnectionString, P_L2DM_GADWVfP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }