protected static FR_L2_AP_GAPDfT_1605_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L2_AP_GAPDfT_1605_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL2_AccountingPayment.Atomic.Retrieval.SQL.cls_Get_AllPaymentDeadlines_For_TenandID.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 <L2_AP_GAPDfT_1605_raw> results = new List <L2_AP_GAPDfT_1605_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[] { "PaymentCondition_Name_DictID", "ACC_PAY_ConditionID", "MaximumPaymentTreshold_InDays", "ACC_PAY_Condition_DetailID", "SequenceNumber", "DiscountPercentage", "DateInterval_To", "DateInterval_From" }); while (reader.Read()) { L2_AP_GAPDfT_1605_raw resultItem = new L2_AP_GAPDfT_1605_raw(); //0:Parameter PaymentCondition_Name of type Dict resultItem.PaymentCondition_Name = reader.GetDictionary(0); resultItem.PaymentCondition_Name.SourceTable = "acc_pay_conditions"; loader.Append(resultItem.PaymentCondition_Name); //1:Parameter ACC_PAY_ConditionID of type Guid resultItem.ACC_PAY_ConditionID = reader.GetGuid(1); //2:Parameter MaximumPaymentTreshold_InDays of type int resultItem.MaximumPaymentTreshold_InDays = reader.GetInteger(2); //3:Parameter ACC_PAY_Condition_DetailID of type Guid resultItem.ACC_PAY_Condition_DetailID = reader.GetGuid(3); //4:Parameter SequenceNumber of type int resultItem.SequenceNumber = reader.GetInteger(4); //5:Parameter DiscountPercentage of type double resultItem.DiscountPercentage = reader.GetDouble(5); //6:Parameter DateInterval_To of type int resultItem.DateInterval_To = reader.GetInteger(6); //7:Parameter DateInterval_From of type int resultItem.DateInterval_From = reader.GetInteger(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AllPaymentDeadlines_For_TenandID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L2_AP_GAPDfT_1605_raw.Convert(results).ToArray(); return(returnStatus); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L2_AP_GAPDfT_1605_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L2_AP_GAPDfT_1605_Array functionReturn = new FR_L2_AP_GAPDfT_1605_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_AllPaymentDeadlines_For_TenandID", ex); } return(functionReturn); }