///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5RE_GREFT_1534_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5RE_GREFT_1534_Array functionReturn = new FR_L5RE_GREFT_1534_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, 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_Realestates_For_Tenant", ex); } return(functionReturn); }
protected static FR_L5RE_GREFT_1534_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5RE_GREFT_1534_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_KPRS_Realestate.Atomic.Retrieval.SQL.cls_Get_Realestates_For_Tenant.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; List <L5RE_GREFT_1534_raw> results = new List <L5RE_GREFT_1534_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", "IsLocked", "IsArchived", "Creation_Timestamp" }); while (reader.Read()) { L5RE_GREFT_1534_raw resultItem = new L5RE_GREFT_1534_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 IsLocked of type bool resultItem.IsLocked = reader.GetBoolean(19); //20:Parameter IsArchived of type bool resultItem.IsArchived = reader.GetBoolean(20); //21:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Realestates_For_Tenant", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5RE_GREFT_1534_raw.Convert(results).ToArray(); return(returnStatus); }