protected static FR_L5PR_GRPfTID_1136_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5PR_GRPfTID_1136 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PR_GRPfTID_1136_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOProcurement_Proposals.Atomic.Retrieval.SQL.cls_Get_RequestProposals_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, "IsEvent_ProposalRequest_Sent", Parameter.IsEvent_ProposalRequest_Sent); List <L5PR_GRPfTID_1136_raw> results = new List <L5PR_GRPfTID_1136_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_RFO_RequestForProposal_HeaderID", "ORD_PRC_RFP_RequestForProposal_PositionID", "CMN_PRO_Product_RefID", "OfferReceivedFrom_RegisteredBusinessParticipant_RefID", "CreatedFor_RequestForProposal_Header_RefID", "DeliveryUntillDate", "Quantity", "CompleteDeliveryUntillDate", "ProposalDeadline", "ORD_PRC_RFP_PotentialSupplierID", "Deliverer", "ORD_PRC_RFP_PotentialSupplier_HistoryID", "IsEvent_ProposalRequest_Sent", "IsEvent_ProposalResponse_Received", "IsEvent_ProposalResponse_Accepted", "IsEvent_ProposalResponse_ReceptionAcknowledged", "IsEvent_ProposalResponse_Declined", "IsEvent_ProposalRequest_Revoked", "IsEvent_ProposalResponse_ModificationRequired", "Comment" }); while (reader.Read()) { L5PR_GRPfTID_1136_raw resultItem = new L5PR_GRPfTID_1136_raw(); //0:Parameter ORD_PRC_RFO_RequestForProposal_HeaderID of type Guid resultItem.ORD_PRC_RFO_RequestForProposal_HeaderID = reader.GetGuid(0); //1:Parameter ORD_PRC_RFP_RequestForProposal_PositionID of type Guid resultItem.ORD_PRC_RFP_RequestForProposal_PositionID = reader.GetGuid(1); //2:Parameter CMN_PRO_Product_RefID of type Guid resultItem.CMN_PRO_Product_RefID = reader.GetGuid(2); //3:Parameter OfferReceivedFrom_RegisteredBusinessParticipant_RefID of type Guid resultItem.OfferReceivedFrom_RegisteredBusinessParticipant_RefID = reader.GetGuid(3); //4:Parameter CreatedFor_RequestForProposal_Header_RefID of type Guid resultItem.CreatedFor_RequestForProposal_Header_RefID = reader.GetGuid(4); //5:Parameter DeliveryUntillDate of type DateTime resultItem.DeliveryUntillDate = reader.GetDate(5); //6:Parameter Quantity of type double resultItem.Quantity = reader.GetDouble(6); //7:Parameter CompleteDeliveryUntillDate of type DateTime resultItem.CompleteDeliveryUntillDate = reader.GetDate(7); //8:Parameter ProposalDeadline of type DateTime resultItem.ProposalDeadline = reader.GetDate(8); //9:Parameter ORD_PRC_RFP_PotentialSupplierID of type Guid resultItem.ORD_PRC_RFP_PotentialSupplierID = reader.GetGuid(9); //10:Parameter Deliverer of type String resultItem.Deliverer = reader.GetString(10); //11:Parameter ORD_PRC_RFP_PotentialSupplier_HistoryID of type Guid resultItem.ORD_PRC_RFP_PotentialSupplier_HistoryID = reader.GetGuid(11); //12:Parameter IsEvent_ProposalRequest_Sent of type bool resultItem.IsEvent_ProposalRequest_Sent = reader.GetBoolean(12); //13:Parameter IsEvent_ProposalResponse_Received of type bool resultItem.IsEvent_ProposalResponse_Received = reader.GetBoolean(13); //14:Parameter IsEvent_ProposalResponse_Accepted of type bool resultItem.IsEvent_ProposalResponse_Accepted = reader.GetBoolean(14); //15:Parameter IsEvent_ProposalResponse_ReceptionAcknowledged of type bool resultItem.IsEvent_ProposalResponse_ReceptionAcknowledged = reader.GetBoolean(15); //16:Parameter IsEvent_ProposalResponse_Declined of type bool resultItem.IsEvent_ProposalResponse_Declined = reader.GetBoolean(16); //17:Parameter IsEvent_ProposalRequest_Revoked of type bool resultItem.IsEvent_ProposalRequest_Revoked = reader.GetBoolean(17); //18:Parameter IsEvent_ProposalResponse_ModificationRequired of type bool resultItem.IsEvent_ProposalResponse_ModificationRequired = reader.GetBoolean(18); //19:Parameter Comment of type String resultItem.Comment = reader.GetString(19); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_RequestProposals_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5PR_GRPfTID_1136_raw.Convert(results).ToArray(); return(returnStatus); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L5PR_GRPfTID_1136_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5PR_GRPfTID_1136 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5PR_GRPfTID_1136_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5PR_GRPfTID_1136 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5PR_GRPfTID_1136_Array functionReturn = new FR_L5PR_GRPfTID_1136_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_RequestProposals_for_TenantID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5PR_GRPfTID_1136_Array Invoke(string ConnectionString, P_L5PR_GRPfTID_1136 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }