Example #1
0
        protected static FR_L3_PTfT_1429_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_PTfT_1429 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3_PTfT_1429_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CLE_L3_PatientParameters.Atomic.Retrieval.SQL.cls_ParameterTypes_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;

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant", Parameter.Tenant);



            List <L3_PTfT_1429> results = new List <L3_PTfT_1429>();
            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[] { "HEC_Patient_ParameterID", "PatientParameterITL", "GlobalPropertyMatchingID", "Parameter_Name_DictID", "IsFloat", "IsFloat_ApplicableUnit_RefID", "IsString", "IsVitalParameter", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "HasHighRelevance", "Modification_Timestamp", "ParameterType_RefID", "HEC_Patient_ParameterTypeID", "GlobalPropertyMatchingIDParameterTypes", "Name_DictID", "Creation_TimestampParameterTypes", "IsDeletedParameterTypes", "Modification_TimestampParameterTypes", "IfFloat_MinValue", "IfFloat_MaxValue" });
                while (reader.Read())
                {
                    L3_PTfT_1429 resultItem = new L3_PTfT_1429();
                    //0:Parameter HEC_Patient_ParameterID of type Guid
                    resultItem.HEC_Patient_ParameterID = reader.GetGuid(0);
                    //1:Parameter PatientParameterITL of type String
                    resultItem.PatientParameterITL = reader.GetString(1);
                    //2:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(2);
                    //3:Parameter Parameter_Name of type Dict
                    resultItem.Parameter_Name             = reader.GetDictionary(3);
                    resultItem.Parameter_Name.SourceTable = "hec_patient_parameters";
                    loader.Append(resultItem.Parameter_Name);
                    //4:Parameter IsFloat of type bool
                    resultItem.IsFloat = reader.GetBoolean(4);
                    //5:Parameter IsFloat_ApplicableUnit_RefID of type Guid
                    resultItem.IsFloat_ApplicableUnit_RefID = reader.GetGuid(5);
                    //6:Parameter IsString of type bool
                    resultItem.IsString = reader.GetBoolean(6);
                    //7:Parameter IsVitalParameter of type bool
                    resultItem.IsVitalParameter = reader.GetBoolean(7);
                    //8:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(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);
                    //11:Parameter HasHighRelevance of type bool
                    resultItem.HasHighRelevance = reader.GetBoolean(11);
                    //12:Parameter Modification_Timestamp of type DateTime
                    resultItem.Modification_Timestamp = reader.GetDate(12);
                    //13:Parameter ParameterType_RefID of type Guid
                    resultItem.ParameterType_RefID = reader.GetGuid(13);
                    //14:Parameter HEC_Patient_ParameterTypeID of type Guid
                    resultItem.HEC_Patient_ParameterTypeID = reader.GetGuid(14);
                    //15:Parameter GlobalPropertyMatchingIDParameterTypes of type String
                    resultItem.GlobalPropertyMatchingIDParameterTypes = reader.GetString(15);
                    //16:Parameter Name of type Dict
                    resultItem.Name             = reader.GetDictionary(16);
                    resultItem.Name.SourceTable = "hec_patient_parametertypes";
                    loader.Append(resultItem.Name);
                    //17:Parameter Creation_TimestampParameterTypes of type DateTime
                    resultItem.Creation_TimestampParameterTypes = reader.GetDate(17);
                    //18:Parameter IsDeletedParameterTypes of type bool
                    resultItem.IsDeletedParameterTypes = reader.GetBoolean(18);
                    //19:Parameter Modification_TimestampParameterTypes of type DateTime
                    resultItem.Modification_TimestampParameterTypes = reader.GetDate(19);
                    //20:Parameter IfFloat_MinValue of type double
                    resultItem.IfFloat_MinValue = reader.GetDouble(20);
                    //21:Parameter IfFloat_MaxValue of type double
                    resultItem.IfFloat_MaxValue = reader.GetDouble(21);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #2
0
        protected FR_Base Save(DbConnection Connection, DbTransaction Transaction, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                bool saveDictionary = false;
                bool saveORMClass   = !Status_IsAlreadySaved || Status_IsDirty;


                //If Status Is Dirty (Meaning the data has been changed) or Status_IsAlreadySaved (Meaning the data is in the database, when loaded) just return
                if (saveORMClass == false && saveDictionary == false)
                {
                    return(FR_Base.Status_OK);
                }


                #region Verify/Create Connections
                //Create Connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }

                //Create Transaction if null
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }

                #endregion

                #region Dictionary Management

                //Save dictionary management
                if (saveDictionary == true)
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    //Save the dictionary or update based on if it has already been saved to the database
                    if (Status_IsAlreadySaved)
                    {
                        loader.Update();
                    }
                    else
                    {
                        loader.Save();
                    }
                }
                #endregion

                #region Command Execution
                if (saveORMClass == true)
                {
                    //Retrieve Querry
                    string Query = "";

                    if (Status_IsAlreadySaved == true)
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_RES_BLD.RES_BLD_Building.SQL.Update.sql")).ReadToEnd();
                    }
                    else
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_RES_BLD.RES_BLD_Building.SQL.Insert.sql")).ReadToEnd();
                    }

                    DbCommand command = Connection.CreateCommand();
                    command.Connection     = Connection;
                    command.Transaction    = Transaction;
                    command.CommandText    = Query;
                    command.CommandTimeout = QueryTimeout;

                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RES_BLD_BuildingID", _RES_BLD_BuildingID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_CurrentAverageRentPrice_per_sqm_RefID", _Building_CurrentAverageRentPrice_per_sqm_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BuildingRevisionHeader_RefID", _BuildingRevisionHeader_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_BalconyPortionPercent", _Building_BalconyPortionPercent);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_Name", _Building_Name);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_DocumentationStructure_RefID", _Building_DocumentationStructure_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsContaminationSuspected", _IsContaminationSuspected);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfFloors", _Building_NumberOfFloors);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_ElevatorCoveragePercent", _Building_ElevatorCoveragePercent);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfAppartments", _Building_NumberOfAppartments);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfOccupiedAppartments", _Building_NumberOfOccupiedAppartments);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfOffices", _Building_NumberOfOffices);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfRetailUnits", _Building_NumberOfRetailUnits);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfProductionUnits", _Building_NumberOfProductionUnits);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Building_NumberOfOtherUnits", _Building_NumberOfOtherUnits);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Creation_Timestamp", _Creation_Timestamp);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsDeleted", _IsDeleted);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant_RefID", _Tenant_RefID);


                    try
                    {
                        var dbChangeCount = command.ExecuteNonQuery();
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                    #endregion

                    #region Cleanup Transaction/Connection
                    //If we started the transaction, we will commit it
                    if (cleanupTransaction && Transaction != null)
                    {
                        Transaction.Commit();
                    }

                    //If we opened the connection we will close it
                    if (cleanupConnection && Connection != null)
                    {
                        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(retStatus);
        }
Example #3
0
            private static List <ORM_RES_BLD_Building> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_RES_BLD_Building> items;

                try
                {
                    managedConnection.set(connectionString, connection, transaction);
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction());

                    DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName));
                    query.SetParameters(command);

                    items = new List <ORM_RES_BLD_Building>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "RES_BLD_BuildingID", "Building_CurrentAverageRentPrice_per_sqm_RefID", "BuildingRevisionHeader_RefID", "Building_BalconyPortionPercent", "Building_Name", "Building_DocumentationStructure_RefID", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_RES_BLD_Building item = new ORM_RES_BLD_Building();
                        //0:Parameter RES_BLD_BuildingID of type Guid
                        item.RES_BLD_BuildingID = reader.GetGuid(0);
                        //1:Parameter Building_CurrentAverageRentPrice_per_sqm_RefID of type Guid
                        item.Building_CurrentAverageRentPrice_per_sqm_RefID = reader.GetGuid(1);
                        //2:Parameter BuildingRevisionHeader_RefID of type Guid
                        item.BuildingRevisionHeader_RefID = reader.GetGuid(2);
                        //3:Parameter Building_BalconyPortionPercent of type double
                        item.Building_BalconyPortionPercent = reader.GetDouble(3);
                        //4:Parameter Building_Name of type String
                        item.Building_Name = reader.GetString(4);
                        //5:Parameter Building_DocumentationStructure_RefID of type Guid
                        item.Building_DocumentationStructure_RefID = reader.GetGuid(5);
                        //6:Parameter IsContaminationSuspected of type Boolean
                        item.IsContaminationSuspected = reader.GetBoolean(6);
                        //7:Parameter Building_NumberOfFloors of type int
                        item.Building_NumberOfFloors = reader.GetInteger(7);
                        //8:Parameter Building_ElevatorCoveragePercent of type double
                        item.Building_ElevatorCoveragePercent = reader.GetDouble(8);
                        //9:Parameter Building_NumberOfAppartments of type int
                        item.Building_NumberOfAppartments = reader.GetInteger(9);
                        //10:Parameter Building_NumberOfOccupiedAppartments of type int
                        item.Building_NumberOfOccupiedAppartments = reader.GetInteger(10);
                        //11:Parameter Building_NumberOfOffices of type int
                        item.Building_NumberOfOffices = reader.GetInteger(11);
                        //12:Parameter Building_NumberOfRetailUnits of type int
                        item.Building_NumberOfRetailUnits = reader.GetInteger(12);
                        //13:Parameter Building_NumberOfProductionUnits of type int
                        item.Building_NumberOfProductionUnits = reader.GetInteger(13);
                        //14:Parameter Building_NumberOfOtherUnits of type int
                        item.Building_NumberOfOtherUnits = reader.GetInteger(14);
                        //15:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(15);
                        //16:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(16);
                        //17:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(17);


                        item.Status_IsAlreadySaved = true;
                        item.Status_IsDirty        = false;
                        items.Add(item);
                    }
                    reader.Close();
                    loader.Load();
                    managedConnection.commit();
                }
                catch (Exception ex)
                {
                    managedConnection.rollback();
                    throw ex;
                }
                return(items);
            }
Example #4
0
        protected FR_Base Save(DbConnection Connection, DbTransaction Transaction, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                bool saveDictionary = false;
                bool saveORMClass   = !Status_IsAlreadySaved || Status_IsDirty;


                //If Status Is Dirty (Meaning the data has been changed) or Status_IsAlreadySaved (Meaning the data is in the database, when loaded) just return
                if (saveORMClass == false && saveDictionary == false)
                {
                    return(FR_Base.Status_OK);
                }


                #region Verify/Create Connections
                //Create Connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }

                //Create Transaction if null
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }

                #endregion

                #region Dictionary Management

                //Save dictionary management
                if (saveDictionary == true)
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    //Save the dictionary or update based on if it has already been saved to the database
                    if (Status_IsAlreadySaved)
                    {
                        loader.Update();
                    }
                    else
                    {
                        loader.Save();
                    }
                }
                #endregion

                #region Command Execution
                if (saveORMClass == true)
                {
                    //Retrieve Querry
                    string Query = "";

                    if (Status_IsAlreadySaved == true)
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_DOC.DOC_DocumentTemplate_2_BusinessParticipant.SQL.Update.sql")).ReadToEnd();
                    }
                    else
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_DOC.DOC_DocumentTemplate_2_BusinessParticipant.SQL.Insert.sql")).ReadToEnd();
                    }

                    DbCommand command = Connection.CreateCommand();
                    command.Connection     = Connection;
                    command.Transaction    = Transaction;
                    command.CommandText    = Query;
                    command.CommandTimeout = QueryTimeout;

                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "AssignmentID", _AssignmentID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DOC_DocumentTemplate_Instance_RefID", _DOC_DocumentTemplate_Instance_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_BusinessParticipant_RefID", _CMN_BPT_BusinessParticipant_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Creation_Timestamp", _Creation_Timestamp);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant_RefID", _Tenant_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsDeleted", _IsDeleted);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Modification_Timestamp", _Modification_Timestamp);


                    try
                    {
                        var dbChangeCount = command.ExecuteNonQuery();
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    catch (Exception ex)
                    {
                        throw;
                    }
                    #endregion

                    #region Cleanup Transaction/Connection
                    //If we started the transaction, we will commit it
                    if (cleanupTransaction && Transaction != null)
                    {
                        Transaction.Commit();
                    }

                    //If we opened the connection we will close it
                    if (cleanupConnection && Connection != null)
                    {
                        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;
            }

            return(retStatus);
        }
Example #5
0
        protected static FR_L5AI_GPOHfA_1434_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AI_GPOHfA_1434 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AI_GPOHfA_1434_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOAdmin_ArticlesInfo.Atomic.Retrieval.SQL.cls_Get_ProcurementOrder_History_for_ArticleID.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, "ArticleID", Parameter.ArticleID);



            List <L5AI_GPOHfA_1434> results = new List <L5AI_GPOHfA_1434>();
            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[] { "ProcurementOrder_Number", "Position_ValuePerUnit", "Position_Quantity", "Supplier", "Creator", "Position_RequestedDateOfDelivery", "ExpectedDeliveryDate", "TakenIntoStock_AtDate", "IsTakenIntoStock" });
                while (reader.Read())
                {
                    L5AI_GPOHfA_1434 resultItem = new L5AI_GPOHfA_1434();
                    //0:Parameter ProcurementOrder_Number of type String
                    resultItem.ProcurementOrder_Number = reader.GetString(0);
                    //1:Parameter Position_ValuePerUnit of type decimal
                    resultItem.Position_ValuePerUnit = reader.GetDecimal(1);
                    //2:Parameter Position_Quantity of type String
                    resultItem.Position_Quantity = reader.GetString(2);
                    //3:Parameter Supplier of type String
                    resultItem.Supplier = reader.GetString(3);
                    //4:Parameter Creator of type String
                    resultItem.Creator = reader.GetString(4);
                    //5:Parameter Position_RequestedDateOfDelivery of type DateTime
                    resultItem.Position_RequestedDateOfDelivery = reader.GetDate(5);
                    //6:Parameter ExpectedDeliveryDate of type DateTime
                    resultItem.ExpectedDeliveryDate = reader.GetDate(6);
                    //7:Parameter TakenIntoStock_AtDate of type DateTime
                    resultItem.TakenIntoStock_AtDate = reader.GetDate(7);
                    //8:Parameter IsTakenIntoStock of type bool
                    resultItem.IsTakenIntoStock = reader.GetBoolean(8);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        protected static FR_L3DAC_RACDfT_1423_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3DAC_RACDfT_1423_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_DeviceAccountCodes.Atomic.Retrieval.SQL.cls_Retrive_Account_Code_Details_forTenant.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 <L3DAC_RACDfT_1423> results = new List <L3DAC_RACDfT_1423>();
            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[] { "Account_RefID", "USR_Device_AccountCodeID", "AccountCode_Value", "AccountCode_ValidFrom", "AccountCode_ValidTo", "IsAccountCode_Expirable", "AccountCode_CurrentStatus_RefID", "AccountCode_NumberOfAccesses_MaximumValue", "AccountCode_NumberOfAccesses_CurrentValue", "Tenant_RefID", "BusinessParticipant_RefID" });
                while (reader.Read())
                {
                    L3DAC_RACDfT_1423 resultItem = new L3DAC_RACDfT_1423();
                    //0:Parameter Account_RefID of type Guid
                    resultItem.Account_RefID = reader.GetGuid(0);
                    //1:Parameter USR_Device_AccountCodeID of type Guid
                    resultItem.USR_Device_AccountCodeID = reader.GetGuid(1);
                    //2:Parameter AccountCode_Value of type String
                    resultItem.AccountCode_Value = reader.GetString(2);
                    //3:Parameter AccountCode_ValidFrom of type DateTime
                    resultItem.AccountCode_ValidFrom = reader.GetDate(3);
                    //4:Parameter AccountCode_ValidTo of type DateTime
                    resultItem.AccountCode_ValidTo = reader.GetDate(4);
                    //5:Parameter IsAccountCode_Expirable of type bool
                    resultItem.IsAccountCode_Expirable = reader.GetBoolean(5);
                    //6:Parameter AccountCode_CurrentStatus_RefID of type Guid
                    resultItem.AccountCode_CurrentStatus_RefID = reader.GetGuid(6);
                    //7:Parameter AccountCode_NumberOfAccesses_MaximumValue of type String
                    resultItem.AccountCode_NumberOfAccesses_MaximumValue = reader.GetString(7);
                    //8:Parameter AccountCode_NumberOfAccesses_CurrentValue of type String
                    resultItem.AccountCode_NumberOfAccesses_CurrentValue = reader.GetString(8);
                    //9:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(9);
                    //10:Parameter BusinessParticipant_RefID of type Guid
                    resultItem.BusinessParticipant_RefID = reader.GetGuid(10);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #7
0
            private static List <ORM_HEC_Patient_Prescription_Transaction> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection     managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_Patient_Prescription_Transaction> items;

                try
                {
                    managedConnection.set(connectionString, connection, transaction);
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction());

                    DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName));
                    query.SetParameters(command);

                    items = new List <ORM_HEC_Patient_Prescription_Transaction>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_Patient_Prescription_TransactionID", "PerscriptionTransaction_DeliveryAddress_RefID", "PrescriptionTransaction_Patient_RefID", "PrescriptionTransaction_InternalNubmer", "PrescriptionTransaction_IsComplete", "PrescriptionTransaction_RequestedDateOfDeliveryFrom", "PrescriptionTransaction_RequestedDateOfDeliveryTo", "PrescriptionTransaction_CreatedByBusinessParticpant_RefID", "PrescriptionTransaction_Comment", "PrescriptionTransaction_UsePatientAddress", "PrescriptionTransaction_UseReceiptAddress", "PrescriptionTransaction_UseParticipationPolicyAddress", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_HEC_Patient_Prescription_Transaction item = new ORM_HEC_Patient_Prescription_Transaction();
                        //0:Parameter HEC_Patient_Prescription_TransactionID of type Guid
                        item.HEC_Patient_Prescription_TransactionID = reader.GetGuid(0);
                        //1:Parameter PerscriptionTransaction_DeliveryAddress_RefID of type Guid
                        item.PerscriptionTransaction_DeliveryAddress_RefID = reader.GetGuid(1);
                        //2:Parameter PrescriptionTransaction_Patient_RefID of type Guid
                        item.PrescriptionTransaction_Patient_RefID = reader.GetGuid(2);
                        //3:Parameter PrescriptionTransaction_InternalNubmer of type String
                        item.PrescriptionTransaction_InternalNubmer = reader.GetString(3);
                        //4:Parameter PrescriptionTransaction_IsComplete of type Boolean
                        item.PrescriptionTransaction_IsComplete = reader.GetBoolean(4);
                        //5:Parameter PrescriptionTransaction_RequestedDateOfDeliveryFrom of type DateTime
                        item.PrescriptionTransaction_RequestedDateOfDeliveryFrom = reader.GetDate(5);
                        //6:Parameter PrescriptionTransaction_RequestedDateOfDeliveryTo of type DateTime
                        item.PrescriptionTransaction_RequestedDateOfDeliveryTo = reader.GetDate(6);
                        //7:Parameter PrescriptionTransaction_CreatedByBusinessParticpant_RefID of type Guid
                        item.PrescriptionTransaction_CreatedByBusinessParticpant_RefID = reader.GetGuid(7);
                        //8:Parameter PrescriptionTransaction_Comment of type String
                        item.PrescriptionTransaction_Comment = reader.GetString(8);
                        //9:Parameter PrescriptionTransaction_UsePatientAddress of type Boolean
                        item.PrescriptionTransaction_UsePatientAddress = reader.GetBoolean(9);
                        //10:Parameter PrescriptionTransaction_UseReceiptAddress of type Boolean
                        item.PrescriptionTransaction_UseReceiptAddress = reader.GetBoolean(10);
                        //11:Parameter PrescriptionTransaction_UseParticipationPolicyAddress of type Boolean
                        item.PrescriptionTransaction_UseParticipationPolicyAddress = reader.GetBoolean(11);
                        //12:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(12);
                        //13:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(13);
                        //14:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(14);


                        item.Status_IsAlreadySaved = true;
                        item.Status_IsDirty        = false;
                        items.Add(item);
                    }
                    reader.Close();
                    loader.Load();
                    managedConnection.commit();
                }
                catch (Exception ex)
                {
                    managedConnection.rollback();
                    throw ex;
                }
                return(items);
            }
Example #8
0
        protected static FR_L3CA_GPfPG_0958_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3CA_GPfPG_0958 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3CA_GPfPG_0958_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_APOCatalog.Atomic.Retrieval.SQL.cls_Get_Products_for_ProductGroup.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, "ProductGroupID", Parameter.ProductGroupID);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CatalogRevisionID", Parameter.CatalogRevisionID);



            List <L3CA_GPfPG_0958> results = new List <L3CA_GPfPG_0958>();
            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[] { "CMN_PRO_Catalog_ProductGroup_RefID", "IsDeleted", "Tenant_RefID", "IsDeleted1", "CMN_PRO_Catalog_ProductID", "CMN_PRO_Product_RefID", "Product_Name_DictID", "PackageContent_Amount", "PackageContent_DisplayLabel", "Product_Number", "Label_DictID", "Abbreviation_DictID", "ISOCode", "DosageForm_Name_DictID", "DosageForm_Description_DictID", "GlobalPropertyMatchingID" });
                while (reader.Read())
                {
                    L3CA_GPfPG_0958 resultItem = new L3CA_GPfPG_0958();
                    //0:Parameter CMN_PRO_Catalog_ProductGroup_RefID of type Guid
                    resultItem.CMN_PRO_Catalog_ProductGroup_RefID = reader.GetGuid(0);
                    //1:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(1);
                    //2:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(2);
                    //3:Parameter IsDeleted1 of type bool
                    resultItem.IsDeleted1 = reader.GetBoolean(3);
                    //4:Parameter CMN_PRO_Catalog_ProductID of type Guid
                    resultItem.CMN_PRO_Catalog_ProductID = reader.GetGuid(4);
                    //5:Parameter CMN_PRO_Product_RefID of type Guid
                    resultItem.CMN_PRO_Product_RefID = reader.GetGuid(5);
                    //6:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(6);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //7:Parameter PackageContent_Amount of type Decimal
                    resultItem.PackageContent_Amount = reader.GetDecimal(7);
                    //8:Parameter PackageContent_DisplayLabel of type String
                    resultItem.PackageContent_DisplayLabel = reader.GetString(8);
                    //9:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(9);
                    //10:Parameter Label_DictID of type Dict
                    resultItem.Label_DictID             = reader.GetDictionary(10);
                    resultItem.Label_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label_DictID);
                    //11:Parameter Abbreviation_DictID of type Dict
                    resultItem.Abbreviation_DictID             = reader.GetDictionary(11);
                    resultItem.Abbreviation_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation_DictID);
                    //12:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(12);
                    //13:Parameter DosageForm_Name_DictID of type Dict
                    resultItem.DosageForm_Name_DictID             = reader.GetDictionary(13);
                    resultItem.DosageForm_Name_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name_DictID);
                    //14:Parameter DosageForm_Description_DictID of type Dict
                    resultItem.DosageForm_Description_DictID             = reader.GetDictionary(14);
                    resultItem.DosageForm_Description_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Description_DictID);
                    //15:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(15);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        protected static FR_L5BTS_GWSBD_fPTTR_1641_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5BTS_GWSBD_fPTTR_1641 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5BTS_GWSBD_fPTTR_1641_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_BookableTimeSlot.Atomic.Retrieval.SQL.cls_Get_WebSlotsBD_for_PracticeID_and_TypeID_in_TimeRange.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, "OfficeID", Parameter.OfficeID);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "TypeID", Parameter.TypeID);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "FromDate", Parameter.FromDate);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ToDate", Parameter.ToDate);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "AvaTypeMachingID", Parameter.AvaTypeMachingID);



            List <L5BTS_GWSBD_fPTTR_1641> results = new List <L5BTS_GWSBD_fPTTR_1641>();
            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[] { "PPS_TSK_BOK_BookableTimeSlotID", "TaskTemplate_RefID", "FreeSlotsForTaskTemplateITPL", "FreeInterval_End", "FreeInterval_Start" });
                while (reader.Read())
                {
                    L5BTS_GWSBD_fPTTR_1641 resultItem = new L5BTS_GWSBD_fPTTR_1641();
                    //0:Parameter PPS_TSK_BOK_BookableTimeSlotID of type Guid
                    resultItem.PPS_TSK_BOK_BookableTimeSlotID = reader.GetGuid(0);
                    //1:Parameter TaskTemplate_RefID of type Guid
                    resultItem.TaskTemplate_RefID = reader.GetGuid(1);
                    //2:Parameter FreeSlotsForTaskTemplateITPL of type string
                    resultItem.FreeSlotsForTaskTemplateITPL = reader.GetString(2);
                    //3:Parameter FreeInterval_End of type DateTime
                    resultItem.FreeInterval_End = reader.GetDate(3);
                    //4:Parameter FreeInterval_Start of type DateTime
                    resultItem.FreeInterval_Start = reader.GetDate(4);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #10
0
        protected static FR_L5AF_GAAD_1607_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AF_GAAD_1607 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AF_GAAD_1607_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_Aftercare.Atomic.Retrieval.SQL.cls_Get_AftercareAllData.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, "OrderBy", Parameter.OrderBy);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "S_Practice", Parameter.S_Practice);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "s_Patient", Parameter.s_Patient);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "s_HealthInsurance", Parameter.s_HealthInsurance);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "OrderValue", Parameter.OrderValue);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "StartIndex", Parameter.StartIndex);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "NumberOfElements", Parameter.NumberOfElements);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "statusParameters", Parameter.statusParameters);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "s_doctorParam", Parameter.s_doctorParam);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "s_scheduled_doctorParam", Parameter.s_scheduled_doctorParam);

            /***For Order**/
            if (Parameter.OrderValue != "")
            {
                string newText = command.CommandText.Replace("@OrderValue", Parameter.OrderValue);
                command.CommandText = newText;
            }

            /***Search parameters**/
            if (Parameter.S_Practice != "")
            {
                string newText = command.CommandText.Replace("@S_Practice", Parameter.S_Practice);
                command.CommandText = newText;
            }

            if (Parameter.s_doctorParam != "")
            {
                string newText = command.CommandText.Replace("@s_doctorParam", Parameter.s_doctorParam);
                command.CommandText = newText;
            }

            if (Parameter.s_Patient != "")
            {
                string newText = command.CommandText.Replace("@s_Patient", Parameter.s_Patient);
                command.CommandText = newText;
            }

            if (Parameter.s_scheduled_doctorParam != "")
            {
                string newText = command.CommandText.Replace("@s_scheduled_doctorParam", Parameter.s_scheduled_doctorParam);
                command.CommandText = newText;
            }

            if (Parameter.s_HealthInsurance != "")
            {
                string newText = command.CommandText.Replace("@s_HealthInsurance", Parameter.s_HealthInsurance);
                command.CommandText = newText;
            }

            /***status parameters**/
            if (Parameter.statusParameters != "")
            {
                string newText = command.CommandText.Replace("@statusParameters", Parameter.statusParameters);
                command.CommandText = newText;
            }

            List <L5AF_GAAD_1607> results = new List <L5AF_GAAD_1607>();
            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[] { "FollowupID", "Practice", "IsScheduled", "IsTreatmentBilled", "IsTreatmentPerformed", "FolllowupDate", "TreatmentDate", "PerformedDoctorTitle", "PerformedDoctorFirstName", "PerformedDoctorLastName", "SheduledDoctorTitle", "SheduledDoctorFirstName", "SheduledDoctorLastName", "PatientFirstName", "PatientLastName", "HealthInsurance" });
                while (reader.Read())
                {
                    L5AF_GAAD_1607 resultItem = new L5AF_GAAD_1607();
                    //0:Parameter FollowupID of type Guid
                    resultItem.FollowupID = reader.GetGuid(0);
                    //1:Parameter Practice of type String
                    resultItem.Practice = reader.GetString(1);
                    //2:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(2);
                    //3:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(3);
                    //4:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(4);
                    //5:Parameter FolllowupDate of type DateTime
                    resultItem.FolllowupDate = reader.GetDate(5);
                    //6:Parameter TreatmentDate of type DateTime
                    resultItem.TreatmentDate = reader.GetDate(6);
                    //7:Parameter PerformedDoctorTitle of type String
                    resultItem.PerformedDoctorTitle = reader.GetString(7);
                    //8:Parameter PerformedDoctorFirstName of type String
                    resultItem.PerformedDoctorFirstName = reader.GetString(8);
                    //9:Parameter PerformedDoctorLastName of type String
                    resultItem.PerformedDoctorLastName = reader.GetString(9);
                    //10:Parameter SheduledDoctorTitle of type String
                    resultItem.SheduledDoctorTitle = reader.GetString(10);
                    //11:Parameter SheduledDoctorFirstName of type String
                    resultItem.SheduledDoctorFirstName = reader.GetString(11);
                    //12:Parameter SheduledDoctorLastName of type String
                    resultItem.SheduledDoctorLastName = reader.GetString(12);
                    //13:Parameter PatientFirstName of type String
                    resultItem.PatientFirstName = reader.GetString(13);
                    //14:Parameter PatientLastName of type String
                    resultItem.PatientLastName = reader.GetString(14);
                    //15:Parameter HealthInsurance of type String
                    resultItem.HealthInsurance = reader.GetString(15);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #11
0
        protected static FR_L5EM_GAERCTFFE_1405 Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_GAERCTFFE_1405 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5EM_GAERCTFFE_1405();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_VacationPlanner_Employees.Atomic.Retrieval.SQL.cls_Get_Active_EmployeeRelationshipTimeFrame_For_EmployeeID.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, "EmployeeID", Parameter.EmployeeID);



            List <L5EM_GAERCTFFE_1405> results = new List <L5EM_GAERCTFFE_1405>();
            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[] { "CMN_BPT_EMP_EmployeeID", "BusinessParticipant_RefID", "Staff_Number", "StandardFunction", "EmployeeDocument_Structure_RefID", "InstanceOf_EmploymentRelationships_Template_RefID", "IsLockedFor_TemplateUpdates", "Work_EndDate", "Work_StartDate", "HasWorkRelationEnded", "CMN_BPT_EMP_EmploymentRelationshipID", "CMN_BPT_EMP_EmploymentRelationship_TimeframeID", "CMN_CAL_CalculationTimeframeID", "CalculationTimeframe_StartDate", "CalculationTimefrate_EndDate", "CalculationTimeframe_EstimatedEndDate", "IsCalculationTimeframe_Active" });
                while (reader.Read())
                {
                    L5EM_GAERCTFFE_1405 resultItem = new L5EM_GAERCTFFE_1405();
                    //0:Parameter CMN_BPT_EMP_EmployeeID of type Guid
                    resultItem.CMN_BPT_EMP_EmployeeID = reader.GetGuid(0);
                    //1:Parameter BusinessParticipant_RefID of type Guid
                    resultItem.BusinessParticipant_RefID = reader.GetGuid(1);
                    //2:Parameter Staff_Number of type String
                    resultItem.Staff_Number = reader.GetString(2);
                    //3:Parameter StandardFunction of type String
                    resultItem.StandardFunction = reader.GetString(3);
                    //4:Parameter EmployeeDocument_Structure_RefID of type Guid
                    resultItem.EmployeeDocument_Structure_RefID = reader.GetGuid(4);
                    //5:Parameter InstanceOf_EmploymentRelationships_Template_RefID of type Guid
                    resultItem.InstanceOf_EmploymentRelationships_Template_RefID = reader.GetGuid(5);
                    //6:Parameter IsLockedFor_TemplateUpdates of type bool
                    resultItem.IsLockedFor_TemplateUpdates = reader.GetBoolean(6);
                    //7:Parameter Work_EndDate of type DateTime
                    resultItem.Work_EndDate = reader.GetDate(7);
                    //8:Parameter Work_StartDate of type DateTime
                    resultItem.Work_StartDate = reader.GetDate(8);
                    //9:Parameter HasWorkRelationEnded of type bool
                    resultItem.HasWorkRelationEnded = reader.GetBoolean(9);
                    //10:Parameter CMN_BPT_EMP_EmploymentRelationshipID of type Guid
                    resultItem.CMN_BPT_EMP_EmploymentRelationshipID = reader.GetGuid(10);
                    //11:Parameter CMN_BPT_EMP_EmploymentRelationship_TimeframeID of type Guid
                    resultItem.CMN_BPT_EMP_EmploymentRelationship_TimeframeID = reader.GetGuid(11);
                    //12:Parameter CMN_CAL_CalculationTimeframeID of type Guid
                    resultItem.CMN_CAL_CalculationTimeframeID = reader.GetGuid(12);
                    //13:Parameter CalculationTimeframe_StartDate of type DateTime
                    resultItem.CalculationTimeframe_StartDate = reader.GetDate(13);
                    //14:Parameter CalculationTimefrate_EndDate of type DateTime
                    resultItem.CalculationTimefrate_EndDate = reader.GetDate(14);
                    //15:Parameter CalculationTimeframe_EstimatedEndDate of type DateTime
                    resultItem.CalculationTimeframe_EstimatedEndDate = reader.GetDate(15);
                    //16:Parameter IsCalculationTimeframe_Active of type bool
                    resultItem.IsCalculationTimeframe_Active = reader.GetBoolean(16);

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }
        protected static FR_L5ME_GMSfPAID_1329_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5ME_GMSfPAID_1329 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5ME_GMSfPAID_1329_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_EMR.Atomic.Retrieval.SQL.cls_Get_MedicationSubstance_for_PerformedActionID.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, "PerformedActionID", Parameter.PerformedActionID);



            List <L5ME_GMSfPAID_1329_raw> results = new List <L5ME_GMSfPAID_1329_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[] { "HEC_ACT_PerformedAction_MedicationUpdateID", "DosageText", "MedicationUpdateComment", "ISOCode", "IsActiveComponent", "IfSubstance_Strength", "HEC_Patient_MedicationID", "HEC_SUB_SubstanceID", "Relevant_PatientDiagnosis_RefID", "IntendedApplicationDuration_in_days", "GlobalPropertyMatchingID" });
                while (reader.Read())
                {
                    L5ME_GMSfPAID_1329_raw resultItem = new L5ME_GMSfPAID_1329_raw();
                    //0:Parameter HEC_ACT_PerformedAction_MedicationUpdateID of type Guid
                    resultItem.HEC_ACT_PerformedAction_MedicationUpdateID = reader.GetGuid(0);
                    //1:Parameter DosageText of type String
                    resultItem.DosageText = reader.GetString(1);
                    //2:Parameter MedicationUpdateComment of type String
                    resultItem.MedicationUpdateComment = reader.GetString(2);
                    //3:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(3);
                    //4:Parameter IsActiveComponent of type bool
                    resultItem.IsActiveComponent = reader.GetBoolean(4);
                    //5:Parameter IfSubstance_Strength of type String
                    resultItem.IfSubstance_Strength = reader.GetString(5);
                    //6:Parameter HEC_Patient_MedicationID of type Guid
                    resultItem.HEC_Patient_MedicationID = reader.GetGuid(6);
                    //7:Parameter HEC_SUB_SubstanceID of type Guid
                    resultItem.HEC_SUB_SubstanceID = reader.GetGuid(7);
                    //8:Parameter Relevant_PatientDiagnosis_RefID of type Guid
                    resultItem.Relevant_PatientDiagnosis_RefID = reader.GetGuid(8);
                    //9:Parameter IntendedApplicationDuration_in_days of type int
                    resultItem.IntendedApplicationDuration_in_days = reader.GetInteger(9);
                    //10:Parameter GlobalPropertyMatchingID of type string
                    resultItem.GlobalPropertyMatchingID = reader.GetString(10);

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

            returnStatus.Result = L5ME_GMSfPAID_1329_raw.Convert(results).ToArray();
            return(returnStatus);
        }
Example #13
0
        protected static FR_OR_GOFSR_1055_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_OR_GOFSR_1055_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "MMDocConnectDBMethods.Order.Atomic.Retrieval.SQL.cls_Get_Orders_For_Steribase_Report.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 <OR_GOFSR_1055> results = new List <OR_GOFSR_1055>();
            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[] { "Patient_RefID", "StatusCode", "CaseID", "StatusID", "BusinesParticipantWhoCreatedOrder", "OrderID", "OrderNumber", "CaseNumber", "DrugName", "PZN", "DeliveryDate", "DeliveryTimeFrom", "DeliveryTimeTo", "OnlyLabel", "ChargesFee", "SendInvoiceToPractice", "TreatmentDate", "DoctorID", "OrderCreationTimestamp", "CaseCreationDate", "OrderComment", "HeaderComment", "IsDeleted", "PharmacyName", "PharmacyID" });
                while (reader.Read())
                {
                    OR_GOFSR_1055 resultItem = new OR_GOFSR_1055();
                    //0:Parameter Patient_RefID of type Guid
                    resultItem.Patient_RefID = reader.GetGuid(0);
                    //1:Parameter StatusCode of type Double
                    resultItem.StatusCode = reader.GetDouble(1);
                    //2:Parameter CaseID of type Guid
                    resultItem.CaseID = reader.GetGuid(2);
                    //3:Parameter StatusID of type Guid
                    resultItem.StatusID = reader.GetGuid(3);
                    //4:Parameter BusinesParticipantWhoCreatedOrder of type Guid
                    resultItem.BusinesParticipantWhoCreatedOrder = reader.GetGuid(4);
                    //5:Parameter OrderID of type Guid
                    resultItem.OrderID = reader.GetGuid(5);
                    //6:Parameter OrderNumber of type String
                    resultItem.OrderNumber = reader.GetString(6);
                    //7:Parameter CaseNumber of type String
                    resultItem.CaseNumber = reader.GetString(7);
                    //8:Parameter DrugName of type String
                    resultItem.DrugName = reader.GetString(8);
                    //9:Parameter PZN of type String
                    resultItem.PZN = reader.GetString(9);
                    //10:Parameter DeliveryDate of type DateTime
                    resultItem.DeliveryDate = reader.GetDate(10);
                    //11:Parameter DeliveryTimeFrom of type DateTime
                    resultItem.DeliveryTimeFrom = reader.GetDate(11);
                    //12:Parameter DeliveryTimeTo of type DateTime
                    resultItem.DeliveryTimeTo = reader.GetDate(12);
                    //13:Parameter OnlyLabel of type Boolean
                    resultItem.OnlyLabel = reader.GetBoolean(13);
                    //14:Parameter ChargesFee of type Boolean
                    resultItem.ChargesFee = reader.GetBoolean(14);
                    //15:Parameter SendInvoiceToPractice of type Boolean
                    resultItem.SendInvoiceToPractice = reader.GetBoolean(15);
                    //16:Parameter TreatmentDate of type DateTime
                    resultItem.TreatmentDate = reader.GetDate(16);
                    //17:Parameter DoctorID of type Guid
                    resultItem.DoctorID = reader.GetGuid(17);
                    //18:Parameter OrderCreationTimestamp of type DateTime
                    resultItem.OrderCreationTimestamp = reader.GetDate(18);
                    //19:Parameter CaseCreationDate of type DateTime
                    resultItem.CaseCreationDate = reader.GetDate(19);
                    //20:Parameter OrderComment of type String
                    resultItem.OrderComment = reader.GetString(20);
                    //21:Parameter HeaderComment of type String
                    resultItem.HeaderComment = reader.GetString(21);
                    //22:Parameter IsDeleted of type Boolean
                    resultItem.IsDeleted = reader.GetBoolean(22);
                    //23:Parameter PharmacyName of type String
                    resultItem.PharmacyName = reader.GetString(23);
                    //24:Parameter PharmacyID of type Guid
                    resultItem.PharmacyID = reader.GetGuid(24);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #14
0
        protected static FR_L5ME_GRfPAID_1557_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5ME_GRfPAID_1557 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5ME_GRfPAID_1557_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_EMR.Atomic.Retrieval.SQL.cls_Get_Referrals_for_PerformedActionID.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, "PerformedActionID", Parameter.PerformedActionID);



            List <L5ME_GRfPAID_1557_raw> results = new List <L5ME_GRfPAID_1557_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[] { "HEC_ACT_PerformedAction_ReferralID", "ReferralComment", "HEC_MedicalPractice_TypeID", "MedicalPracticeType_Name_DictID", "HEC_MedicalPractiseID", "OrganizationalUnit_Name_DictID", "HEC_ACT_PerformedAction_Referral_RequestedPotentialProcedureID", "HEC_TRE_PotentialProcedureID", "ProposedDate", "PotentialProcedure_Name_DictID" });
                while (reader.Read())
                {
                    L5ME_GRfPAID_1557_raw resultItem = new L5ME_GRfPAID_1557_raw();
                    //0:Parameter HEC_ACT_PerformedAction_ReferralID of type Guid
                    resultItem.HEC_ACT_PerformedAction_ReferralID = reader.GetGuid(0);
                    //1:Parameter ReferralComment of type String
                    resultItem.ReferralComment = reader.GetString(1);
                    //2:Parameter HEC_MedicalPractice_TypeID of type Guid
                    resultItem.HEC_MedicalPractice_TypeID = reader.GetGuid(2);
                    //3:Parameter MedicalPracticeType_Name of type Dict
                    resultItem.MedicalPracticeType_Name             = reader.GetDictionary(3);
                    resultItem.MedicalPracticeType_Name.SourceTable = "hec_medicalpractice_types";
                    loader.Append(resultItem.MedicalPracticeType_Name);
                    //4:Parameter HEC_MedicalPractiseID of type Guid
                    resultItem.HEC_MedicalPractiseID = reader.GetGuid(4);
                    //5:Parameter OrganizationalUnit_Name of type Dict
                    resultItem.OrganizationalUnit_Name             = reader.GetDictionary(5);
                    resultItem.OrganizationalUnit_Name.SourceTable = "cmn_bpt_ctm_organizationalunits";
                    loader.Append(resultItem.OrganizationalUnit_Name);
                    //6:Parameter HEC_ACT_PerformedAction_Referral_RequestedPotentialProcedureID of type Guid
                    resultItem.HEC_ACT_PerformedAction_Referral_RequestedPotentialProcedureID = reader.GetGuid(6);
                    //7:Parameter HEC_TRE_PotentialProcedureID of type Guid
                    resultItem.HEC_TRE_PotentialProcedureID = reader.GetGuid(7);
                    //8:Parameter ProposedDate of type DateTime
                    resultItem.ProposedDate = reader.GetDate(8);
                    //9:Parameter PotentialProcedure_Name of type Dict
                    resultItem.PotentialProcedure_Name             = reader.GetDictionary(9);
                    resultItem.PotentialProcedure_Name.SourceTable = "hec_tre_potentialprocedures";
                    loader.Append(resultItem.PotentialProcedure_Name);

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

            returnStatus.Result = L5ME_GRfPAID_1557_raw.Convert(results).ToArray();
            return(returnStatus);
        }
        protected static FR_L6TR_GTaRDfBIbT_1204_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6TR_GTaRDfBIbT_1204 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L6TR_GTaRDfBIbT_1204_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_Lucenits_Treatments.Atomic.Retrieval.SQL.cls_Get_Treatment_and_RelevantDiagnosis_for_BillInfo_by_TreatmentID.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;

            command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@TreatmentID", " IN $$TreatmentID$$");
            CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$TreatmentID$", Parameter.TreatmentID);


            List <L6TR_GTaRDfBIbT_1204_raw> results = new List <L6TR_GTaRDfBIbT_1204_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[] { "HEC_Patient_TreatmentID", "TreatmentPractice_RefID", "IsTreatmentPerformed", "IfTreatmentPerformed_ByDoctor_RefID", "IfTreatmentPerformed_Date", "IsTreatmentFollowup", "IfTreatmentFollowup_FromTreatment_RefID", "IsScheduled", "IfSheduled_Date", "IsTreatmentBilled", "IfTreatmentBilled_Date", "Treatment_Comment", "IsTreatmentOfLeftEye", "IsTreatmentOfRightEye", "HEC_Patient_Treatment_RelevantDiagnosisID", "HEC_DIA_Diagnosis_StateID", "HEC_DIA_PotentialDiagnosisID", "Doctor_RefID", "ICD10_Code", "DiagnosisState_Name_DictID", "DiagnosisState_Abbreviation", "Creation_Date", "DiagnosedOnDate", "PotentialDiagnosis_Name_DictID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID" });
                while (reader.Read())
                {
                    L6TR_GTaRDfBIbT_1204_raw resultItem = new L6TR_GTaRDfBIbT_1204_raw();
                    //0:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(0);
                    //1:Parameter TreatmentPractice_RefID of type Guid
                    resultItem.TreatmentPractice_RefID = reader.GetGuid(1);
                    //2:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(2);
                    //3:Parameter IfTreatmentPerformed_ByDoctor_RefID of type Guid
                    resultItem.IfTreatmentPerformed_ByDoctor_RefID = reader.GetGuid(3);
                    //4:Parameter IfTreatmentPerformed_Date of type DateTime
                    resultItem.IfTreatmentPerformed_Date = reader.GetDate(4);
                    //5:Parameter IsTreatmentFollowup of type bool
                    resultItem.IsTreatmentFollowup = reader.GetBoolean(5);
                    //6:Parameter IfTreatmentFollowup_FromTreatment_RefID of type Guid
                    resultItem.IfTreatmentFollowup_FromTreatment_RefID = reader.GetGuid(6);
                    //7:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(7);
                    //8:Parameter IfSheduled_Date of type DateTime
                    resultItem.IfSheduled_Date = reader.GetDate(8);
                    //9:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(9);
                    //10:Parameter IfTreatmentBilled_Date of type DateTime
                    resultItem.IfTreatmentBilled_Date = reader.GetDate(10);
                    //11:Parameter Treatment_Comment of type String
                    resultItem.Treatment_Comment = reader.GetString(11);
                    //12:Parameter IsTreatmentOfLeftEye of type bool
                    resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(12);
                    //13:Parameter IsTreatmentOfRightEye of type bool
                    resultItem.IsTreatmentOfRightEye = reader.GetBoolean(13);
                    //14:Parameter HEC_Patient_Treatment_RelevantDiagnosisID of type Guid
                    resultItem.HEC_Patient_Treatment_RelevantDiagnosisID = reader.GetGuid(14);
                    //15:Parameter HEC_DIA_Diagnosis_StateID of type Guid
                    resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(15);
                    //16:Parameter HEC_DIA_PotentialDiagnosisID of type Guid
                    resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(16);
                    //17:Parameter Doctor_RefID of type Guid
                    resultItem.Doctor_RefID = reader.GetGuid(17);
                    //18:Parameter ICD10_Code of type String
                    resultItem.ICD10_Code = reader.GetString(18);
                    //19:Parameter DiagnosisState_Name of type Dict
                    resultItem.DiagnosisState_Name             = reader.GetDictionary(19);
                    resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states";
                    loader.Append(resultItem.DiagnosisState_Name);
                    //20:Parameter DiagnosisState_Abbreviation of type String
                    resultItem.DiagnosisState_Abbreviation = reader.GetString(20);
                    //21:Parameter Creation_Date of type DateTime
                    resultItem.Creation_Date = reader.GetDate(21);
                    //22:Parameter DiagnosedOnDate of type DateTime
                    resultItem.DiagnosedOnDate = reader.GetDate(22);
                    //23:Parameter PotentialDiagnosis_Name_DictID of type Dict
                    resultItem.PotentialDiagnosis_Name_DictID             = reader.GetDictionary(23);
                    resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses";
                    loader.Append(resultItem.PotentialDiagnosis_Name_DictID);
                    //24:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(24);
                    //25:Parameter Product_Number of type string
                    resultItem.Product_Number = reader.GetString(25);
                    //26:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(26);
                    //27:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(27);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);

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

            returnStatus.Result = L6TR_GTaRDfBIbT_1204_raw.Convert(results).ToArray();
            return(returnStatus);
        }
        protected static FR_L3_CObAC_1533_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_CObAC_1533 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3_CObAC_1533_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_MeasuringPoints.Atomic.Retrieval.SQL.cls_CustomerOwnership_by_AccountCode.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, "AccountCode", Parameter.AccountCode);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "DownloadCode", Parameter.DownloadCode);



            List <L3_CObAC_1533> results = new List <L3_CObAC_1533>();
            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[] { "MRS_MPT_CustomerOwnershipID", "MeasuringPoint_RefID", "Customer_RefID", "ContractNubmer", "ValidFrom", "ValidThrough", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                while (reader.Read())
                {
                    L3_CObAC_1533 resultItem = new L3_CObAC_1533();
                    //0:Parameter MRS_MPT_CustomerOwnershipID of type Guid
                    resultItem.MRS_MPT_CustomerOwnershipID = reader.GetGuid(0);
                    //1:Parameter MeasuringPoint_RefID of type Guid
                    resultItem.MeasuringPoint_RefID = reader.GetGuid(1);
                    //2:Parameter Customer_RefID of type Guid
                    resultItem.Customer_RefID = reader.GetGuid(2);
                    //3:Parameter ContractNubmer of type String
                    resultItem.ContractNubmer = reader.GetString(3);
                    //4:Parameter ValidFrom of type DateTime
                    resultItem.ValidFrom = reader.GetDate(4);
                    //5:Parameter ValidThrough of type DateTime
                    resultItem.ValidThrough = reader.GetDate(5);
                    //6:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(6);
                    //7:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(7);
                    //8:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(8);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        protected static FR_L5TR_GTfPID_1045_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5TR_GTfPID_1045 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5TR_GTfPID_1045_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_Treatments.Complex.Retrieval.SQL.cls_Get_Treatment_for_PatientID.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, "PatientID", Parameter.PatientID);



            List <L5TR_GTfPID_1045_raw> results = new List <L5TR_GTfPID_1045_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[] { "IsTreatmentPerformed", "IfTreatmentPerformed_Date", "IsTreatmentFollowup", "IsScheduled", "IfSheduled_Date", "IsTreatmentBilled", "IfTreatmentBilled_Date", "HEC_Patient_TreatmentID", "IsTreatmentOfLeftEye", "IsTreatmentOfRightEye", "Treatment_PracticeID", "Treatment_Performed_by_DoctorID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID", "Status_Name_DictID", "ArticleDate", "ExpectedDateOfDelivery", "HEC_Patient_Treatment_RequiredProductID", "BoundTo_CustomerOrderPosition_RefID", "PharmacyID", "FollowUp_ID", "IsFollowUPPerformed", "IfFollowUpPerformed_Date", "IfFollowUpSheduled_Date", "Followup_PracticeID", "Followup_Performed_by_DoctorID", "Followup_Scheduled_for_DoctorID" });
                while (reader.Read())
                {
                    L5TR_GTfPID_1045_raw resultItem = new L5TR_GTfPID_1045_raw();
                    //0:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(0);
                    //1:Parameter IfTreatmentPerformed_Date of type DateTime
                    resultItem.IfTreatmentPerformed_Date = reader.GetDate(1);
                    //2:Parameter IsTreatmentFollowup of type bool
                    resultItem.IsTreatmentFollowup = reader.GetBoolean(2);
                    //3:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(3);
                    //4:Parameter IfSheduled_Date of type DateTime
                    resultItem.IfSheduled_Date = reader.GetDate(4);
                    //5:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(5);
                    //6:Parameter IfTreatmentBilled_Date of type DateTime
                    resultItem.IfTreatmentBilled_Date = reader.GetDate(6);
                    //7:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(7);
                    //8:Parameter IsTreatmentOfLeftEye of type bool
                    resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(8);
                    //9:Parameter IsTreatmentOfRightEye of type bool
                    resultItem.IsTreatmentOfRightEye = reader.GetBoolean(9);
                    //10:Parameter Treatment_PracticeID of type Guid
                    resultItem.Treatment_PracticeID = reader.GetGuid(10);
                    //11:Parameter Treatment_Performed_by_DoctorID of type Guid
                    resultItem.Treatment_Performed_by_DoctorID = reader.GetGuid(11);
                    //12:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(12);
                    //13:Parameter Product_Number of type string
                    resultItem.Product_Number = reader.GetString(13);
                    //14:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(14);
                    //15:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(15);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //16:Parameter Status_Name_DictID of type Dict
                    resultItem.Status_Name_DictID             = reader.GetDictionary(16);
                    resultItem.Status_Name_DictID.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name_DictID);
                    //17:Parameter ArticleDate of type DateTime
                    resultItem.ArticleDate = reader.GetDate(17);
                    //18:Parameter ExpectedDateOfDelivery of type DateTime
                    resultItem.ExpectedDateOfDelivery = reader.GetDate(18);
                    //19:Parameter HEC_Patient_Treatment_RequiredProductID of type Guid
                    resultItem.HEC_Patient_Treatment_RequiredProductID = reader.GetGuid(19);
                    //20:Parameter BoundTo_CustomerOrderPosition_RefID of type Guid
                    resultItem.BoundTo_CustomerOrderPosition_RefID = reader.GetGuid(20);
                    //21:Parameter PharmacyID of type Guid
                    resultItem.PharmacyID = reader.GetGuid(21);
                    //22:Parameter FollowUp_ID of type Guid
                    resultItem.FollowUp_ID = reader.GetGuid(22);
                    //23:Parameter IsFollowUPPerformed of type bool
                    resultItem.IsFollowUPPerformed = reader.GetBoolean(23);
                    //24:Parameter IfFollowUpPerformed_Date of type DateTime
                    resultItem.IfFollowUpPerformed_Date = reader.GetDate(24);
                    //25:Parameter IfFollowUpSheduled_Date of type DateTime
                    resultItem.IfFollowUpSheduled_Date = reader.GetDate(25);
                    //26:Parameter Followup_PracticeID of type Guid
                    resultItem.Followup_PracticeID = reader.GetGuid(26);
                    //27:Parameter Followup_Performed_by_DoctorID of type Guid
                    resultItem.Followup_Performed_by_DoctorID = reader.GetGuid(27);
                    //28:Parameter Followup_Scheduled_for_DoctorID of type Guid
                    resultItem.Followup_Scheduled_for_DoctorID = reader.GetGuid(28);

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

            returnStatus.Result = L5TR_GTfPID_1045_raw.Convert(results).ToArray();
            return(returnStatus);
        }
        protected static FR_L5WS_GAfHAfT_1521_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5WS_GAfHAfT_1521 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5WS_GAfHAfT_1521_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_WebShop.Atomic.Retrieval.SQL.cls_Get_Articles_from_HouseList_for_TennantID.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, "ProductGroupMatchingID", Parameter.ProductGroupMatchingID);



            List <L5WS_GAfHAfT_1521> results = new List <L5WS_GAfHAfT_1521>();
            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[] { "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Description_DictID", "Product_Number", "HEC_Product_DosageFormID", "DosageForm_Name_DictID", "CMN_UnitID", "Label_DictID", "Price", "CurrencyISO", "TaxRate" });
                while (reader.Read())
                {
                    L5WS_GAfHAfT_1521 resultItem = new L5WS_GAfHAfT_1521();
                    //0:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(0);
                    //1:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(1);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //2:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(2);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //3:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(3);
                    //4:Parameter HEC_Product_DosageFormID of type Guid
                    resultItem.HEC_Product_DosageFormID = reader.GetGuid(4);
                    //5:Parameter DosageForm_Name of type Dict
                    resultItem.DosageForm_Name             = reader.GetDictionary(5);
                    resultItem.DosageForm_Name.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name);
                    //6:Parameter CMN_UnitID of type Guid
                    resultItem.CMN_UnitID = reader.GetGuid(6);
                    //7:Parameter Unit_Label of type Dict
                    resultItem.Unit_Label             = reader.GetDictionary(7);
                    resultItem.Unit_Label.SourceTable = "cmn_units";
                    loader.Append(resultItem.Unit_Label);
                    //8:Parameter Price of type double
                    resultItem.Price = reader.GetDouble(8);
                    //9:Parameter CurrencyISO of type String
                    resultItem.CurrencyISO = reader.GetString(9);
                    //10:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(10);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #19
0
        private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                #region VerifySessionToken/Create Connections
                //Create connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                //If transaction is not open/not valid
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }
                #endregion
                //Get the SelectQuerry
                string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC.HEC_Patient_Prescription_Transaction.SQL.Select.sql")).ReadToEnd();

                DbCommand command = Connection.CreateCommand();
                //Set Connection/Transaction
                command.Connection  = Connection;
                command.Transaction = Transaction;
                //Set Query/Timeout
                command.CommandText    = SelectQuery;
                command.CommandTimeout = QueryTimeout;

                //Firstly, before loading, set the GUID to empty
                //So the entity does not exist, it will have a GUID set to empty
                _HEC_Patient_Prescription_TransactionID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_Patient_Prescription_TransactionID", ObjectID);

                #region Command Execution
                try
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_Patient_Prescription_TransactionID", "PerscriptionTransaction_DeliveryAddress_RefID", "PrescriptionTransaction_Patient_RefID", "PrescriptionTransaction_InternalNubmer", "PrescriptionTransaction_IsComplete", "PrescriptionTransaction_RequestedDateOfDeliveryFrom", "PrescriptionTransaction_RequestedDateOfDeliveryTo", "PrescriptionTransaction_CreatedByBusinessParticpant_RefID", "PrescriptionTransaction_Comment", "PrescriptionTransaction_UsePatientAddress", "PrescriptionTransaction_UseReceiptAddress", "PrescriptionTransaction_UseParticipationPolicyAddress", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter HEC_Patient_Prescription_TransactionID of type Guid
                        _HEC_Patient_Prescription_TransactionID = reader.GetGuid(0);
                        //1:Parameter PerscriptionTransaction_DeliveryAddress_RefID of type Guid
                        _PerscriptionTransaction_DeliveryAddress_RefID = reader.GetGuid(1);
                        //2:Parameter PrescriptionTransaction_Patient_RefID of type Guid
                        _PrescriptionTransaction_Patient_RefID = reader.GetGuid(2);
                        //3:Parameter PrescriptionTransaction_InternalNubmer of type String
                        _PrescriptionTransaction_InternalNubmer = reader.GetString(3);
                        //4:Parameter PrescriptionTransaction_IsComplete of type Boolean
                        _PrescriptionTransaction_IsComplete = reader.GetBoolean(4);
                        //5:Parameter PrescriptionTransaction_RequestedDateOfDeliveryFrom of type DateTime
                        _PrescriptionTransaction_RequestedDateOfDeliveryFrom = reader.GetDate(5);
                        //6:Parameter PrescriptionTransaction_RequestedDateOfDeliveryTo of type DateTime
                        _PrescriptionTransaction_RequestedDateOfDeliveryTo = reader.GetDate(6);
                        //7:Parameter PrescriptionTransaction_CreatedByBusinessParticpant_RefID of type Guid
                        _PrescriptionTransaction_CreatedByBusinessParticpant_RefID = reader.GetGuid(7);
                        //8:Parameter PrescriptionTransaction_Comment of type String
                        _PrescriptionTransaction_Comment = reader.GetString(8);
                        //9:Parameter PrescriptionTransaction_UsePatientAddress of type Boolean
                        _PrescriptionTransaction_UsePatientAddress = reader.GetBoolean(9);
                        //10:Parameter PrescriptionTransaction_UseReceiptAddress of type Boolean
                        _PrescriptionTransaction_UseReceiptAddress = reader.GetBoolean(10);
                        //11:Parameter PrescriptionTransaction_UseParticipationPolicyAddress of type Boolean
                        _PrescriptionTransaction_UseParticipationPolicyAddress = reader.GetBoolean(11);
                        //12:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(12);
                        //13:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(13);
                        //14:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(14);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_HEC_Patient_Prescription_TransactionID != Guid.Empty)
                    {
                        //Successfully loaded
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    else
                    {
                        //Fault in loading due to invalid UUID (Guid)
                        Status_IsAlreadySaved = false;
                        Status_IsDirty        = false;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                #endregion

                #region Cleanup Transaction/Connection
                //If we started the transaction, we will commit it
                if (cleanupTransaction && Transaction != null)
                {
                    Transaction.Commit();
                }

                //If we opened the connection we will close it
                if (cleanupConnection && Connection != null)
                {
                    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(retStatus);
        }
Example #20
0
        protected FR_Base Save(DbConnection Connection, DbTransaction Transaction, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                bool saveDictionary = !Status_IsAlreadySaved || Component_Name.IsDirty || Component_Description.IsDirty;
                bool saveORMClass   = !Status_IsAlreadySaved || Status_IsDirty;


                //If Status Is Dirty (Meaning the data has been changed) or Status_IsAlreadySaved (Meaning the data is in the database, when loaded) just return
                if (saveORMClass == false && saveDictionary == false)
                {
                    return(FR_Base.Status_OK);
                }


                #region Verify/Create Connections
                //Create Connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }

                //Create Transaction if null
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }

                #endregion

                #region Dictionary Management

                //Save dictionary management
                if (saveDictionary == true)
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    loader.Append(Component_Name, TableName);
                    loader.Append(Component_Description, TableName);

                    //Save the dictionary or update based on if it has already been saved to the database
                    if (Status_IsAlreadySaved)
                    {
                        loader.Update();
                    }
                    else
                    {
                        loader.Save();
                    }
                }
                #endregion

                #region Command Execution
                if (saveORMClass == true)
                {
                    //Retrieve Querry
                    string Query = "";

                    if (Status_IsAlreadySaved == true)
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC_PRO.HEC_PRO_Component.SQL.Update.sql")).ReadToEnd();
                    }
                    else
                    {
                        Query = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC_PRO.HEC_PRO_Component.SQL.Insert.sql")).ReadToEnd();
                    }

                    DbCommand command = Connection.CreateCommand();
                    command.Connection     = Connection;
                    command.Transaction    = Transaction;
                    command.CommandText    = Query;
                    command.CommandTimeout = QueryTimeout;

                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_PRO_ComponentID", _HEC_PRO_ComponentID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "GlobalPropertyMatchingID", _GlobalPropertyMatchingID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ComponentMatterState", _ComponentMatterState);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "AbsoluteCompositionValue_Unit_RefID", _AbsoluteCompositionValue_Unit_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "AbsoluteCompositionValue", _AbsoluteCompositionValue);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RelativeCompositionValue_Unit_RefID", _RelativeCompositionValue_Unit_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RelativeCompositionValue", _RelativeCompositionValue);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BreadUnitContainedAmount", _BreadUnitContainedAmount);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "EthanolContained_VolumePercentage", _EthanolContained_VolumePercentage);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ComponentEneryValue_in_kJ", _ComponentEneryValue_in_kJ);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Component_SimpleName", _Component_SimpleName);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Component_Name", _Component_Name.DictionaryID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Component_Description", _Component_Description.DictionaryID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ComponentDisposalSpeedStatus", _ComponentDisposalSpeedStatus);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "GalenicalTypeInsidePackageStatus", _GalenicalTypeInsidePackageStatus);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ComponentExcipientStatus", _ComponentExcipientStatus);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "GalenicalType_RelativeComposition", _GalenicalType_RelativeComposition);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Creation_Timestamp", _Creation_Timestamp);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant_RefID", _Tenant_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsDeleted", _IsDeleted);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Modification_Timestamp", _Modification_Timestamp);


                    try
                    {
                        var dbChangeCount = command.ExecuteNonQuery();
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                    #endregion

                    #region Cleanup Transaction/Connection
                    //If we started the transaction, we will commit it
                    if (cleanupTransaction && Transaction != null)
                    {
                        Transaction.Commit();
                    }

                    //If we opened the connection we will close it
                    if (cleanupConnection && Connection != null)
                    {
                        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(retStatus);
        }
        protected static FR_L5A_GAATfAID_1530 Execute(DbConnection Connection, DbTransaction Transaction, P_L5A_GAATfAID_1530 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5A_GAATfAID_1530();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_TaskTemplate.Atomic.Retrieval.SQL.cls_Get_AllAppointment_Task_for_AppointmentID.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, "AppointmentID", Parameter.AppointmentID);



            List <L5A_GAATfAID_1530_raw> results = new List <L5A_GAATfAID_1530_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[] { "PPS_TSK_TaskID", "InstantiatedFrom_TaskTemplate_RefID", "DisplayName", "PlannedStartDate", "PlannedDuration_in_sec", "PPS_TSK_Task_StaffBookingsID", "PPS_TSK_Task_RefID", "CMN_BPT_EMP_Employee_RefID", "CreatedFrom_TaskTemplate_RequiredStaff_RefID", "PPS_TSK_Task_OfficeBookingID", "PPS_TSK_Task_RefID_Office", "CMN_STR_Office_RefID", "PPS_TSK_Task_DeviceBookingID", "PPS_TSK_Task_RefID_Device", "PPS_DEV_Device_Instance_RefID", "HEC_APP_AppointmentID", "Ext_PPS_TSK_Task_RefID", "HEC_ACT_PlannedActionID", "Patient_RefID" });
                while (reader.Read())
                {
                    L5A_GAATfAID_1530_raw resultItem = new L5A_GAATfAID_1530_raw();
                    //0:Parameter PPS_TSK_TaskID of type Guid
                    resultItem.PPS_TSK_TaskID = reader.GetGuid(0);
                    //1:Parameter InstantiatedFrom_TaskTemplate_RefID of type Guid
                    resultItem.InstantiatedFrom_TaskTemplate_RefID = reader.GetGuid(1);
                    //2:Parameter DisplayName of type String
                    resultItem.DisplayName = reader.GetString(2);
                    //3:Parameter PlannedStartDate of type DateTime
                    resultItem.PlannedStartDate = reader.GetDate(3);
                    //4:Parameter PlannedDuration_in_sec of type String
                    resultItem.PlannedDuration_in_sec = reader.GetString(4);
                    //5:Parameter PPS_TSK_Task_StaffBookingsID of type Guid
                    resultItem.PPS_TSK_Task_StaffBookingsID = reader.GetGuid(5);
                    //6:Parameter PPS_TSK_Task_RefID of type Guid
                    resultItem.PPS_TSK_Task_RefID = reader.GetGuid(6);
                    //7:Parameter CMN_BPT_EMP_Employee_RefID of type Guid
                    resultItem.CMN_BPT_EMP_Employee_RefID = reader.GetGuid(7);
                    //8:Parameter CreatedFrom_TaskTemplate_RequiredStaff_RefID of type Guid
                    resultItem.CreatedFrom_TaskTemplate_RequiredStaff_RefID = reader.GetGuid(8);
                    //9:Parameter PPS_TSK_Task_OfficeBookingID of type Guid
                    resultItem.PPS_TSK_Task_OfficeBookingID = reader.GetGuid(9);
                    //10:Parameter PPS_TSK_Task_RefID_Office of type Guid
                    resultItem.PPS_TSK_Task_RefID_Office = reader.GetGuid(10);
                    //11:Parameter CMN_STR_Office_RefID of type Guid
                    resultItem.CMN_STR_Office_RefID = reader.GetGuid(11);
                    //12:Parameter PPS_TSK_Task_DeviceBookingID of type Guid
                    resultItem.PPS_TSK_Task_DeviceBookingID = reader.GetGuid(12);
                    //13:Parameter PPS_TSK_Task_RefID_Device of type Guid
                    resultItem.PPS_TSK_Task_RefID_Device = reader.GetGuid(13);
                    //14:Parameter PPS_DEV_Device_Instance_RefID of type Guid
                    resultItem.PPS_DEV_Device_Instance_RefID = reader.GetGuid(14);
                    //15:Parameter HEC_APP_AppointmentID of type Guid
                    resultItem.HEC_APP_AppointmentID = reader.GetGuid(15);
                    //16:Parameter Ext_PPS_TSK_Task_RefID of type Guid
                    resultItem.Ext_PPS_TSK_Task_RefID = reader.GetGuid(16);
                    //17:Parameter HEC_ACT_PlannedActionID of type Guid
                    resultItem.HEC_ACT_PlannedActionID = reader.GetGuid(17);
                    //18:Parameter Patient_RefID of type Guid
                    resultItem.Patient_RefID = reader.GetGuid(18);

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

            returnStatus.Result = L5A_GAATfAID_1530_raw.Convert(results).FirstOrDefault();

            return(returnStatus);
        }
Example #22
0
        private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                #region Verify/Create Connections
                //Create connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                //If transaction is not open/not valid
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }
                #endregion
                //Get the SelectQuerry
                string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC_PRO.HEC_PRO_Component.SQL.Select.sql")).ReadToEnd();

                DbCommand command = Connection.CreateCommand();
                //Set Connection/Transaction
                command.Connection  = Connection;
                command.Transaction = Transaction;
                //Set Query/Timeout
                command.CommandText    = SelectQuery;
                command.CommandTimeout = QueryTimeout;

                //Firstly, before loading, set the GUID to empty
                //So the entity does not exist, it will have a GUID set to empty
                _HEC_PRO_ComponentID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_PRO_ComponentID", ObjectID);

                #region Command Execution
                try
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_PRO_ComponentID", "GlobalPropertyMatchingID", "ComponentMatterState", "AbsoluteCompositionValue_Unit_RefID", "AbsoluteCompositionValue", "RelativeCompositionValue_Unit_RefID", "RelativeCompositionValue", "BreadUnitContainedAmount", "EthanolContained_VolumePercentage", "ComponentEneryValue_in_kJ", "Component_SimpleName", "Component_Name_DictID", "Component_Description_DictID", "ComponentDisposalSpeedStatus", "GalenicalTypeInsidePackageStatus", "ComponentExcipientStatus", "GalenicalType_RelativeComposition", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter HEC_PRO_ComponentID of type Guid
                        _HEC_PRO_ComponentID = reader.GetGuid(0);
                        //1:Parameter GlobalPropertyMatchingID of type String
                        _GlobalPropertyMatchingID = reader.GetString(1);
                        //2:Parameter ComponentMatterState of type int
                        _ComponentMatterState = reader.GetInteger(2);
                        //3:Parameter AbsoluteCompositionValue_Unit_RefID of type Guid
                        _AbsoluteCompositionValue_Unit_RefID = reader.GetGuid(3);
                        //4:Parameter AbsoluteCompositionValue of type Double
                        _AbsoluteCompositionValue = reader.GetDouble(4);
                        //5:Parameter RelativeCompositionValue_Unit_RefID of type Guid
                        _RelativeCompositionValue_Unit_RefID = reader.GetGuid(5);
                        //6:Parameter RelativeCompositionValue of type Double
                        _RelativeCompositionValue = reader.GetDouble(6);
                        //7:Parameter BreadUnitContainedAmount of type Double
                        _BreadUnitContainedAmount = reader.GetDouble(7);
                        //8:Parameter EthanolContained_VolumePercentage of type Double
                        _EthanolContained_VolumePercentage = reader.GetDouble(8);
                        //9:Parameter ComponentEneryValue_in_kJ of type Double
                        _ComponentEneryValue_in_kJ = reader.GetDouble(9);
                        //10:Parameter Component_SimpleName of type String
                        _Component_SimpleName = reader.GetString(10);
                        //11:Parameter Component_Name of type Dict
                        _Component_Name = reader.GetDictionary(11);
                        loader.Append(_Component_Name, TableName);
                        //12:Parameter Component_Description of type Dict
                        _Component_Description = reader.GetDictionary(12);
                        loader.Append(_Component_Description, TableName);
                        //13:Parameter ComponentDisposalSpeedStatus of type int
                        _ComponentDisposalSpeedStatus = reader.GetInteger(13);
                        //14:Parameter GalenicalTypeInsidePackageStatus of type int
                        _GalenicalTypeInsidePackageStatus = reader.GetInteger(14);
                        //15:Parameter ComponentExcipientStatus of type int
                        _ComponentExcipientStatus = reader.GetInteger(15);
                        //16:Parameter GalenicalType_RelativeComposition of type String
                        _GalenicalType_RelativeComposition = reader.GetString(16);
                        //17:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(17);
                        //18:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(18);
                        //19:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(19);
                        //20:Parameter Modification_Timestamp of type DateTime
                        _Modification_Timestamp = reader.GetDate(20);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_HEC_PRO_ComponentID != Guid.Empty)
                    {
                        //Successfully loaded
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    else
                    {
                        //Fault in loading due to invalid UUID (Guid)
                        Status_IsAlreadySaved = false;
                        Status_IsDirty        = false;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                #endregion

                #region Cleanup Transaction/Connection
                //If we started the transaction, we will commit it
                if (cleanupTransaction && Transaction != null)
                {
                    Transaction.Commit();
                }

                //If we opened the connection we will close it
                if (cleanupConnection && Connection != null)
                {
                    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(retStatus);
        }
Example #23
0
        private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                #region Verify/Create Connections
                //Create connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                //If transaction is not open/not valid
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }
                #endregion
                //Get the SelectQuerry
                string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_DOC.DOC_DocumentTemplate_2_BusinessParticipant.SQL.Select.sql")).ReadToEnd();

                DbCommand command = Connection.CreateCommand();
                //Set Connection/Transaction
                command.Connection  = Connection;
                command.Transaction = Transaction;
                //Set Query/Timeout
                command.CommandText    = SelectQuery;
                command.CommandTimeout = QueryTimeout;

                //Firstly, before loading, set the GUID to empty
                //So the entity does not exist, it will have a GUID set to empty
                _AssignmentID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "AssignmentID", ObjectID);

                #region Command Execution
                try
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "AssignmentID", "DOC_DocumentTemplate_Instance_RefID", "CMN_BPT_BusinessParticipant_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter AssignmentID of type Guid
                        _AssignmentID = reader.GetGuid(0);
                        //1:Parameter DOC_DocumentTemplate_Instance_RefID of type Guid
                        _DOC_DocumentTemplate_Instance_RefID = reader.GetGuid(1);
                        //2:Parameter CMN_BPT_BusinessParticipant_RefID of type Guid
                        _CMN_BPT_BusinessParticipant_RefID = reader.GetGuid(2);
                        //3:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(3);
                        //4:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(4);
                        //5:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(5);
                        //6:Parameter Modification_Timestamp of type DateTime
                        _Modification_Timestamp = reader.GetDate(6);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_AssignmentID != Guid.Empty)
                    {
                        //Successfully loaded
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    else
                    {
                        //Fault in loading due to invalid UUID (Guid)
                        Status_IsAlreadySaved = false;
                        Status_IsDirty        = false;
                    }
                }
                catch (Exception ex)
                {
                    throw;
                }
                #endregion

                #region Cleanup Transaction/Connection
                //If we started the transaction, we will commit it
                if (cleanupTransaction && Transaction != null)
                {
                    Transaction.Commit();
                }

                //If we opened the connection we will close it
                if (cleanupConnection && Connection != null)
                {
                    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;
            }

            return(retStatus);
        }
Example #24
0
            private static List <ORM_HEC_PRO_Component> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_PRO_Component> items;

                try
                {
                    managedConnection.set(connectionString, connection, transaction);
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction());

                    DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName));
                    query.SetParameters(command);

                    items = new List <ORM_HEC_PRO_Component>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_PRO_ComponentID", "GlobalPropertyMatchingID", "ComponentMatterState", "AbsoluteCompositionValue_Unit_RefID", "AbsoluteCompositionValue", "RelativeCompositionValue_Unit_RefID", "RelativeCompositionValue", "BreadUnitContainedAmount", "EthanolContained_VolumePercentage", "ComponentEneryValue_in_kJ", "Component_SimpleName", "Component_Name_DictID", "Component_Description_DictID", "ComponentDisposalSpeedStatus", "GalenicalTypeInsidePackageStatus", "ComponentExcipientStatus", "GalenicalType_RelativeComposition", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_HEC_PRO_Component item = new ORM_HEC_PRO_Component();
                        //0:Parameter HEC_PRO_ComponentID of type Guid
                        item.HEC_PRO_ComponentID = reader.GetGuid(0);
                        //1:Parameter GlobalPropertyMatchingID of type String
                        item.GlobalPropertyMatchingID = reader.GetString(1);
                        //2:Parameter ComponentMatterState of type int
                        item.ComponentMatterState = reader.GetInteger(2);
                        //3:Parameter AbsoluteCompositionValue_Unit_RefID of type Guid
                        item.AbsoluteCompositionValue_Unit_RefID = reader.GetGuid(3);
                        //4:Parameter AbsoluteCompositionValue of type Double
                        item.AbsoluteCompositionValue = reader.GetDouble(4);
                        //5:Parameter RelativeCompositionValue_Unit_RefID of type Guid
                        item.RelativeCompositionValue_Unit_RefID = reader.GetGuid(5);
                        //6:Parameter RelativeCompositionValue of type Double
                        item.RelativeCompositionValue = reader.GetDouble(6);
                        //7:Parameter BreadUnitContainedAmount of type Double
                        item.BreadUnitContainedAmount = reader.GetDouble(7);
                        //8:Parameter EthanolContained_VolumePercentage of type Double
                        item.EthanolContained_VolumePercentage = reader.GetDouble(8);
                        //9:Parameter ComponentEneryValue_in_kJ of type Double
                        item.ComponentEneryValue_in_kJ = reader.GetDouble(9);
                        //10:Parameter Component_SimpleName of type String
                        item.Component_SimpleName = reader.GetString(10);
                        //11:Parameter Component_Name of type Dict
                        item.Component_Name = reader.GetDictionary(11);
                        loader.Append(item.Component_Name, TableName);
                        //12:Parameter Component_Description of type Dict
                        item.Component_Description = reader.GetDictionary(12);
                        loader.Append(item.Component_Description, TableName);
                        //13:Parameter ComponentDisposalSpeedStatus of type int
                        item.ComponentDisposalSpeedStatus = reader.GetInteger(13);
                        //14:Parameter GalenicalTypeInsidePackageStatus of type int
                        item.GalenicalTypeInsidePackageStatus = reader.GetInteger(14);
                        //15:Parameter ComponentExcipientStatus of type int
                        item.ComponentExcipientStatus = reader.GetInteger(15);
                        //16:Parameter GalenicalType_RelativeComposition of type String
                        item.GalenicalType_RelativeComposition = reader.GetString(16);
                        //17:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(17);
                        //18:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(18);
                        //19:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(19);
                        //20:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(20);


                        item.Status_IsAlreadySaved = true;
                        item.Status_IsDirty        = false;
                        items.Add(item);
                    }
                    reader.Close();
                    loader.Load();
                    managedConnection.commit();
                }
                catch (Exception ex)
                {
                    managedConnection.rollback();
                    throw ex;
                }
                return(items);
            }
        protected static FR_L5OU_GOUDEUID_1502 Execute(DbConnection Connection, DbTransaction Transaction, P_L5OU_GOUDEUID_1502 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5OU_GOUDEUID_1502();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_OrgUnits.Atomic.Retrieval.SQL.cls_Get_OrgUnitData_Edit_for_UnitID.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, "OfficeID", Parameter.OfficeID);



            List <L5OU_GOUDEUID_1502_raw> results = new List <L5OU_GOUDEUID_1502_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[] { "CMN_STR_OfficeID", "Parent_RefID", "DisplayImage_Document_RefID", "Office_Name_DictID", "PhoneNumber", "Default_Email", "Default_Website", "Comment", "ContactPersonFirstName", "ContactPersonLastName", "ContactPersonTitle", "ParentNameDict", "CMN_AddressID", "IsDefaultAddress", "IsSpecialAddress", "IsBillingAddress", "IsShippingAddress", "Street_Name", "Street_Number", "City_Name", "ZIP", "Longitude", "Lattitude", "Country_ISOCode", "Country_Name", "PPS_TSK_Task_Template_RefID", "HEC_MedicalPractice_TypeID", "MedicalPracticeType_Name_DictID", "CMN_LanguageID", "IsDeleted", "Name_DictID" });
                while (reader.Read())
                {
                    L5OU_GOUDEUID_1502_raw resultItem = new L5OU_GOUDEUID_1502_raw();
                    //0:Parameter CMN_STR_OfficeID of type Guid
                    resultItem.CMN_STR_OfficeID = reader.GetGuid(0);
                    //1:Parameter Parent_RefID of type Guid
                    resultItem.Parent_RefID = reader.GetGuid(1);
                    //2:Parameter DisplayImage_Document_RefID of type Guid
                    resultItem.DisplayImage_Document_RefID = reader.GetGuid(2);
                    //3:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(3);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //4:Parameter PhoneNumber of type String
                    resultItem.PhoneNumber = reader.GetString(4);
                    //5:Parameter Default_Email of type String
                    resultItem.Default_Email = reader.GetString(5);
                    //6:Parameter Default_Website of type String
                    resultItem.Default_Website = reader.GetString(6);
                    //7:Parameter Comment of type String
                    resultItem.Comment = reader.GetString(7);
                    //8:Parameter ContactPersonFirstName of type String
                    resultItem.ContactPersonFirstName = reader.GetString(8);
                    //9:Parameter ContactPersonLastName of type String
                    resultItem.ContactPersonLastName = reader.GetString(9);
                    //10:Parameter ContactPersonTitle of type String
                    resultItem.ContactPersonTitle = reader.GetString(10);
                    //11:Parameter ParentNameDict of type Dict
                    resultItem.ParentNameDict             = reader.GetDictionary(11);
                    resultItem.ParentNameDict.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.ParentNameDict);
                    //12:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(12);
                    //13:Parameter IsDefaultAddress of type bool
                    resultItem.IsDefaultAddress = reader.GetBoolean(13);
                    //14:Parameter IsSpecialAddress of type bool
                    resultItem.IsSpecialAddress = reader.GetBoolean(14);
                    //15:Parameter IsBillingAddress of type bool
                    resultItem.IsBillingAddress = reader.GetBoolean(15);
                    //16:Parameter IsShippingAddress of type bool
                    resultItem.IsShippingAddress = reader.GetBoolean(16);
                    //17:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(17);
                    //18:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(18);
                    //19:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(19);
                    //20:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(20);
                    //21:Parameter Longitude of type double
                    resultItem.Longitude = reader.GetDouble(21);
                    //22:Parameter Lattitude of type double
                    resultItem.Lattitude = reader.GetDouble(22);
                    //23:Parameter Country_ISOCode of type String
                    resultItem.Country_ISOCode = reader.GetString(23);
                    //24:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(24);
                    //25:Parameter PPS_TSK_Task_Template_RefID of type Guid
                    resultItem.PPS_TSK_Task_Template_RefID = reader.GetGuid(25);
                    //26:Parameter HEC_MedicalPractice_TypeID of type Guid
                    resultItem.HEC_MedicalPractice_TypeID = reader.GetGuid(26);
                    //27:Parameter Medical_Practice_Type_Name of type Dict
                    resultItem.Medical_Practice_Type_Name             = reader.GetDictionary(27);
                    resultItem.Medical_Practice_Type_Name.SourceTable = "hec_medicalpractice_types";
                    loader.Append(resultItem.Medical_Practice_Type_Name);
                    //28:Parameter CMN_LanguageID of type Guid
                    resultItem.CMN_LanguageID = reader.GetGuid(28);
                    //29:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(29);
                    //30:Parameter Name of type Dict
                    resultItem.Name             = reader.GetDictionary(30);
                    resultItem.Name.SourceTable = "cmn_languages";
                    loader.Append(resultItem.Name);

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

            returnStatus.Result = L5OU_GOUDEUID_1502_raw.Convert(results).FirstOrDefault();

            return(returnStatus);
        }
        protected static FR_L3US_GUIfAID_1514 Execute(DbConnection Connection, DbTransaction Transaction, P_L3US_GUIfAID_1514 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3US_GUIfAID_1514();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_User.Atomic.Retrieval.SQL.cls_Get_UserInformation_for_AccountID.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, "UserAccountID", Parameter.UserAccountID);



            List <L3US_GUIfAID_1514> results = new List <L3US_GUIfAID_1514>();
            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[] { "Username", "DefaultLanguage_RefID", "CMN_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "Title", "ProfileImage_Document_RefID", "USR_Account_RefID", "File_ServerLocation", "File_SourceLocation" });
                while (reader.Read())
                {
                    L3US_GUIfAID_1514 resultItem = new L3US_GUIfAID_1514();
                    //0:Parameter Username of type String
                    resultItem.Username = reader.GetString(0);
                    //1:Parameter DefaultLanguage_RefID of type Guid
                    resultItem.DefaultLanguage_RefID = reader.GetGuid(1);
                    //2:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(2);
                    //3:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(3);
                    //4:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(4);
                    //5:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(5);
                    //6:Parameter Title of type String
                    resultItem.Title = reader.GetString(6);
                    //7:Parameter ProfileImage_Document_RefID of type Guid
                    resultItem.ProfileImage_Document_RefID = reader.GetGuid(7);
                    //8:Parameter USR_Account_RefID of type Guid
                    resultItem.USR_Account_RefID = reader.GetGuid(8);
                    //9:Parameter File_ServerLocation of type String
                    resultItem.File_ServerLocation = reader.GetString(9);
                    //10:Parameter File_SourceLocation of type String
                    resultItem.File_SourceLocation = reader.GetString(10);

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }
Example #27
0
        private FR_Base Load(DbConnection Connection, DbTransaction Transaction, Guid ObjectID, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                #region Verify/Create Connections
                //Create connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                //If transaction is not open/not valid
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }
                #endregion
                //Get the SelectQuerry
                string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_RES_BLD.RES_BLD_Building.SQL.Select.sql")).ReadToEnd();

                DbCommand command = Connection.CreateCommand();
                //Set Connection/Transaction
                command.Connection  = Connection;
                command.Transaction = Transaction;
                //Set Query/Timeout
                command.CommandText    = SelectQuery;
                command.CommandTimeout = QueryTimeout;

                //Firstly, before loading, set the GUID to empty
                //So the entity does not exist, it will have a GUID set to empty
                _RES_BLD_BuildingID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "RES_BLD_BuildingID", ObjectID);

                #region Command Execution
                try
                {
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "RES_BLD_BuildingID", "Building_CurrentAverageRentPrice_per_sqm_RefID", "BuildingRevisionHeader_RefID", "Building_BalconyPortionPercent", "Building_Name", "Building_DocumentationStructure_RefID", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter RES_BLD_BuildingID of type Guid
                        _RES_BLD_BuildingID = reader.GetGuid(0);
                        //1:Parameter Building_CurrentAverageRentPrice_per_sqm_RefID of type Guid
                        _Building_CurrentAverageRentPrice_per_sqm_RefID = reader.GetGuid(1);
                        //2:Parameter BuildingRevisionHeader_RefID of type Guid
                        _BuildingRevisionHeader_RefID = reader.GetGuid(2);
                        //3:Parameter Building_BalconyPortionPercent of type double
                        _Building_BalconyPortionPercent = reader.GetDouble(3);
                        //4:Parameter Building_Name of type String
                        _Building_Name = reader.GetString(4);
                        //5:Parameter Building_DocumentationStructure_RefID of type Guid
                        _Building_DocumentationStructure_RefID = reader.GetGuid(5);
                        //6:Parameter IsContaminationSuspected of type Boolean
                        _IsContaminationSuspected = reader.GetBoolean(6);
                        //7:Parameter Building_NumberOfFloors of type int
                        _Building_NumberOfFloors = reader.GetInteger(7);
                        //8:Parameter Building_ElevatorCoveragePercent of type double
                        _Building_ElevatorCoveragePercent = reader.GetDouble(8);
                        //9:Parameter Building_NumberOfAppartments of type int
                        _Building_NumberOfAppartments = reader.GetInteger(9);
                        //10:Parameter Building_NumberOfOccupiedAppartments of type int
                        _Building_NumberOfOccupiedAppartments = reader.GetInteger(10);
                        //11:Parameter Building_NumberOfOffices of type int
                        _Building_NumberOfOffices = reader.GetInteger(11);
                        //12:Parameter Building_NumberOfRetailUnits of type int
                        _Building_NumberOfRetailUnits = reader.GetInteger(12);
                        //13:Parameter Building_NumberOfProductionUnits of type int
                        _Building_NumberOfProductionUnits = reader.GetInteger(13);
                        //14:Parameter Building_NumberOfOtherUnits of type int
                        _Building_NumberOfOtherUnits = reader.GetInteger(14);
                        //15:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(15);
                        //16:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(16);
                        //17:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(17);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_RES_BLD_BuildingID != Guid.Empty)
                    {
                        //Successfully loaded
                        Status_IsAlreadySaved = true;
                        Status_IsDirty        = false;
                    }
                    else
                    {
                        //Fault in loading due to invalid UUID (Guid)
                        Status_IsAlreadySaved = false;
                        Status_IsDirty        = false;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                #endregion

                #region Cleanup Transaction/Connection
                //If we started the transaction, we will commit it
                if (cleanupTransaction && Transaction != null)
                {
                    Transaction.Commit();
                }

                //If we opened the connection we will close it
                if (cleanupConnection && Connection != null)
                {
                    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(retStatus);
        }
Example #28
0
        protected static FR_L5AWSSC_GASC_1413_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AWSSC_GASC_1413 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AWSSC_GASC_1413_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOWebShop_ShoppingCart.Atomic.Retrieval.SQL.cls_Get_All_ShoppingCarts.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, "NumberOfLastDays", Parameter.NumberOfLastDays);

            command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@Status_GlobalPropertyMatchingID_List", " IN $$Status_GlobalPropertyMatchingID_List$$");
            CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$Status_GlobalPropertyMatchingID_List$", Parameter.Status_GlobalPropertyMatchingID_List);
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProductNameContains", Parameter.ProductNameContains);



            List <L5AWSSC_GASC_1413> results = new List <L5AWSSC_GASC_1413>();
            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[] { "ORD_PRC_ShoppingCartID", "IsProcurementOrderCreated", "InternalIdentifier", "ShoppingCart_CreationDate", "CMN_STR_OfficeID", "Office_Name_DictID", "Office_InternalName", "ProcurementOrder_Date", "ProcurementOrderStatus", "Status_GlobalPropertyMatchingID" });
                while (reader.Read())
                {
                    L5AWSSC_GASC_1413 resultItem = new L5AWSSC_GASC_1413();
                    //0:Parameter ORD_PRC_ShoppingCartID of type Guid
                    resultItem.ORD_PRC_ShoppingCartID = reader.GetGuid(0);
                    //1:Parameter IsProcurementOrderCreated of type bool
                    resultItem.IsProcurementOrderCreated = reader.GetBoolean(1);
                    //2:Parameter InternalIdentifier of type String
                    resultItem.InternalIdentifier = reader.GetString(2);
                    //3:Parameter ShoppingCart_CreationDate of type DateTime
                    resultItem.ShoppingCart_CreationDate = reader.GetDate(3);
                    //4:Parameter CMN_STR_OfficeID of type Guid
                    resultItem.CMN_STR_OfficeID = reader.GetGuid(4);
                    //5:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(5);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //6:Parameter Office_InternalName of type String
                    resultItem.Office_InternalName = reader.GetString(6);
                    //7:Parameter ProcurementOrder_Date of type DateTime
                    resultItem.ProcurementOrder_Date = reader.GetDate(7);
                    //8:Parameter ProcurementOrderStatus of type String
                    resultItem.ProcurementOrderStatus = reader.GetString(8);
                    //9:Parameter Status_GlobalPropertyMatchingID of type String
                    resultItem.Status_GlobalPropertyMatchingID = reader.GetString(9);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        protected static FR_L5CO_GCOHwPnCI_0820_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5CO_GCOHwPnCI_0820_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOBackoffice_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions.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 <L5CO_GCOHwPnCI_0820_raw> results = new List <L5CO_GCOHwPnCI_0820_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[] { "ORD_CUO_CustomerOrder_HeaderID", "IfCompany_CMN_COM_CompanyInfo_RefID", "CustomerOrder_Number", "OrderedByCompanyName", "OrderedByEmail", "CustomerOrder_Date", "TotalValue_BeforeTax", "Status_Code", "Status_Name_DictID", "GlobalPropertyMatchingID", "OrderCreatedBy", "IsCustomerOrderFinalized", "ConfirmedBy_DisplayName", "Product_Name_DictID", "Product_Number", "CustomerOrder_Header_RefID", "PackageContent_Amount", "PackageContent_MeasuredInUnit_RefID", "DosageForm_Name_DictID", "Abbreviation_DictID", "Label_DictID", "ORD_CUO_CustomerOrder_PositionID", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "TaxRate", "TaxName_DictID", "EconomicRegion_RefID", "ApplicableSalesTax_RefID" });
                while (reader.Read())
                {
                    L5CO_GCOHwPnCI_0820_raw resultItem = new L5CO_GCOHwPnCI_0820_raw();
                    //0:Parameter ORD_CUO_CustomerOrder_HeaderID of type Guid
                    resultItem.ORD_CUO_CustomerOrder_HeaderID = reader.GetGuid(0);
                    //1:Parameter IfCompany_CMN_COM_CompanyInfo_RefID of type Guid
                    resultItem.IfCompany_CMN_COM_CompanyInfo_RefID = reader.GetGuid(1);
                    //2:Parameter CustomerOrder_Number of type String
                    resultItem.CustomerOrder_Number = reader.GetString(2);
                    //3:Parameter OrderedByCompanyName of type String
                    resultItem.OrderedByCompanyName = reader.GetString(3);
                    //4:Parameter OrderedByEmail of type String
                    resultItem.OrderedByEmail = reader.GetString(4);
                    //5:Parameter CustomerOrder_Date of type DateTime
                    resultItem.CustomerOrder_Date = reader.GetDate(5);
                    //6:Parameter TotalValue_BeforeTax of type Decimal
                    resultItem.TotalValue_BeforeTax = reader.GetDecimal(6);
                    //7:Parameter Status_Code of type String
                    resultItem.Status_Code = reader.GetString(7);
                    //8:Parameter Status_Name of type Dict
                    resultItem.Status_Name             = reader.GetDictionary(8);
                    resultItem.Status_Name.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name);
                    //9:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(9);
                    //10:Parameter OrderCreatedBy of type String
                    resultItem.OrderCreatedBy = reader.GetString(10);
                    //11:Parameter IsCustomerOrderFinalized of type Boolean
                    resultItem.IsCustomerOrderFinalized = reader.GetBoolean(11);
                    //12:Parameter ConfirmedBy_DisplayName of type String
                    resultItem.ConfirmedBy_DisplayName = reader.GetString(12);
                    //13:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(13);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //14:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(14);
                    //15:Parameter CustomerOrder_Header_RefID of type Guid
                    resultItem.CustomerOrder_Header_RefID = reader.GetGuid(15);
                    //16:Parameter PackageContent_Amount of type String
                    resultItem.PackageContent_Amount = reader.GetString(16);
                    //17:Parameter PackageContent_MeasuredInUnit_RefID of type Guid
                    resultItem.PackageContent_MeasuredInUnit_RefID = reader.GetGuid(17);
                    //18:Parameter DosageForm_Name of type Dict
                    resultItem.DosageForm_Name             = reader.GetDictionary(18);
                    resultItem.DosageForm_Name.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name);
                    //19:Parameter Abbreviation of type Dict
                    resultItem.Abbreviation             = reader.GetDictionary(19);
                    resultItem.Abbreviation.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation);
                    //20:Parameter Label of type Dict
                    resultItem.Label             = reader.GetDictionary(20);
                    resultItem.Label.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label);
                    //21:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid
                    resultItem.ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(21);
                    //22:Parameter Position_Quantity of type double
                    resultItem.Position_Quantity = reader.GetDouble(22);
                    //23:Parameter Position_ValuePerUnit of type Decimal
                    resultItem.Position_ValuePerUnit = reader.GetDecimal(23);
                    //24:Parameter Position_ValueTotal of type Decimal
                    resultItem.Position_ValueTotal = reader.GetDecimal(24);
                    //25:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(25);
                    //26:Parameter TaxName_DictID of type Dict
                    resultItem.TaxName_DictID             = reader.GetDictionary(26);
                    resultItem.TaxName_DictID.SourceTable = "acc_tax_taxes";
                    loader.Append(resultItem.TaxName_DictID);
                    //27:Parameter EconomicRegion_RefID of type Guid
                    resultItem.EconomicRegion_RefID = reader.GetGuid(27);
                    //28:Parameter ApplicableSalesTax_RefID of type Guid
                    resultItem.ApplicableSalesTax_RefID = reader.GetGuid(28);

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

            returnStatus.Result = L5CO_GCOHwPnCI_0820_raw.Convert(results).ToArray();
            return(returnStatus);
        }
            private static List <ORM_HEC_CMT_OPT_UploadedDiagnosis_Medication> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection         managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_CMT_OPT_UploadedDiagnosis_Medication> items;

                try
                {
                    managedConnection.set(connectionString, connection, transaction);
                    var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(managedConnection.getConnection(), managedConnection.getTransaction());

                    DbCommand command = managedConnection.manage(query.CreateSelectQuery(TableName));
                    query.SetParameters(command);

                    items = new List <ORM_HEC_CMT_OPT_UploadedDiagnosis_Medication>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_CMT_OPT_UploadedDiagnosis_MedicationID", "UploadedDiagnosis_RefID", "IsProduct", "IfProduct_UploadedProductITL", "IsSubstance", "IfSubstance_Unit_ISOCode", "IfSubstance_UploadedSubstanceITL", "IfSubstance_Strength", "DosageText", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_HEC_CMT_OPT_UploadedDiagnosis_Medication item = new ORM_HEC_CMT_OPT_UploadedDiagnosis_Medication();
                        //0:Parameter HEC_CMT_OPT_UploadedDiagnosis_MedicationID of type Guid
                        item.HEC_CMT_OPT_UploadedDiagnosis_MedicationID = reader.GetGuid(0);
                        //1:Parameter UploadedDiagnosis_RefID of type Guid
                        item.UploadedDiagnosis_RefID = reader.GetGuid(1);
                        //2:Parameter IsProduct of type Boolean
                        item.IsProduct = reader.GetBoolean(2);
                        //3:Parameter IfProduct_UploadedProductITL of type String
                        item.IfProduct_UploadedProductITL = reader.GetString(3);
                        //4:Parameter IsSubstance of type Boolean
                        item.IsSubstance = reader.GetBoolean(4);
                        //5:Parameter IfSubstance_Unit_ISOCode of type String
                        item.IfSubstance_Unit_ISOCode = reader.GetString(5);
                        //6:Parameter IfSubstance_UploadedSubstanceITL of type String
                        item.IfSubstance_UploadedSubstanceITL = reader.GetString(6);
                        //7:Parameter IfSubstance_Strength of type String
                        item.IfSubstance_Strength = reader.GetString(7);
                        //8:Parameter DosageText of type String
                        item.DosageText = reader.GetString(8);
                        //9:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(9);
                        //10:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(10);
                        //11:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(11);
                        //12:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(12);


                        item.Status_IsAlreadySaved = true;
                        item.Status_IsDirty        = false;
                        items.Add(item);
                    }
                    reader.Close();
                    loader.Load();
                    managedConnection.commit();
                }
                catch (Exception ex)
                {
                    managedConnection.rollback();
                    throw;
                }
                return(items);
            }