///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5LR_GLREFLREID_1107 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5LR_GLREFLREID_1107 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5LR_GLREFLREID_1107 functionReturn = new FR_L5LR_GLREFLREID_1107(); 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_LandRegistrationEntry_For_LandRegistrationEntryID", ex); } return(functionReturn); }
protected static FR_L5LR_GLREFLREID_1107 Execute(DbConnection Connection, DbTransaction Transaction, P_L5LR_GLREFLREID_1107 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5LR_GLREFLREID_1107(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_KPRS_LandRegistrationEntries.Atomic.Retrieval.SQL.cls_Get_LandRegistrationEntry_For_LandRegistrationEntryID.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, "LandRegistrationEntryID", Parameter.LandRegistrationEntryID); List <L5LR_GLREFLREID_1107> results = new List <L5LR_GLREFLREID_1107>(); 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_RealestateProperty_LandRegistrationEntryID", "LandRegistrationEntry_LandTitleRegister", "LandRegistrationEntry_Marking", "LandRegistrationEntry_LandLot", "LandRegistrationEntry_Parcel_FromNumber", "LandRegistrationEntry_Parcel_ToNumber", "LandRegistrationEntry_Sheet", "LandRegistrationEntry_GroundAreaSize_in_sqm", "RealestateProperty_RefID", "Tenant_RefID", "IsDeleted" }); while (reader.Read()) { L5LR_GLREFLREID_1107 resultItem = new L5LR_GLREFLREID_1107(); //0:Parameter RES_RealestateProperty_LandRegistrationEntryID of type Guid resultItem.RES_RealestateProperty_LandRegistrationEntryID = reader.GetGuid(0); //1:Parameter LandRegistrationEntry_LandTitleRegister of type String resultItem.LandRegistrationEntry_LandTitleRegister = reader.GetString(1); //2:Parameter LandRegistrationEntry_Marking of type String resultItem.LandRegistrationEntry_Marking = reader.GetString(2); //3:Parameter LandRegistrationEntry_LandLot of type int resultItem.LandRegistrationEntry_LandLot = reader.GetInteger(3); //4:Parameter LandRegistrationEntry_Parcel_FromNumber of type int resultItem.LandRegistrationEntry_Parcel_FromNumber = reader.GetInteger(4); //5:Parameter LandRegistrationEntry_Parcel_ToNumber of type int resultItem.LandRegistrationEntry_Parcel_ToNumber = reader.GetInteger(5); //6:Parameter LandRegistrationEntry_Sheet of type int resultItem.LandRegistrationEntry_Sheet = reader.GetInteger(6); //7:Parameter LandRegistrationEntry_GroundAreaSize_in_sqm of type double resultItem.LandRegistrationEntry_GroundAreaSize_in_sqm = reader.GetDouble(7); //8:Parameter RealestateProperty_RefID of type Guid resultItem.RealestateProperty_RefID = reader.GetGuid(8); //9:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(9); //10:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(10); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_LandRegistrationEntry_For_LandRegistrationEntryID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.FirstOrDefault(); return(returnStatus); }