protected static FR_CL3_GSPfSH_1047_Array Execute(DbConnection Connection, DbTransaction Transaction, P_CL3_GSPfSH_1047 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_CL3_GSPfSH_1047_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_ShipmentPositions_for_ShipmentHeaderID.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, "ShipmentHeaderID", Parameter.ShipmentHeaderID); List <CL3_GSPfSH_1047> results = new List <CL3_GSPfSH_1047>(); 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_SHP_Shipment_PositionID", "QuantityToShip", "ShipmentPosition_ValueWithoutTax", "CMN_PRO_Product_RefID", "CurrencySymbol", "Warehouse_Name", "QuantityInStock", "PrescriptionsCount" }); while (reader.Read()) { CL3_GSPfSH_1047 resultItem = new CL3_GSPfSH_1047(); //0:Parameter LOG_SHP_Shipment_PositionID of type Guid resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(0); //1:Parameter QuantityToShip of type decimal resultItem.QuantityToShip = reader.GetDecimal(1); //2:Parameter ShipmentPosition_ValueWithoutTax of type decimal resultItem.ShipmentPosition_ValueWithoutTax = reader.GetDecimal(2); //3:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(3); //4:Parameter CurrencySymbol of type string resultItem.CurrencySymbol = reader.GetString(4); //5:Parameter Warehouse_Name of type string resultItem.Warehouse_Name = reader.GetString(5); //6:Parameter QuantityInStock of type decimal resultItem.QuantityInStock = reader.GetDecimal(6); //7:Parameter PrescriptionsCount of type decimal resultItem.PrescriptionsCount = reader.GetDecimal(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_ShipmentPositions_for_ShipmentHeaderID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_CL3_GSPfSH_1047_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_CL3_GSPfSH_1047 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_CL3_GSPfSH_1047_Array functionReturn = new FR_CL3_GSPfSH_1047_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_ShipmentPositions_for_ShipmentHeaderID", ex); } return(functionReturn); }