///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5ALSR_GSRfT_1016_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5ALSR_GSRfT_1016 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5ALSR_GSRfT_1016_Array functionReturn = new FR_L5ALSR_GSRfT_1016_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_StockReceipts_for_TenantID", ex); } return(functionReturn); }
protected static FR_L5ALSR_GSRfT_1016_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5ALSR_GSRfT_1016 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5ALSR_GSRfT_1016_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOLogistic_StockReceipt.Atomic.Retrieval.SQL.cls_Get_StockReceipts_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; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "SupplierName", Parameter.SupplierName); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ReceiptNumber", Parameter.ReceiptNumber); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProcurementOrderNumber", Parameter.ProcurementOrderNumber); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DateFrom", Parameter.DateFrom); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DateTo", Parameter.DateTo); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsTakenIntoStock", Parameter.IsTakenIntoStock); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsQualityControlPerformed", Parameter.IsQualityControlPerformed); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsPriceConditionsManuallyCleared", Parameter.IsPriceConditionsManuallyCleared); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsReceiptForwardedToBookkeeping", Parameter.IsReceiptForwardedToBookkeeping); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "SupplierTypeID", Parameter.SupplierTypeID); List <L5ALSR_GSRfT_1016_raw> results = new List <L5ALSR_GSRfT_1016_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[] { "ORD_PRC_ExpectedDelivery_HeaderID", "ExpectedDeliveryDate", "ExpectedDeliveryNumber", "ExpDeliveryHeader_DateOfCreation", "LOG_RCP_Receipt_HeaderID", "ReceiptNumber", "IsTakenIntoStock", "IsQualityControlPerformed", "IsPriceConditionsManuallyCleared", "IsReceiptForwardedToBookkeeping", "ProcurementOrder_Number", "CMN_BPT_SupplierID", "CMN_BPT_BusinessParticipantID", "DisplayName", "CMN_BPT_Supplier_TypeID", "SupplierType", "CurrencySymbol", "ORD_PRC_ExpectedDelivery_PositionID", "TotalExpectedQuantity", "Position_ValuePerUnit" }); while (reader.Read()) { L5ALSR_GSRfT_1016_raw resultItem = new L5ALSR_GSRfT_1016_raw(); //0:Parameter ORD_PRC_ExpectedDelivery_HeaderID of type Guid resultItem.ORD_PRC_ExpectedDelivery_HeaderID = reader.GetGuid(0); //1:Parameter ExpectedDeliveryDate of type DateTime resultItem.ExpectedDeliveryDate = reader.GetDate(1); //2:Parameter ExpectedDeliveryNumber of type String resultItem.ExpectedDeliveryNumber = reader.GetString(2); //3:Parameter ExpDeliveryHeader_DateOfCreation of type DateTime resultItem.ExpDeliveryHeader_DateOfCreation = reader.GetDate(3); //4:Parameter LOG_RCP_Receipt_HeaderID of type Guid resultItem.LOG_RCP_Receipt_HeaderID = reader.GetGuid(4); //5:Parameter ReceiptNumber of type String resultItem.ReceiptNumber = reader.GetString(5); //6:Parameter IsTakenIntoStock of type bool resultItem.IsTakenIntoStock = reader.GetBoolean(6); //7:Parameter IsQualityControlPerformed of type bool resultItem.IsQualityControlPerformed = reader.GetBoolean(7); //8:Parameter IsPriceConditionsManuallyCleared of type bool resultItem.IsPriceConditionsManuallyCleared = reader.GetBoolean(8); //9:Parameter IsReceiptForwardedToBookkeeping of type bool resultItem.IsReceiptForwardedToBookkeeping = reader.GetBoolean(9); //10:Parameter ProcurementOrder_Number of type String resultItem.ProcurementOrder_Number = reader.GetString(10); //11:Parameter CMN_BPT_SupplierID of type Guid resultItem.CMN_BPT_SupplierID = reader.GetGuid(11); //12:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(12); //13:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(13); //14:Parameter CMN_BPT_Supplier_TypeID of type Guid resultItem.CMN_BPT_Supplier_TypeID = reader.GetGuid(14); //15:Parameter SupplierType of type string resultItem.SupplierType = reader.GetString(15); //16:Parameter CurrencySymbol of type string resultItem.CurrencySymbol = reader.GetString(16); //17:Parameter ORD_PRC_ExpectedDelivery_PositionID of type Guid resultItem.ORD_PRC_ExpectedDelivery_PositionID = reader.GetGuid(17); //18:Parameter TotalExpectedQuantity of type double resultItem.TotalExpectedQuantity = reader.GetDouble(18); //19:Parameter Position_ValuePerUnit of type decimal resultItem.Position_ValuePerUnit = reader.GetDecimal(19); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_StockReceipts_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5ALSR_GSRfT_1016_raw.Convert(results).ToArray(); return(returnStatus); }