コード例 #1
0
        protected static FR_L5BD_GBFRG_1005_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5BD_GBFRG_1005 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5BD_GBFRG_1005_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_KPRS_Buildings.Atomic.Retrieval.SQL.cls_Get_Buildings_For_RevisionGroupID.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, "RevisionGroupID", Parameter.RevisionGroupID);



            List <L5BD_GBFRG_1005_raw> results = new List <L5BD_GBFRG_1005_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[] { "Building_Name", "RES_BLD_BuildingID", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Building_BalconyPortionPercent", "RES_DUD_RevisionID", "QuestionnaireVersion_RefID", "RES_BLD_RoofID", "RES_BLD_Roof_Type_RefID", "roofComment", "RES_BLD_ApartmentID", "IsAppartment_ForRent", "ApartmentSize_Unit_RefID", "ApartmentSize_Value", "RES_BLD_Apartment_Type_RefID", "apartmentComment", "RES_BLD_OutdoorFacilityID", "NumberOfGaragePlaces", "NumberOfRentedGaragePlaces", "RES_BLD_OutdoorFacility_Type_RefID", "outdoorComment", "RES_BLD_FacadeID", "RES_BLD_Facade_Type_RefID", "facadeComment", "hvacrComment", "RES_BLD_HVACR_Type_RefID", "RES_BLD_HVACRID", "RES_BLD_BasementID", "RES_BLD_Basement_Type_RefID", "basementComment", "RES_BLD_AtticID", "RES_BLD_Attic_Type_RefID", "atticComment", "RES_BLD_StaircaseID", "StaircaseSize_Value", "StaircaseSize_Unit_RefID", "RES_BLD_Staircase_Type_RefID", "staircaseComment" });
                while (reader.Read())
                {
                    L5BD_GBFRG_1005_raw resultItem = new L5BD_GBFRG_1005_raw();
                    //0:Parameter Building_Name of type String
                    resultItem.Building_Name = reader.GetString(0);
                    //1:Parameter RES_BLD_BuildingID of type Guid
                    resultItem.RES_BLD_BuildingID = reader.GetGuid(1);
                    //2:Parameter IsContaminationSuspected of type bool
                    resultItem.IsContaminationSuspected = reader.GetBoolean(2);
                    //3:Parameter Building_NumberOfFloors of type String
                    resultItem.Building_NumberOfFloors = reader.GetString(3);
                    //4:Parameter Building_ElevatorCoveragePercent of type String
                    resultItem.Building_ElevatorCoveragePercent = reader.GetString(4);
                    //5:Parameter Building_NumberOfAppartments of type String
                    resultItem.Building_NumberOfAppartments = reader.GetString(5);
                    //6:Parameter Building_NumberOfOccupiedAppartments of type String
                    resultItem.Building_NumberOfOccupiedAppartments = reader.GetString(6);
                    //7:Parameter Building_NumberOfOffices of type String
                    resultItem.Building_NumberOfOffices = reader.GetString(7);
                    //8:Parameter Building_NumberOfRetailUnits of type String
                    resultItem.Building_NumberOfRetailUnits = reader.GetString(8);
                    //9:Parameter Building_NumberOfProductionUnits of type String
                    resultItem.Building_NumberOfProductionUnits = reader.GetString(9);
                    //10:Parameter Building_NumberOfOtherUnits of type String
                    resultItem.Building_NumberOfOtherUnits = reader.GetString(10);
                    //11:Parameter Building_BalconyPortionPercent of type String
                    resultItem.Building_BalconyPortionPercent = reader.GetString(11);
                    //12:Parameter RES_DUD_RevisionID of type Guid
                    resultItem.RES_DUD_RevisionID = reader.GetGuid(12);
                    //13:Parameter QuestionnaireVersion_RefID of type Guid
                    resultItem.QuestionnaireVersion_RefID = reader.GetGuid(13);
                    //14:Parameter RES_BLD_RoofID of type Guid
                    resultItem.RES_BLD_RoofID = reader.GetGuid(14);
                    //15:Parameter RES_BLD_Roof_Type_RefID of type Guid
                    resultItem.RES_BLD_Roof_Type_RefID = reader.GetGuid(15);
                    //16:Parameter roofComment of type String
                    resultItem.roofComment = reader.GetString(16);
                    //17:Parameter RES_BLD_ApartmentID of type Guid
                    resultItem.RES_BLD_ApartmentID = reader.GetGuid(17);
                    //18:Parameter IsAppartment_ForRent of type bool
                    resultItem.IsAppartment_ForRent = reader.GetBoolean(18);
                    //19:Parameter ApartmentSize_Unit_RefID of type Guid
                    resultItem.ApartmentSize_Unit_RefID = reader.GetGuid(19);
                    //20:Parameter ApartmentSize_Value of type String
                    resultItem.ApartmentSize_Value = reader.GetString(20);
                    //21:Parameter RES_BLD_Apartment_Type_RefID of type Guid
                    resultItem.RES_BLD_Apartment_Type_RefID = reader.GetGuid(21);
                    //22:Parameter apartmentComment of type String
                    resultItem.apartmentComment = reader.GetString(22);
                    //23:Parameter RES_BLD_OutdoorFacilityID of type Guid
                    resultItem.RES_BLD_OutdoorFacilityID = reader.GetGuid(23);
                    //24:Parameter NumberOfGaragePlaces of type String
                    resultItem.NumberOfGaragePlaces = reader.GetString(24);
                    //25:Parameter NumberOfRentedGaragePlaces of type String
                    resultItem.NumberOfRentedGaragePlaces = reader.GetString(25);
                    //26:Parameter RES_BLD_OutdoorFacility_Type_RefID of type Guid
                    resultItem.RES_BLD_OutdoorFacility_Type_RefID = reader.GetGuid(26);
                    //27:Parameter outdoorComment of type String
                    resultItem.outdoorComment = reader.GetString(27);
                    //28:Parameter RES_BLD_FacadeID of type Guid
                    resultItem.RES_BLD_FacadeID = reader.GetGuid(28);
                    //29:Parameter RES_BLD_Facade_Type_RefID of type Guid
                    resultItem.RES_BLD_Facade_Type_RefID = reader.GetGuid(29);
                    //30:Parameter facadeComment of type String
                    resultItem.facadeComment = reader.GetString(30);
                    //31:Parameter hvacrComment of type String
                    resultItem.hvacrComment = reader.GetString(31);
                    //32:Parameter RES_BLD_HVACR_Type_RefID of type Guid
                    resultItem.RES_BLD_HVACR_Type_RefID = reader.GetGuid(32);
                    //33:Parameter RES_BLD_HVACRID of type Guid
                    resultItem.RES_BLD_HVACRID = reader.GetGuid(33);
                    //34:Parameter RES_BLD_BasementID of type Guid
                    resultItem.RES_BLD_BasementID = reader.GetGuid(34);
                    //35:Parameter RES_BLD_Basement_Type_RefID of type Guid
                    resultItem.RES_BLD_Basement_Type_RefID = reader.GetGuid(35);
                    //36:Parameter basementComment of type String
                    resultItem.basementComment = reader.GetString(36);
                    //37:Parameter RES_BLD_AtticID of type Guid
                    resultItem.RES_BLD_AtticID = reader.GetGuid(37);
                    //38:Parameter RES_BLD_Attic_Type_RefID of type Guid
                    resultItem.RES_BLD_Attic_Type_RefID = reader.GetGuid(38);
                    //39:Parameter atticComment of type String
                    resultItem.atticComment = reader.GetString(39);
                    //40:Parameter RES_BLD_StaircaseID of type Guid
                    resultItem.RES_BLD_StaircaseID = reader.GetGuid(40);
                    //41:Parameter StaircaseSize_Value of type String
                    resultItem.StaircaseSize_Value = reader.GetString(41);
                    //42:Parameter StaircaseSize_Unit_RefID of type Guid
                    resultItem.StaircaseSize_Unit_RefID = reader.GetGuid(42);
                    //43:Parameter RES_BLD_Staircase_Type_RefID of type Guid
                    resultItem.RES_BLD_Staircase_Type_RefID = reader.GetGuid(43);
                    //44:Parameter staircaseComment of type String
                    resultItem.staircaseComment = reader.GetString(44);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Buildings_For_RevisionGroupID", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L5BD_GBFRG_1005_raw.Convert(results).ToArray();
            return(returnStatus);
        }
コード例 #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5BD_GBFRG_1005_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5BD_GBFRG_1005 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
コード例 #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5BD_GBFRG_1005_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5BD_GBFRG_1005 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5BD_GBFRG_1005_Array functionReturn = new FR_L5BD_GBFRG_1005_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_Buildings_For_RevisionGroupID", ex);
            }
            return(functionReturn);
        }
コード例 #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5BD_GBFRG_1005_Array Invoke(string ConnectionString, P_L5BD_GBFRG_1005 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }