protected static FR_L5RE_GRPFRP_0846 Execute(DbConnection Connection, DbTransaction Transaction, P_L5RE_GRPFRP_0846 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5RE_GRPFRP_0846(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_KPRS_Realestate.Atomic.Retrieval.SQL.cls_Get_RealestateProperties_For_RealestatePropertiesID.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, "RealestatePropertyID", Parameter.RealestatePropertyID); List <L5RE_GRPFRP_0846_raw> results = new List <L5RE_GRPFRP_0846_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_RealestatePropertyID", "InformationSubmittedBy_Account_RefID", "RealestateProperty_Address_RefID", "RealestateProperty_Location_RefID", "RealestateProperty_GroundValuePrice_RefID", "RealestateProperty_AverageAreaRentPrice_RefID", "Geolocation_Lattitude", "Geolocation_Longitude", "RealestateProperty_Title", "RealestateProperty_InternalID", "RealestateProperty_ConstructionDate", "RealestateProperty_RefurbishmentDate", "RealestateProperty_LivingSpace_in_sqm", "RealestateProperty_InformationDate", "RealestateProperty_NumberOfResidentialUnits", "CMN_PER_PersonInfoID", "FirstName", "LastName", "Username", "RealestateProperty_GroundAreaSize_in_sqm", "ConstructionTypeAssigmentID", "ConstructionType_Name_DictID", "ConstructionType_Description_DictID", "ConstructionTypeComment", "RES_RealestateProperty_ConstructionTypeID", "RES_RealestateProperty_TypeID", "PropertyTypeAssigment", "RealestatePropertyType_Name_DictID", "RealestatePropertyType_Description_DictID", "PropertyTypeComment", "SourceOfInformationComment", "SourceOfInformation_Description_DictID", "SourceOfInformation_Name_DictID", "SourceOfInformationAssigmentID", "RES_RealestateProperty_SourceOfInformationID" }); while (reader.Read()) { L5RE_GRPFRP_0846_raw resultItem = new L5RE_GRPFRP_0846_raw(); //0:Parameter RES_RealestatePropertyID of type Guid resultItem.RES_RealestatePropertyID = reader.GetGuid(0); //1:Parameter InformationSubmittedBy_Account_RefID of type Guid resultItem.InformationSubmittedBy_Account_RefID = reader.GetGuid(1); //2:Parameter RealestateProperty_Address_RefID of type Guid resultItem.RealestateProperty_Address_RefID = reader.GetGuid(2); //3:Parameter RealestateProperty_Location_RefID of type Guid resultItem.RealestateProperty_Location_RefID = reader.GetGuid(3); //4:Parameter RealestateProperty_GroundValuePrice_RefID of type Guid resultItem.RealestateProperty_GroundValuePrice_RefID = reader.GetGuid(4); //5:Parameter RealestateProperty_AverageAreaRentPrice_RefID of type Guid resultItem.RealestateProperty_AverageAreaRentPrice_RefID = reader.GetGuid(5); //6:Parameter Geolocation_Lattitude of type String resultItem.Geolocation_Lattitude = reader.GetString(6); //7:Parameter Geolocation_Longitude of type String resultItem.Geolocation_Longitude = reader.GetString(7); //8:Parameter RealestateProperty_Title of type String resultItem.RealestateProperty_Title = reader.GetString(8); //9:Parameter RealestateProperty_InternalID of type String resultItem.RealestateProperty_InternalID = reader.GetString(9); //10:Parameter RealestateProperty_ConstructionDate of type DateTime resultItem.RealestateProperty_ConstructionDate = reader.GetDate(10); //11:Parameter RealestateProperty_RefurbishmentDate of type DateTime resultItem.RealestateProperty_RefurbishmentDate = reader.GetDate(11); //12:Parameter RealestateProperty_LivingSpace_in_sqm of type String resultItem.RealestateProperty_LivingSpace_in_sqm = reader.GetString(12); //13:Parameter RealestateProperty_InformationDate of type DateTime resultItem.RealestateProperty_InformationDate = reader.GetDate(13); //14:Parameter RealestateProperty_NumberOfResidentialUnits of type String resultItem.RealestateProperty_NumberOfResidentialUnits = reader.GetString(14); //15:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(15); //16:Parameter FirstName of type String resultItem.FirstName = reader.GetString(16); //17:Parameter LastName of type String resultItem.LastName = reader.GetString(17); //18:Parameter Username of type String resultItem.Username = reader.GetString(18); //19:Parameter RealestateProperty_GroundAreaSize_in_sqm of type double resultItem.RealestateProperty_GroundAreaSize_in_sqm = reader.GetDouble(19); //20:Parameter ConstructionTypeAssigmentID of type Guid resultItem.ConstructionTypeAssigmentID = reader.GetGuid(20); //21:Parameter ConstructionType_Name of type Dict resultItem.ConstructionType_Name = reader.GetDictionary(21); resultItem.ConstructionType_Name.SourceTable = "res_realestateproperty_constructiontypes"; loader.Append(resultItem.ConstructionType_Name); //22:Parameter ConstructionType_Description of type Dict resultItem.ConstructionType_Description = reader.GetDictionary(22); resultItem.ConstructionType_Description.SourceTable = "res_realestateproperty_constructiontypes"; loader.Append(resultItem.ConstructionType_Description); //23:Parameter ConstructionTypeComment of type String resultItem.ConstructionTypeComment = reader.GetString(23); //24:Parameter RES_RealestateProperty_ConstructionTypeID of type Guid resultItem.RES_RealestateProperty_ConstructionTypeID = reader.GetGuid(24); //25:Parameter RES_RealestateProperty_TypeID of type Guid resultItem.RES_RealestateProperty_TypeID = reader.GetGuid(25); //26:Parameter PropertyTypeAssigment of type String resultItem.PropertyTypeAssigment = reader.GetString(26); //27:Parameter RealestatePropertyType_Name of type Dict resultItem.RealestatePropertyType_Name = reader.GetDictionary(27); resultItem.RealestatePropertyType_Name.SourceTable = "res_realestateproperty_types"; loader.Append(resultItem.RealestatePropertyType_Name); //28:Parameter RealestatePropertyType_Description of type Dict resultItem.RealestatePropertyType_Description = reader.GetDictionary(28); resultItem.RealestatePropertyType_Description.SourceTable = "res_realestateproperty_types"; loader.Append(resultItem.RealestatePropertyType_Description); //29:Parameter PropertyTypeComment of type String resultItem.PropertyTypeComment = reader.GetString(29); //30:Parameter SourceOfInformationComment of type String resultItem.SourceOfInformationComment = reader.GetString(30); //31:Parameter SourceOfInformation_Description of type Dict resultItem.SourceOfInformation_Description = reader.GetDictionary(31); resultItem.SourceOfInformation_Description.SourceTable = "res_realestateproperty_sourceofinformation"; loader.Append(resultItem.SourceOfInformation_Description); //32:Parameter SourceOfInformation_Name of type Dict resultItem.SourceOfInformation_Name = reader.GetDictionary(32); resultItem.SourceOfInformation_Name.SourceTable = "res_realestateproperty_sourceofinformation"; loader.Append(resultItem.SourceOfInformation_Name); //33:Parameter SourceOfInformationAssigmentID of type Guid resultItem.SourceOfInformationAssigmentID = reader.GetGuid(33); //34:Parameter RES_RealestateProperty_SourceOfInformationID of type Guid resultItem.RES_RealestateProperty_SourceOfInformationID = reader.GetGuid(34); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_RealestateProperties_For_RealestatePropertiesID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5RE_GRPFRP_0846_raw.Convert(results).FirstOrDefault(); 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_L5RE_GRPFRP_0846 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5RE_GRPFRP_0846 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5RE_GRPFRP_0846 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5RE_GRPFRP_0846 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5RE_GRPFRP_0846 functionReturn = new FR_L5RE_GRPFRP_0846(); 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_RealestateProperties_For_RealestatePropertiesID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5RE_GRPFRP_0846 Invoke(string ConnectionString, P_L5RE_GRPFRP_0846 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }