///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L2PR_GPRwRSaLfT_1358_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L2PR_GPRwRSaLfT_1358_Array functionReturn = new FR_L2PR_GPRwRSaLfT_1358_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, 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_PriceRounding_with_RuleSet_and_Levels_for_TenantID", ex); } return(functionReturn); }
protected static FR_L2PR_GPRwRSaLfT_1358_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L2PR_GPRwRSaLfT_1358_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL2_PriceRounding.Atomic.Retrieval.SQL.cls_Get_PriceRounding_with_RuleSet_and_Levels_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; List <L2PR_GPRwRSaLfT_1358_raw> results = new List <L2PR_GPRwRSaLfT_1358_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_SLS_Price_RoundingRuleSetID", "RuleSet_Name_DictID", "MaximumPriceIncreaseInPercent", "MaximumPriceDecreaseInPercent", "CMN_SLS_Price_RoundingID", "Amount_From", "Amount_To", "IsAmountTo_Specified", "IsRoundingDeleted", "CMN_SLS_Price_RoundingLevelID", "RoundingAmount", "IsDeleted" }); while (reader.Read()) { L2PR_GPRwRSaLfT_1358_raw resultItem = new L2PR_GPRwRSaLfT_1358_raw(); //0:Parameter CMN_SLS_Price_RoundingRuleSetID of type Guid resultItem.CMN_SLS_Price_RoundingRuleSetID = reader.GetGuid(0); //1:Parameter RuleSet_Name of type Dict resultItem.RuleSet_Name = reader.GetDictionary(1); resultItem.RuleSet_Name.SourceTable = "cmn_sls_price_roundingruleset"; loader.Append(resultItem.RuleSet_Name); //2:Parameter MaximumPriceIncreaseInPercent of type decimal resultItem.MaximumPriceIncreaseInPercent = reader.GetDecimal(2); //3:Parameter MaximumPriceDecreaseInPercent of type decimal resultItem.MaximumPriceDecreaseInPercent = reader.GetDecimal(3); //4:Parameter CMN_SLS_Price_RoundingID of type Guid resultItem.CMN_SLS_Price_RoundingID = reader.GetGuid(4); //5:Parameter Amount_From of type decimal resultItem.Amount_From = reader.GetDecimal(5); //6:Parameter Amount_To of type decimal resultItem.Amount_To = reader.GetDecimal(6); //7:Parameter IsAmountTo_Specified of type bool resultItem.IsAmountTo_Specified = reader.GetBoolean(7); //8:Parameter IsRoundingDeleted of type bool resultItem.IsRoundingDeleted = reader.GetBoolean(8); //9:Parameter CMN_SLS_Price_RoundingLevelID of type Guid resultItem.CMN_SLS_Price_RoundingLevelID = reader.GetGuid(9); //10:Parameter RoundingAmount of type double resultItem.RoundingAmount = reader.GetDouble(10); //11:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_PriceRounding_with_RuleSet_and_Levels_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L2PR_GPRwRSaLfT_1358_raw.Convert(results).ToArray(); return(returnStatus); }