protected static FR_L5DD_GBSIfRID_1431_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DD_GBSIfRID_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DD_GBSIfRID_1431_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_KPRS_DueDiligences.Atomic.Retrieval.SQL.cls_Get_BasementSubmisionInfo_For_RevisionID.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, "RevisionID", Parameter.RevisionID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BuildingPartID", Parameter.BuildingPartID); if (Parameter.BuildingPartID_IsSpecified == false) { var regex = new System.Text.RegularExpressions.Regex(@"((and|or)\s*)?(\w*\.)?\w*\s*(=|like|<|>)\s*@BuildingPartID", System.Text.RegularExpressions.RegexOptions.IgnoreCase); command.CommandText = regex.Replace(command.CommandText, ""); } List <L5DD_GBSIfRID_1431_raw> results = new List <L5DD_GBSIfRID_1431_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[] { "RES_STR_BasementID", "RES_BLD_Basement_RefID", "TypeOfFloor_RefID", "Basement_DocumentHeader_RefID", "AverageRating_RefID", "Basement_Comment", "RES_STR_Basement_PropertyAssessmentID", "RES_STR_Basement_PropertyID", "GlobalPropertyMatchingID", "DocumentHeader_RefID", "PropertyAssessment_Comment", "Rating_RefID", "RES_STR_Basement_RequiredActionID", "SelectedActionVersion_RefID", "EffectivePrice_RefID", "Action_PricePerUnit_RefID", "Action_Unit_RefID", "Action_UnitAmount", "IsCustom", "IfCustom_Name", "IfCustom_Description", "Action_Timeframe_RefID", "RequiredAction_Comment", "Action_Name_DictID", "PriceValue_Amount" }); while (reader.Read()) { L5DD_GBSIfRID_1431_raw resultItem = new L5DD_GBSIfRID_1431_raw(); //0:Parameter RES_STR_BasementID of type Guid resultItem.RES_STR_BasementID = reader.GetGuid(0); //1:Parameter RES_BLD_Basement_RefID of type Guid resultItem.RES_BLD_Basement_RefID = reader.GetGuid(1); //2:Parameter TypeOfFloor_RefID of type Guid resultItem.TypeOfFloor_RefID = reader.GetGuid(2); //3:Parameter Basement_DocumentHeader_RefID of type Guid resultItem.Basement_DocumentHeader_RefID = reader.GetGuid(3); //4:Parameter AverageRating_RefID of type Guid resultItem.AverageRating_RefID = reader.GetGuid(4); //5:Parameter Basement_Comment of type String resultItem.Basement_Comment = reader.GetString(5); //6:Parameter RES_STR_Basement_PropertyAssessmentID of type Guid resultItem.RES_STR_Basement_PropertyAssessmentID = reader.GetGuid(6); //7:Parameter RES_STR_Basement_PropertyID of type Guid resultItem.RES_STR_Basement_PropertyID = reader.GetGuid(7); //8:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(8); //9:Parameter DocumentHeader_RefID of type Guid resultItem.DocumentHeader_RefID = reader.GetGuid(9); //10:Parameter PropertyAssessment_Comment of type String resultItem.PropertyAssessment_Comment = reader.GetString(10); //11:Parameter Rating_RefID of type Guid resultItem.Rating_RefID = reader.GetGuid(11); //12:Parameter RES_STR_Basement_RequiredActionID of type Guid resultItem.RES_STR_Basement_RequiredActionID = reader.GetGuid(12); //13:Parameter SelectedActionVersion_RefID of type Guid resultItem.SelectedActionVersion_RefID = reader.GetGuid(13); //14:Parameter EffectivePrice_RefID of type Guid resultItem.EffectivePrice_RefID = reader.GetGuid(14); //15:Parameter Action_PricePerUnit_RefID of type Guid resultItem.Action_PricePerUnit_RefID = reader.GetGuid(15); //16:Parameter Action_Unit_RefID of type Guid resultItem.Action_Unit_RefID = reader.GetGuid(16); //17:Parameter Action_UnitAmount of type double resultItem.Action_UnitAmount = reader.GetDouble(17); //18:Parameter IsCustom of type bool resultItem.IsCustom = reader.GetBoolean(18); //19:Parameter IfCustom_Name of type String resultItem.IfCustom_Name = reader.GetString(19); //20:Parameter IfCustom_Description of type String resultItem.IfCustom_Description = reader.GetString(20); //21:Parameter Action_Timeframe_RefID of type Guid resultItem.Action_Timeframe_RefID = reader.GetGuid(21); //22:Parameter RequiredAction_Comment of type String resultItem.RequiredAction_Comment = reader.GetString(22); //23:Parameter Action_Name of type Dict resultItem.Action_Name = reader.GetDictionary(23); resultItem.Action_Name.SourceTable = "res_act_action_version"; loader.Append(resultItem.Action_Name); //24:Parameter PriceValue_Amount of type double resultItem.PriceValue_Amount = reader.GetDouble(24); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5DD_GBSIfRID_1431_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_L5DD_GBSIfRID_1431_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5DD_GBSIfRID_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DD_GBSIfRID_1431_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DD_GBSIfRID_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DD_GBSIfRID_1431_Array functionReturn = new FR_L5DD_GBSIfRID_1431_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 ex; } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5DD_GBSIfRID_1431_Array Invoke(string ConnectionString, P_L5DD_GBSIfRID_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }