///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5SR_GSROfHA_1408_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5SR_GSROfHA_1408 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5SR_GSROfHA_1408_Array functionReturn = new FR_L5SR_GSROfHA_1408_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_StockReceiptsPositions_for_ReceiptHeaderID_Atomic", ex); } return(functionReturn); }
protected static FR_L5SR_GSROfHA_1408_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5SR_GSROfHA_1408 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5SR_GSROfHA_1408_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOLogistic_StockReceipt.Atomic.Retrieval.SQL.cls_Get_StockReceiptsPositions_for_ReceiptHeaderID_Atomic.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, "ReceiptHeaderID", Parameter.ReceiptHeaderID); List <L5SR_GSROfHA_1408_raw> results = new List <L5SR_GSROfHA_1408_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[] { "LOG_RCP_Receipt_PositionID", "ReceiptPosition_Product_RefID", "Target_WRH_Shelf_RefID", "Receipt_ExpectedPositionPrice", "Receipt_TotalQuantityTakenIntoStock", "ORD_PRC_ProcurementOrder_PositionID", "Procurement_OrderedQuantity", "Procurement_ValuePerUnit", "Procurement_ValueTotal", "IsQualityControlPerformed", "QualityControl_Quantity", "PriceOnSupplierBill", "TotalQuantityFreeOfCharge", "BatchNumber", "ExpiryDate", "ShelfContent_RefID", "LOG_ProductTrackingInstance_RefID", "LOG_RCP_Receipt_Position_DiscountAmountID", "ORD_PRC_DiscountType_RefID", "PositionDiscountValue", "GlobalPropertyMatchingID", "DisplayName" }); while (reader.Read()) { L5SR_GSROfHA_1408_raw resultItem = new L5SR_GSROfHA_1408_raw(); //0:Parameter LOG_RCP_Receipt_PositionID of type Guid resultItem.LOG_RCP_Receipt_PositionID = reader.GetGuid(0); //1:Parameter ReceiptPosition_Product_RefID of type Guid resultItem.ReceiptPosition_Product_RefID = reader.GetGuid(1); //2:Parameter Target_WRH_Shelf_RefID of type Guid resultItem.Target_WRH_Shelf_RefID = reader.GetGuid(2); //3:Parameter Receipt_ExpectedPositionPrice of type Decimal resultItem.Receipt_ExpectedPositionPrice = reader.GetDecimal(3); //4:Parameter Receipt_TotalQuantityTakenIntoStock of type Double resultItem.Receipt_TotalQuantityTakenIntoStock = reader.GetDouble(4); //5:Parameter ORD_PRC_ProcurementOrder_PositionID of type Guid resultItem.ORD_PRC_ProcurementOrder_PositionID = reader.GetGuid(5); //6:Parameter Procurement_OrderedQuantity of type Double resultItem.Procurement_OrderedQuantity = reader.GetDouble(6); //7:Parameter Procurement_ValuePerUnit of type Decimal resultItem.Procurement_ValuePerUnit = reader.GetDecimal(7); //8:Parameter Procurement_ValueTotal of type Decimal resultItem.Procurement_ValueTotal = reader.GetDecimal(8); //9:Parameter IsQualityControlPerformed of type Boolean resultItem.IsQualityControlPerformed = reader.GetBoolean(9); //10:Parameter QualityControl_Quantity of type Double resultItem.QualityControl_Quantity = reader.GetDouble(10); //11:Parameter PriceOnSupplierBill of type Decimal resultItem.PriceOnSupplierBill = reader.GetDecimal(11); //12:Parameter TotalQuantityFreeOfCharge of type Double resultItem.TotalQuantityFreeOfCharge = reader.GetDouble(12); //13:Parameter BatchNumber of type String resultItem.BatchNumber = reader.GetString(13); //14:Parameter ExpiryDate of type DateTime resultItem.ExpiryDate = reader.GetDate(14); //15:Parameter ShelfContent_RefID of type Guid resultItem.ShelfContent_RefID = reader.GetGuid(15); //16:Parameter LOG_ProductTrackingInstance_RefID of type Guid resultItem.LOG_ProductTrackingInstance_RefID = reader.GetGuid(16); //17:Parameter LOG_RCP_Receipt_Position_DiscountAmountID of type Guid resultItem.LOG_RCP_Receipt_Position_DiscountAmountID = reader.GetGuid(17); //18:Parameter ORD_PRC_DiscountType_RefID of type Guid resultItem.ORD_PRC_DiscountType_RefID = reader.GetGuid(18); //19:Parameter PositionDiscountValue of type Double resultItem.PositionDiscountValue = reader.GetDouble(19); //20:Parameter GlobalPropertyMatchingID of type string resultItem.GlobalPropertyMatchingID = reader.GetString(20); //21:Parameter DisplayName of type string resultItem.DisplayName = reader.GetString(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_StockReceiptsPositions_for_ReceiptHeaderID_Atomic", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5SR_GSROfHA_1408_raw.Convert(results).ToArray(); return(returnStatus); }