///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3CA_GPfPG_0958_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3CA_GPfPG_0958 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3CA_GPfPG_0958_Array functionReturn = new FR_L3CA_GPfPG_0958_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_Products_for_ProductGroup", ex); } return(functionReturn); }
protected static FR_L3CA_GPfPG_0958_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3CA_GPfPG_0958 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3CA_GPfPG_0958_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_Catalog.Atomic.Retrieval.SQL.cls_Get_Products_for_ProductGroup.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, "ProductGroupID", Parameter.ProductGroupID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CatalogRevisionID", Parameter.CatalogRevisionID); List <L3CA_GPfPG_0958> results = new List <L3CA_GPfPG_0958>(); 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_Catalog_ProductGroup_RefID", "IsDeleted", "Tenant_RefID", "IsDeleted1", "CMN_PRO_Catalog_ProductID", "CMN_PRO_Product_RefID", "Product_Name_DictID", "PackageContent_Amount", "Product_Number", "Label_DictID", "Abbreviation_DictID", "ISOCode", "DosageForm_Name_DictID", "DosageForm_Description_DictID", "GlobalPropertyMatchingID" }); while (reader.Read()) { L3CA_GPfPG_0958 resultItem = new L3CA_GPfPG_0958(); //0:Parameter CMN_PRO_Catalog_ProductGroup_RefID of type Guid resultItem.CMN_PRO_Catalog_ProductGroup_RefID = reader.GetGuid(0); //1:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(1); //2:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(2); //3:Parameter IsDeleted1 of type bool resultItem.IsDeleted1 = reader.GetBoolean(3); //4:Parameter CMN_PRO_Catalog_ProductID of type Guid resultItem.CMN_PRO_Catalog_ProductID = reader.GetGuid(4); //5:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(5); //6:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(6); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //7:Parameter PackageContent_Amount of type String resultItem.PackageContent_Amount = reader.GetString(7); //8:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(8); //9:Parameter Label_DictID of type Dict resultItem.Label_DictID = reader.GetDictionary(9); resultItem.Label_DictID.SourceTable = "cmn_units"; loader.Append(resultItem.Label_DictID); //10:Parameter Abbreviation_DictID of type Dict resultItem.Abbreviation_DictID = reader.GetDictionary(10); resultItem.Abbreviation_DictID.SourceTable = "cmn_units"; loader.Append(resultItem.Abbreviation_DictID); //11:Parameter ISOCode of type String resultItem.ISOCode = reader.GetString(11); //12:Parameter DosageForm_Name_DictID of type Dict resultItem.DosageForm_Name_DictID = reader.GetDictionary(12); resultItem.DosageForm_Name_DictID.SourceTable = "hec_product_dosageforms"; loader.Append(resultItem.DosageForm_Name_DictID); //13:Parameter DosageForm_Description_DictID of type Dict resultItem.DosageForm_Description_DictID = reader.GetDictionary(13); resultItem.DosageForm_Description_DictID.SourceTable = "hec_product_dosageforms"; loader.Append(resultItem.DosageForm_Description_DictID); //14:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(14); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Products_for_ProductGroup", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }