protected static FR_L5AWSSC_GHLfO_1407_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AWSSC_GHLfO_1407 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AWSSC_GHLfO_1407_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOWebShop_ShoppingCart.Atomic.Retrieval.SQL.cls_Get_HitList_for_OfficeID.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; command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@ProductGroupMatchingID_List", " IN $$ProductGroupMatchingID_List$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$ProductGroupMatchingID_List$", Parameter.ProductGroupMatchingID_List); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "OfficeID", Parameter.OfficeID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "NumberOfLastDays", Parameter.NumberOfLastDays); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "LanguageID", Parameter.LanguageID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProductNameStartWith", Parameter.ProductNameStartWith); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProductNameContains", Parameter.ProductNameContains); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProductNumberContains", Parameter.ProductNumberContains); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ActiveComponentContains", Parameter.ActiveComponentContains); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ActiveComponentStartWith", Parameter.ActiveComponentStartWith); List <L5AWSSC_GHLfO_1407_raw> results = new List <L5AWSSC_GHLfO_1407_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_ProductID", "ProductName", "Product_Number", "ProductDistributionStatus", "Group_GlobalPropertyMatchingID", "HEC_Product_DosageFormID", "DosageForm_GlobalPropertyMatchingID", "UnitIsoCode", "UnitAmount", "UnitAmount_DisplayLabel", "IsProductAvailableForOrdering", "Price", "CurrencyISO", "CurrencySymbol", "Quantity", "HEC_PRO_ComponentID", "Component_Name_DictID", "Component_SimpleName", "IsActiveComponent", "HEC_SUB_SubstanceID", "SubstanceName" }); while (reader.Read()) { L5AWSSC_GHLfO_1407_raw resultItem = new L5AWSSC_GHLfO_1407_raw(); //0:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(0); //1:Parameter ProductName of type string resultItem.ProductName = reader.GetString(1); //2:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(2); //3:Parameter ProductDistributionStatus of type int resultItem.ProductDistributionStatus = reader.GetInteger(3); //4:Parameter Group_GlobalPropertyMatchingID of type String resultItem.Group_GlobalPropertyMatchingID = reader.GetString(4); //5:Parameter HEC_Product_DosageFormID of type Guid resultItem.HEC_Product_DosageFormID = reader.GetGuid(5); //6:Parameter DosageForm_GlobalPropertyMatchingID of type string resultItem.DosageForm_GlobalPropertyMatchingID = reader.GetString(6); //7:Parameter UnitIsoCode of type string resultItem.UnitIsoCode = reader.GetString(7); //8:Parameter UnitAmount of type double resultItem.UnitAmount = reader.GetDouble(8); //9:Parameter UnitAmount_DisplayLabel of type String resultItem.UnitAmount_DisplayLabel = reader.GetString(9); //10:Parameter IsProductAvailableForOrdering of type bool resultItem.IsProductAvailableForOrdering = reader.GetBoolean(10); //11:Parameter Price of type decimal resultItem.Price = reader.GetDecimal(11); //12:Parameter CurrencyISO of type string resultItem.CurrencyISO = reader.GetString(12); //13:Parameter CurrencySymbol of type string resultItem.CurrencySymbol = reader.GetString(13); //14:Parameter Quantity of type double resultItem.Quantity = reader.GetDouble(14); //15:Parameter HEC_PRO_ComponentID of type Guid resultItem.HEC_PRO_ComponentID = reader.GetGuid(15); //16:Parameter Component_Name of type Dict resultItem.Component_Name = reader.GetDictionary(16); resultItem.Component_Name.SourceTable = "hec_pro_components"; loader.Append(resultItem.Component_Name); //17:Parameter Component_SimpleName of type String resultItem.Component_SimpleName = reader.GetString(17); //18:Parameter IsActiveComponent of type bool resultItem.IsActiveComponent = reader.GetBoolean(18); //19:Parameter HEC_SUB_SubstanceID of type Guid resultItem.HEC_SUB_SubstanceID = reader.GetGuid(19); //20:Parameter SubstanceName of type String resultItem.SubstanceName = reader.GetString(20); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_HitList_for_OfficeID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AWSSC_GHLfO_1407_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_L5AWSSC_GHLfO_1407_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5AWSSC_GHLfO_1407 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AWSSC_GHLfO_1407_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AWSSC_GHLfO_1407 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AWSSC_GHLfO_1407_Array functionReturn = new FR_L5AWSSC_GHLfO_1407_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_HitList_for_OfficeID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5AWSSC_GHLfO_1407_Array Invoke(string ConnectionString, P_L5AWSSC_GHLfO_1407 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }