protected static FR_L2ER_GERfT_1643_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L2ER_GERfT_1643_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL2_EconomicRegion.Atomic.Retrieval.SQL.cls_Get_EconomicRegion_for_TenantID.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 <L2ER_GERfT_1643> results = new List <L2ER_GERfT_1643>();
            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_EconomicRegionID", "ParentEconomicRegion_RefID", "EconomicRegion_Name_DictID", "EconomicRegion_Description_DictID", "IsEconomicRegionCountry", "Creation_Timestamp", "IsDeleted", "Tenant_RefID", "Modification_Timestamp" });
                while (reader.Read())
                {
                    L2ER_GERfT_1643 resultItem = new L2ER_GERfT_1643();
                    //0:Parameter CMN_EconomicRegionID of type Guid
                    resultItem.CMN_EconomicRegionID = reader.GetGuid(0);
                    //1:Parameter ParentEconomicRegion_RefID of type Guid
                    resultItem.ParentEconomicRegion_RefID = reader.GetGuid(1);
                    //2:Parameter EconomicRegion_Name of type Dict
                    resultItem.EconomicRegion_Name             = reader.GetDictionary(2);
                    resultItem.EconomicRegion_Name.SourceTable = "cmn_economicregion";
                    loader.Append(resultItem.EconomicRegion_Name);
                    //3:Parameter EconomicRegion_Description of type Dict
                    resultItem.EconomicRegion_Description             = reader.GetDictionary(3);
                    resultItem.EconomicRegion_Description.SourceTable = "cmn_economicregion";
                    loader.Append(resultItem.EconomicRegion_Description);
                    //4:Parameter IsEconomicRegionCountry of type bool
                    resultItem.IsEconomicRegionCountry = reader.GetBoolean(4);
                    //5:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(5);
                    //6:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(6);
                    //7:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(7);
                    //8:Parameter Modification_Timestamp of type DateTime
                    resultItem.Modification_Timestamp = reader.GetDate(8);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        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_Catalog.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", "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 String
                    resultItem.PackageContent_Amount = reader.GetString(7);
                    //8:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(8);
                    //9:Parameter Label_DictID of type Dict
                    resultItem.Label_DictID             = reader.GetDictionary(9);
                    resultItem.Label_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label_DictID);
                    //10:Parameter Abbreviation_DictID of type Dict
                    resultItem.Abbreviation_DictID             = reader.GetDictionary(10);
                    resultItem.Abbreviation_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation_DictID);
                    //11:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(11);
                    //12:Parameter DosageForm_Name_DictID of type Dict
                    resultItem.DosageForm_Name_DictID             = reader.GetDictionary(12);
                    resultItem.DosageForm_Name_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name_DictID);
                    //13:Parameter DosageForm_Description_DictID of type Dict
                    resultItem.DosageForm_Description_DictID             = reader.GetDictionary(13);
                    resultItem.DosageForm_Description_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Description_DictID);
                    //14:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(14);

                    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_L2_DT_GDTSfTaA_1337_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L2_DT_GDTSfTaA_1337_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL2_DeveloperTask.Atomic.Retrieval.SQL.cls_Get_DeveloperTask_Priorities_for_Tenant_and_Acount.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 <L2_DT_GDTSfTaA_1337> results = new List <L2_DT_GDTSfTaA_1337>();
            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[] { "TMS_PRO_DeveloperTask_PriorityID", "Label_DictID", "Description_DictID", "IconLocationURL", "Groups", "PriorityLevel", "IsPersistent", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Priority_Colour", "GlobalPropertyMatchingID" });
                while (reader.Read())
                {
                    L2_DT_GDTSfTaA_1337 resultItem = new L2_DT_GDTSfTaA_1337();
                    //0:Parameter TMS_PRO_DeveloperTask_PriorityID of type Guid
                    resultItem.TMS_PRO_DeveloperTask_PriorityID = reader.GetGuid(0);
                    //1:Parameter Label of type Dict
                    resultItem.Label             = reader.GetDictionary(1);
                    resultItem.Label.SourceTable = "tms_pro_developertask_priorities";
                    loader.Append(resultItem.Label);
                    //2:Parameter Description of type Dict
                    resultItem.Description             = reader.GetDictionary(2);
                    resultItem.Description.SourceTable = "tms_pro_developertask_priorities";
                    loader.Append(resultItem.Description);
                    //3:Parameter IconLocationURL of type String
                    resultItem.IconLocationURL = reader.GetString(3);
                    //4:Parameter Groups of type String
                    resultItem.Groups = reader.GetString(4);
                    //5:Parameter PriorityLevel of type String
                    resultItem.PriorityLevel = reader.GetString(5);
                    //6:Parameter IsPersistent of type bool
                    resultItem.IsPersistent = reader.GetBoolean(6);
                    //7:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(7);
                    //8:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(8);
                    //9:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(9);
                    //10:Parameter Priority_Colour of type String
                    resultItem.Priority_Colour = reader.GetString(10);
                    //11:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(11);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #4
0
            private static List <ORM_CMN_PRO_Product_Variant> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_CMN_PRO_Product_Variant>          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_CMN_PRO_Product_Variant>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_PRO_Product_VariantID", "ProductVariantITL", "VariantName_DictID", "CMN_PRO_Product_RefID", "ProductVariant_DocumentationStructure_RefID", "IsStandardProductVariant", "IsImportedFromExternalCatalog", "IsProductAvailableForOrdering", "IsObsolete", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_CMN_PRO_Product_Variant item = new ORM_CMN_PRO_Product_Variant();
                        //0:Parameter CMN_PRO_Product_VariantID of type Guid
                        item.CMN_PRO_Product_VariantID = reader.GetGuid(0);
                        //1:Parameter ProductVariantITL of type String
                        item.ProductVariantITL = reader.GetString(1);
                        //2:Parameter VariantName of type Dict
                        item.VariantName = reader.GetDictionary(2);
                        loader.Append(item.VariantName, TableName);
                        //3:Parameter CMN_PRO_Product_RefID of type Guid
                        item.CMN_PRO_Product_RefID = reader.GetGuid(3);
                        //4:Parameter ProductVariant_DocumentationStructure_RefID of type Guid
                        item.ProductVariant_DocumentationStructure_RefID = reader.GetGuid(4);
                        //5:Parameter IsStandardProductVariant of type Boolean
                        item.IsStandardProductVariant = reader.GetBoolean(5);
                        //6:Parameter IsImportedFromExternalCatalog of type Boolean
                        item.IsImportedFromExternalCatalog = reader.GetBoolean(6);
                        //7:Parameter IsProductAvailableForOrdering of type Boolean
                        item.IsProductAvailableForOrdering = reader.GetBoolean(7);
                        //8:Parameter IsObsolete of type Boolean
                        item.IsObsolete = reader.GetBoolean(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);
            }
        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_ORD_CUO.ORD_CUO_CustomerOrder_Position.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
                _ORD_CUO_CustomerOrder_PositionID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ORD_CUO_CustomerOrder_PositionID", 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[] { "ORD_CUO_CustomerOrder_PositionID", "CustomerProcurementOrderPositionITL", "CustomerOrder_Header_RefID", "Position_OrdinalNumber", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "Position_Comment", "Position_Description", "Position_Unit_RefID", "Position_RequestedDateOfDelivery", "CMN_PRO_Product_Variant_RefID", "CMN_PRO_Product_RefID", "CMN_PRO_Product_Release_RefID", "IsProductReplacementAllowed", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid
                        _ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(0);
                        //1:Parameter CustomerProcurementOrderPositionITL of type String
                        _CustomerProcurementOrderPositionITL = reader.GetString(1);
                        //2:Parameter CustomerOrder_Header_RefID of type Guid
                        _CustomerOrder_Header_RefID = reader.GetGuid(2);
                        //3:Parameter Position_OrdinalNumber of type int
                        _Position_OrdinalNumber = reader.GetInteger(3);
                        //4:Parameter Position_Quantity of type Double
                        _Position_Quantity = reader.GetDouble(4);
                        //5:Parameter Position_ValuePerUnit of type Decimal
                        _Position_ValuePerUnit = reader.GetDecimal(5);
                        //6:Parameter Position_ValueTotal of type Decimal
                        _Position_ValueTotal = reader.GetDecimal(6);
                        //7:Parameter Position_Comment of type String
                        _Position_Comment = reader.GetString(7);
                        //8:Parameter Position_Description of type String
                        _Position_Description = reader.GetString(8);
                        //9:Parameter Position_Unit_RefID of type Guid
                        _Position_Unit_RefID = reader.GetGuid(9);
                        //10:Parameter Position_RequestedDateOfDelivery of type DateTime
                        _Position_RequestedDateOfDelivery = reader.GetDate(10);
                        //11:Parameter CMN_PRO_Product_Variant_RefID of type Guid
                        _CMN_PRO_Product_Variant_RefID = reader.GetGuid(11);
                        //12:Parameter CMN_PRO_Product_RefID of type Guid
                        _CMN_PRO_Product_RefID = reader.GetGuid(12);
                        //13:Parameter CMN_PRO_Product_Release_RefID of type Guid
                        _CMN_PRO_Product_Release_RefID = reader.GetGuid(13);
                        //14:Parameter IsProductReplacementAllowed of type Boolean
                        _IsProductReplacementAllowed = reader.GetBoolean(14);
                        //15:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(15);
                        //16:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(16);
                        //17:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(17);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_ORD_CUO_CustomerOrder_PositionID != 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);
        }
        protected static FR_L5EM_GEPN_1235 Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_GEPN_1235 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5EM_GEPN_1235();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_VacationPlanner_Employees.Atomic.Retrieval.SQL.cls_Get_EmployeePhoneNumbers.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_GEPN_1235_raw> results = new List <L5EM_GEPN_1235_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_BPT_EMP_EmployeeID", "FirstName", "LastName", "PrimaryEmail", "Title", "BirthDate", "Address_RefID", "ProfileImage_Document_RefID", "Creation_Timestamp", "CMN_BPT_BusinessParticipantID", "CMN_PER_PersonInfoID", "CMN_PER_CommunicationContactID", "CMN_PER_CommunicationContact_TypeID", "Content", "Type" });
                while (reader.Read())
                {
                    L5EM_GEPN_1235_raw resultItem = new L5EM_GEPN_1235_raw();
                    //0:Parameter CMN_BPT_EMP_EmployeeID of type Guid
                    resultItem.CMN_BPT_EMP_EmployeeID = reader.GetGuid(0);
                    //1:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(1);
                    //2:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(2);
                    //3:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(3);
                    //4:Parameter Title of type String
                    resultItem.Title = reader.GetString(4);
                    //5:Parameter BirthDate of type DateTime
                    resultItem.BirthDate = reader.GetDate(5);
                    //6:Parameter Address_RefID of type Guid
                    resultItem.Address_RefID = reader.GetGuid(6);
                    //7:Parameter ProfileImage_Document_RefID of type Guid
                    resultItem.ProfileImage_Document_RefID = reader.GetGuid(7);
                    //8:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(8);
                    //9:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(9);
                    //10:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(10);
                    //11:Parameter CMN_PER_CommunicationContactID of type Guid
                    resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(11);
                    //12:Parameter CMN_PER_CommunicationContact_TypeID of type Guid
                    resultItem.CMN_PER_CommunicationContact_TypeID = reader.GetGuid(12);
                    //13:Parameter Content of type String
                    resultItem.Content = reader.GetString(13);
                    //14:Parameter Type of type String
                    resultItem.Type = reader.GetString(14);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw ex;
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

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

            return(returnStatus);
        }
Example #7
0
            private static List <ORM_ORD_PRC_SPB_SupplierBill_Header> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_ORD_PRC_SPB_SupplierBill_Header>  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_ORD_PRC_SPB_SupplierBill_Header>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "ORD_PRC_SPB_SupplierBill_HeaderID", "Supplier_RefID", "Currency_RefID", "SupplierBillNumber", "DateOnBill", "TotalValue_BeforeTax", "TotalValue_IncludingTax", "BillComment", "PaymentTargetDate", "CashDiscountInPercent", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    while (reader.Read())
                    {
                        ORM_ORD_PRC_SPB_SupplierBill_Header item = new ORM_ORD_PRC_SPB_SupplierBill_Header();
                        //0:Parameter ORD_PRC_SPB_SupplierBill_HeaderID of type Guid
                        item.ORD_PRC_SPB_SupplierBill_HeaderID = reader.GetGuid(0);
                        //1:Parameter Supplier_RefID of type Guid
                        item.Supplier_RefID = reader.GetGuid(1);
                        //2:Parameter Currency_RefID of type Guid
                        item.Currency_RefID = reader.GetGuid(2);
                        //3:Parameter SupplierBillNumber of type String
                        item.SupplierBillNumber = reader.GetString(3);
                        //4:Parameter DateOnBill of type DateTime
                        item.DateOnBill = reader.GetDate(4);
                        //5:Parameter TotalValue_BeforeTax of type Decimal
                        item.TotalValue_BeforeTax = reader.GetDecimal(5);
                        //6:Parameter TotalValue_IncludingTax of type Decimal
                        item.TotalValue_IncludingTax = reader.GetDecimal(6);
                        //7:Parameter BillComment of type String
                        item.BillComment = reader.GetString(7);
                        //8:Parameter PaymentTargetDate of type DateTime
                        item.PaymentTargetDate = reader.GetDate(8);
                        //9:Parameter CashDiscountInPercent of type Double
                        item.CashDiscountInPercent = reader.GetDouble(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(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);
            }
Example #8
0
        protected static FR_L5AR_GASfA_1520_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AR_GASfA_1520 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AR_GASfA_1520_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOAdmin_Articles.Atomic.Retrieval.SQL.cls_Get_ArticleStorages_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 <L5AR_GASfA_1520> results = new List <L5AR_GASfA_1520>();
            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[] { "LOG_WRH_QuantityLevelID", "Quantity_Minimum", "Quantity_RecommendedMinimumCalculation", "Quantity_Maximum", "ArticleID", "AreaID", "RackID", "QLAreaID", "QLRackID", "QLShelfID", "AreaCode", "RackCode", "ShelfCode", "IsPointOfSalesArea", "IsLongTermStorageArea", "LocationPriority", "PredefinedProductLocationID" });
                while (reader.Read())
                {
                    L5AR_GASfA_1520 resultItem = new L5AR_GASfA_1520();
                    //0:Parameter LOG_WRH_QuantityLevelID of type Guid
                    resultItem.LOG_WRH_QuantityLevelID = reader.GetGuid(0);
                    //1:Parameter Quantity_Minimum of type Double
                    resultItem.Quantity_Minimum = reader.GetDouble(1);
                    //2:Parameter Quantity_RecommendedMinimumCalculation of type Double
                    resultItem.Quantity_RecommendedMinimumCalculation = reader.GetDouble(2);
                    //3:Parameter Quantity_Maximum of type Double
                    resultItem.Quantity_Maximum = reader.GetDouble(3);
                    //4:Parameter ArticleID of type Guid
                    resultItem.ArticleID = reader.GetGuid(4);
                    //5:Parameter AreaID of type Guid
                    resultItem.AreaID = reader.GetGuid(5);
                    //6:Parameter RackID of type Guid
                    resultItem.RackID = reader.GetGuid(6);
                    //7:Parameter QLAreaID of type Guid
                    resultItem.QLAreaID = reader.GetGuid(7);
                    //8:Parameter QLRackID of type Guid
                    resultItem.QLRackID = reader.GetGuid(8);
                    //9:Parameter QLShelfID of type Guid
                    resultItem.QLShelfID = reader.GetGuid(9);
                    //10:Parameter AreaCode of type string
                    resultItem.AreaCode = reader.GetString(10);
                    //11:Parameter RackCode of type string
                    resultItem.RackCode = reader.GetString(11);
                    //12:Parameter ShelfCode of type string
                    resultItem.ShelfCode = reader.GetString(12);
                    //13:Parameter IsPointOfSalesArea of type Boolean
                    resultItem.IsPointOfSalesArea = reader.GetBoolean(13);
                    //14:Parameter IsLongTermStorageArea of type Boolean
                    resultItem.IsLongTermStorageArea = reader.GetBoolean(14);
                    //15:Parameter LocationPriority of type int
                    resultItem.LocationPriority = reader.GetInteger(15);
                    //16:Parameter PredefinedProductLocationID of type Guid
                    resultItem.PredefinedProductLocationID = reader.GetGuid(16);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
            private static List <ORM_HEC_PRC_ProcurementOrder_Position> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection  managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_PRC_ProcurementOrder_Position> 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_PRC_ProcurementOrder_Position>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_PRC_ProcurementOrder_PositionID", "Ext_ORD_PRC_ProcurementOrder_Position_RefID", "Clearing_Doctor_RefID", "ClearingDoctor_DisplayName", "OrderedFor_Patient_RefID", "OrderedForPatient_DisplayName", "OrderedFor_Doctor_RefID", "OrderedForDoctor_DisplayName", "IsOrderForPatient_PatientFeeWaived", "IfProFormaOrderPosition_PrintLabelOnly", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_HEC_PRC_ProcurementOrder_Position item = new ORM_HEC_PRC_ProcurementOrder_Position();
                        //0:Parameter HEC_PRC_ProcurementOrder_PositionID of type Guid
                        item.HEC_PRC_ProcurementOrder_PositionID = reader.GetGuid(0);
                        //1:Parameter Ext_ORD_PRC_ProcurementOrder_Position_RefID of type Guid
                        item.Ext_ORD_PRC_ProcurementOrder_Position_RefID = reader.GetGuid(1);
                        //2:Parameter Clearing_Doctor_RefID of type Guid
                        item.Clearing_Doctor_RefID = reader.GetGuid(2);
                        //3:Parameter ClearingDoctor_DisplayName of type String
                        item.ClearingDoctor_DisplayName = reader.GetString(3);
                        //4:Parameter OrderedFor_Patient_RefID of type Guid
                        item.OrderedFor_Patient_RefID = reader.GetGuid(4);
                        //5:Parameter OrderedForPatient_DisplayName of type String
                        item.OrderedForPatient_DisplayName = reader.GetString(5);
                        //6:Parameter OrderedFor_Doctor_RefID of type Guid
                        item.OrderedFor_Doctor_RefID = reader.GetGuid(6);
                        //7:Parameter OrderedForDoctor_DisplayName of type String
                        item.OrderedForDoctor_DisplayName = reader.GetString(7);
                        //8:Parameter IsOrderForPatient_PatientFeeWaived of type Boolean
                        item.IsOrderForPatient_PatientFeeWaived = reader.GetBoolean(8);
                        //9:Parameter IfProFormaOrderPosition_PrintLabelOnly of type Boolean
                        item.IfProFormaOrderPosition_PrintLabelOnly = reader.GetBoolean(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(12);
                        //13:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(13);


                        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);
            }
            private static List <ORM_CMN_BPT_STR_Office_SettingsProfile> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection   managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_CMN_BPT_STR_Office_SettingsProfile> 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_CMN_BPT_STR_Office_SettingsProfile>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_BPT_STR_Office_SettingsProfileID", "Office_RefID", "AdulthoodAge", "RestWarningThreshold_Adults_in_mins", "RestWarningThreshold_NonAdults_in_mins", "RestMinimumThresholdl_Adults_in_mins", "RestMinimumThresholdl_NonAdults_in_mins", "WorkTimeWarningTreshold_Adults_in_mins", "WorkTimeWarningTreshold_NonAdults_in_mins", "WorkTimeMaximumTreshold_Adults_in_mins", "WorkTimeMaximumTreshold_NonAdults_in_mins", "WorkStartTimeWarning_NonAdults_in_mins", "WorkStartTimeMinimum_NonAdults_in_mins", "WorkEndTimeWarning_NonAdults_in_mins", "WorkEndTimeMaximum_NonAdults_in_mins", "WorktimeBalancePeriod_in_months", "WorkdayStart_in_mins", "RoosterGridMinimumPlanningUnit_in_mins", "MaximumPreWork_Period_in_mins", "MaximumPostWork_Period_in_mins", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    while (reader.Read())
                    {
                        ORM_CMN_BPT_STR_Office_SettingsProfile item = new ORM_CMN_BPT_STR_Office_SettingsProfile();
                        //0:Parameter CMN_BPT_STR_Office_SettingsProfileID of type Guid
                        item.CMN_BPT_STR_Office_SettingsProfileID = reader.GetGuid(0);
                        //1:Parameter Office_RefID of type Guid
                        item.Office_RefID = reader.GetGuid(1);
                        //2:Parameter AdulthoodAge of type int
                        item.AdulthoodAge = reader.GetInteger(2);
                        //3:Parameter RestWarningThreshold_Adults_in_mins of type int
                        item.RestWarningThreshold_Adults_in_mins = reader.GetInteger(3);
                        //4:Parameter RestWarningThreshold_NonAdults_in_mins of type int
                        item.RestWarningThreshold_NonAdults_in_mins = reader.GetInteger(4);
                        //5:Parameter RestMinimumThresholdl_Adults_in_mins of type int
                        item.RestMinimumThresholdl_Adults_in_mins = reader.GetInteger(5);
                        //6:Parameter RestMinimumThresholdl_NonAdults_in_mins of type int
                        item.RestMinimumThresholdl_NonAdults_in_mins = reader.GetInteger(6);
                        //7:Parameter WorkTimeWarningTreshold_Adults_in_mins of type int
                        item.WorkTimeWarningTreshold_Adults_in_mins = reader.GetInteger(7);
                        //8:Parameter WorkTimeWarningTreshold_NonAdults_in_mins of type int
                        item.WorkTimeWarningTreshold_NonAdults_in_mins = reader.GetInteger(8);
                        //9:Parameter WorkTimeMaximumTreshold_Adults_in_mins of type int
                        item.WorkTimeMaximumTreshold_Adults_in_mins = reader.GetInteger(9);
                        //10:Parameter WorkTimeMaximumTreshold_NonAdults_in_mins of type int
                        item.WorkTimeMaximumTreshold_NonAdults_in_mins = reader.GetInteger(10);
                        //11:Parameter WorkStartTimeWarning_NonAdults_in_mins of type int
                        item.WorkStartTimeWarning_NonAdults_in_mins = reader.GetInteger(11);
                        //12:Parameter WorkStartTimeMinimum_NonAdults_in_mins of type int
                        item.WorkStartTimeMinimum_NonAdults_in_mins = reader.GetInteger(12);
                        //13:Parameter WorkEndTimeWarning_NonAdults_in_mins of type int
                        item.WorkEndTimeWarning_NonAdults_in_mins = reader.GetInteger(13);
                        //14:Parameter WorkEndTimeMaximum_NonAdults_in_mins of type int
                        item.WorkEndTimeMaximum_NonAdults_in_mins = reader.GetInteger(14);
                        //15:Parameter WorktimeBalancePeriod_in_months of type int
                        item.WorktimeBalancePeriod_in_months = reader.GetInteger(15);
                        //16:Parameter WorkdayStart_in_mins of type int
                        item.WorkdayStart_in_mins = reader.GetInteger(16);
                        //17:Parameter RoosterGridMinimumPlanningUnit_in_mins of type int
                        item.RoosterGridMinimumPlanningUnit_in_mins = reader.GetInteger(17);
                        //18:Parameter MaximumPreWork_Period_in_mins of type int
                        item.MaximumPreWork_Period_in_mins = reader.GetInteger(18);
                        //19:Parameter MaximumPostWork_Period_in_mins of type int
                        item.MaximumPostWork_Period_in_mins = reader.GetInteger(19);
                        //20:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(20);
                        //21:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(21);
                        //22:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(22);


                        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 #11
0
        protected static FR_L3_PIfT_1237_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_PIfT_1237 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3_PIfT_1237_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CLE_L3_Patients.Atomic.Retrieval.SQL.cls_PatientInfos_for_Tennant.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_PIfT_1237_raw> results = new List <L3_PIfT_1237_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_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "BirthDate", "HEC_PatientID", "CMN_BPT_BusinessParticipant_RefID", "Creation_Timestamp", "IsDeleted", "Tenant_RefID", "Gender", "AgeCalculation_YearOfBirth", "DefaultLanguage_RefID", "Modification_TimestampBP", "Modification_TimestampPatient", "Modification_TimestampPersoInfo", "Modification_TimestampCommunicationContact", "Modification_TimestampContactType", "CMN_PER_CommunicationContactID", "Contact_Type", "Content", "IsDefaultForContactType" });
                while (reader.Read())
                {
                    L3_PIfT_1237_raw resultItem = new L3_PIfT_1237_raw();
                    //0:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(0);
                    //1:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(1);
                    //2:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(2);
                    //3:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(3);
                    //4:Parameter BirthDate of type DateTime
                    resultItem.BirthDate = reader.GetDate(4);
                    //5:Parameter HEC_PatientID of type Guid
                    resultItem.HEC_PatientID = reader.GetGuid(5);
                    //6:Parameter CMN_BPT_BusinessParticipant_RefID of type Guid
                    resultItem.CMN_BPT_BusinessParticipant_RefID = reader.GetGuid(6);
                    //7:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(7);
                    //8:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(8);
                    //9:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(9);
                    //10:Parameter Gender of type int
                    resultItem.Gender = reader.GetInteger(10);
                    //11:Parameter AgeCalculation_YearOfBirth of type int
                    resultItem.AgeCalculation_YearOfBirth = reader.GetInteger(11);
                    //12:Parameter DefaultLanguage_RefID of type Guid
                    resultItem.DefaultLanguage_RefID = reader.GetGuid(12);
                    //13:Parameter Modification_TimestampBP of type DateTime
                    resultItem.Modification_TimestampBP = reader.GetDate(13);
                    //14:Parameter Modification_TimestampPatient of type DateTime
                    resultItem.Modification_TimestampPatient = reader.GetDate(14);
                    //15:Parameter Modification_TimestampPersoInfo of type DateTime
                    resultItem.Modification_TimestampPersoInfo = reader.GetDate(15);
                    //16:Parameter Modification_TimestampCommunicationContact of type DateTime
                    resultItem.Modification_TimestampCommunicationContact = reader.GetDate(16);
                    //17:Parameter Modification_TimestampContactType of type DateTime
                    resultItem.Modification_TimestampContactType = reader.GetDate(17);
                    //18:Parameter CMN_PER_CommunicationContactID of type Guid
                    resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(18);
                    //19:Parameter Contact_Type of type Guid
                    resultItem.Contact_Type = reader.GetGuid(19);
                    //20:Parameter Content of type String
                    resultItem.Content = reader.GetString(20);
                    //21:Parameter IsDefaultForContactType of type bool
                    resultItem.IsDefaultForContactType = reader.GetBoolean(21);

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

            returnStatus.Result = L3_PIfT_1237_raw.Convert(results).ToArray();
            return(returnStatus);
        }
        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_CMN_BPT_STR.CMN_BPT_STR_Office_SettingsProfile.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
                _CMN_BPT_STR_Office_SettingsProfileID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_STR_Office_SettingsProfileID", 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[] { "CMN_BPT_STR_Office_SettingsProfileID", "Office_RefID", "AdulthoodAge", "RestWarningThreshold_Adults_in_mins", "RestWarningThreshold_NonAdults_in_mins", "RestMinimumThresholdl_Adults_in_mins", "RestMinimumThresholdl_NonAdults_in_mins", "WorkTimeWarningTreshold_Adults_in_mins", "WorkTimeWarningTreshold_NonAdults_in_mins", "WorkTimeMaximumTreshold_Adults_in_mins", "WorkTimeMaximumTreshold_NonAdults_in_mins", "WorkStartTimeWarning_NonAdults_in_mins", "WorkStartTimeMinimum_NonAdults_in_mins", "WorkEndTimeWarning_NonAdults_in_mins", "WorkEndTimeMaximum_NonAdults_in_mins", "WorktimeBalancePeriod_in_months", "WorkdayStart_in_mins", "RoosterGridMinimumPlanningUnit_in_mins", "MaximumPreWork_Period_in_mins", "MaximumPostWork_Period_in_mins", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter CMN_BPT_STR_Office_SettingsProfileID of type Guid
                        _CMN_BPT_STR_Office_SettingsProfileID = reader.GetGuid(0);
                        //1:Parameter Office_RefID of type Guid
                        _Office_RefID = reader.GetGuid(1);
                        //2:Parameter AdulthoodAge of type int
                        _AdulthoodAge = reader.GetInteger(2);
                        //3:Parameter RestWarningThreshold_Adults_in_mins of type int
                        _RestWarningThreshold_Adults_in_mins = reader.GetInteger(3);
                        //4:Parameter RestWarningThreshold_NonAdults_in_mins of type int
                        _RestWarningThreshold_NonAdults_in_mins = reader.GetInteger(4);
                        //5:Parameter RestMinimumThresholdl_Adults_in_mins of type int
                        _RestMinimumThresholdl_Adults_in_mins = reader.GetInteger(5);
                        //6:Parameter RestMinimumThresholdl_NonAdults_in_mins of type int
                        _RestMinimumThresholdl_NonAdults_in_mins = reader.GetInteger(6);
                        //7:Parameter WorkTimeWarningTreshold_Adults_in_mins of type int
                        _WorkTimeWarningTreshold_Adults_in_mins = reader.GetInteger(7);
                        //8:Parameter WorkTimeWarningTreshold_NonAdults_in_mins of type int
                        _WorkTimeWarningTreshold_NonAdults_in_mins = reader.GetInteger(8);
                        //9:Parameter WorkTimeMaximumTreshold_Adults_in_mins of type int
                        _WorkTimeMaximumTreshold_Adults_in_mins = reader.GetInteger(9);
                        //10:Parameter WorkTimeMaximumTreshold_NonAdults_in_mins of type int
                        _WorkTimeMaximumTreshold_NonAdults_in_mins = reader.GetInteger(10);
                        //11:Parameter WorkStartTimeWarning_NonAdults_in_mins of type int
                        _WorkStartTimeWarning_NonAdults_in_mins = reader.GetInteger(11);
                        //12:Parameter WorkStartTimeMinimum_NonAdults_in_mins of type int
                        _WorkStartTimeMinimum_NonAdults_in_mins = reader.GetInteger(12);
                        //13:Parameter WorkEndTimeWarning_NonAdults_in_mins of type int
                        _WorkEndTimeWarning_NonAdults_in_mins = reader.GetInteger(13);
                        //14:Parameter WorkEndTimeMaximum_NonAdults_in_mins of type int
                        _WorkEndTimeMaximum_NonAdults_in_mins = reader.GetInteger(14);
                        //15:Parameter WorktimeBalancePeriod_in_months of type int
                        _WorktimeBalancePeriod_in_months = reader.GetInteger(15);
                        //16:Parameter WorkdayStart_in_mins of type int
                        _WorkdayStart_in_mins = reader.GetInteger(16);
                        //17:Parameter RoosterGridMinimumPlanningUnit_in_mins of type int
                        _RoosterGridMinimumPlanningUnit_in_mins = reader.GetInteger(17);
                        //18:Parameter MaximumPreWork_Period_in_mins of type int
                        _MaximumPreWork_Period_in_mins = reader.GetInteger(18);
                        //19:Parameter MaximumPostWork_Period_in_mins of type int
                        _MaximumPostWork_Period_in_mins = reader.GetInteger(19);
                        //20:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(20);
                        //21:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(21);
                        //22:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(22);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_CMN_BPT_STR_Office_SettingsProfileID != 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 #13
0
        protected static FR_CAS_GCBDoT_1048_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_CAS_GCBDoT_1048_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "MMDocConnectDBMethods.Case.Atomic.Retrieval.SQL.cls_Get_Case_BillingData_on_Tenant.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            List <CAS_GCBDoT_1048> results = new List <CAS_GCBDoT_1048>();
            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[] { "case_id", "case_number", "bill_position_id", "gpos_id", "fs_status_key", "fs_status_code", "bill_position_number", "gpos_code", "gpos_price", "gpos_type", "hec_bill_position_id", "fs_status_id" });
                while (reader.Read())
                {
                    CAS_GCBDoT_1048 resultItem = new CAS_GCBDoT_1048();
                    //0:Parameter case_id of type Guid
                    resultItem.case_id = reader.GetGuid(0);
                    //1:Parameter case_number of type String
                    resultItem.case_number = reader.GetString(1);
                    //2:Parameter bill_position_id of type Guid
                    resultItem.bill_position_id = reader.GetGuid(2);
                    //3:Parameter gpos_id of type Guid
                    resultItem.gpos_id = reader.GetGuid(3);
                    //4:Parameter fs_status_key of type String
                    resultItem.fs_status_key = reader.GetString(4);
                    //5:Parameter fs_status_code of type int
                    resultItem.fs_status_code = reader.GetInteger(5);
                    //6:Parameter bill_position_number of type String
                    resultItem.bill_position_number = reader.GetString(6);
                    //7:Parameter gpos_code of type String
                    resultItem.gpos_code = reader.GetString(7);
                    //8:Parameter gpos_price of type double
                    resultItem.gpos_price = reader.GetDouble(8);
                    //9:Parameter gpos_type of type String
                    resultItem.gpos_type = reader.GetString(9);
                    //10:Parameter hec_bill_position_id of type Guid
                    resultItem.hec_bill_position_id = reader.GetGuid(10);
                    //11:Parameter fs_status_id of type Guid
                    resultItem.fs_status_id = reader.GetGuid(11);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
            private static List <ORM_HEC_PAT_Ki67_SpecimenAnalysis> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_PAT_Ki67_SpecimenAnalysis>    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_PAT_Ki67_SpecimenAnalysis>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_PAT_Ki67_SpecimenAnalysisID", "Analysis_Name", "AnalysisPersistedBy_Account_RefID", "Specimen_RefID", "AnalysisResults", "CellMap_Document_RefID", "MarkupNoFill_Document_RefID", "MarkupFill_Document_RefID", "IsReportCreated", "IfReportCreated_Report_Document_RefID", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_HEC_PAT_Ki67_SpecimenAnalysis item = new ORM_HEC_PAT_Ki67_SpecimenAnalysis();
                        //0:Parameter HEC_PAT_Ki67_SpecimenAnalysisID of type Guid
                        item.HEC_PAT_Ki67_SpecimenAnalysisID = reader.GetGuid(0);
                        //1:Parameter Analysis_Name of type String
                        item.Analysis_Name = reader.GetString(1);
                        //2:Parameter AnalysisPersistedBy_Account_RefID of type Guid
                        item.AnalysisPersistedBy_Account_RefID = reader.GetGuid(2);
                        //3:Parameter Specimen_RefID of type Guid
                        item.Specimen_RefID = reader.GetGuid(3);
                        //4:Parameter AnalysisResults of type String
                        item.AnalysisResults = reader.GetString(4);
                        //5:Parameter CellMap_Document_RefID of type Guid
                        item.CellMap_Document_RefID = reader.GetGuid(5);
                        //6:Parameter MarkupNoFill_Document_RefID of type Guid
                        item.MarkupNoFill_Document_RefID = reader.GetGuid(6);
                        //7:Parameter MarkupFill_Document_RefID of type Guid
                        item.MarkupFill_Document_RefID = reader.GetGuid(7);
                        //8:Parameter IsReportCreated of type Boolean
                        item.IsReportCreated = reader.GetBoolean(8);
                        //9:Parameter IfReportCreated_Report_Document_RefID of type Guid
                        item.IfReportCreated_Report_Document_RefID = reader.GetGuid(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(11);
                        //12:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(12);


                        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_L5PP_GSHDwPfS_1428_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5PP_GSHDaDOwPfS_1428 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5PP_GSHDwPfS_1428_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Zugseil_PickingPreparation.Atomic.Retrieval.SQL.cls_Get_ShippmentHeaderDetails_and_DistributionOrder_with_Positions_for_ShipmentID.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, "ShipmentHeaderID", Parameter.ShipmentHeaderID);



            List <L5PP_GSHDaDOwPfS_1428> results = new List <L5PP_GSHDaDOwPfS_1428>();
            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[] { "LOG_SHP_Shipment_HeaderID", "ShipmentHeader_Number", "LOG_SHP_Shipment_PositionID", "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Number", "CMN_PRO_Product_VariantID", "VariantName_DictID", "Quantity", "ORD_DIS_DistributionOrder_PositionID", "DistributionOrder_Header_RefID", "ORD_DIS_DistributionOrder_HeaderID", "DistributionOrderDate", "DistributionOrderNumber", "CMN_STR_CostCenterID", "Name_DictID", "CMN_STR_OfficeID", "Office_Name_DictID", "Office_InternalName", "IsShippingAddress", "IsBillingAddress", "IsSpecialAddress", "IsDefault", "CMN_AddressID", "Street_Name", "Street_Number", "City_Name", "City_PostalCode", "Country_Name", "Country_ISOCode", "ShipmentCreationDate" });
                while (reader.Read())
                {
                    L5PP_GSHDaDOwPfS_1428 resultItem = new L5PP_GSHDaDOwPfS_1428();
                    //0:Parameter LOG_SHP_Shipment_HeaderID of type Guid
                    resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(0);
                    //1:Parameter ShipmentHeader_Number of type String
                    resultItem.ShipmentHeader_Number = reader.GetString(1);
                    //2:Parameter LOG_SHP_Shipment_PositionID of type Guid
                    resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(2);
                    //3:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(3);
                    //4:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(4);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //5:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(5);
                    //6:Parameter CMN_PRO_Product_VariantID of type Guid
                    resultItem.CMN_PRO_Product_VariantID = reader.GetGuid(6);
                    //7:Parameter VariantName of type Dict
                    resultItem.VariantName             = reader.GetDictionary(7);
                    resultItem.VariantName.SourceTable = "cmn_pro_product_variants";
                    loader.Append(resultItem.VariantName);
                    //8:Parameter Quantity of type String
                    resultItem.Quantity = reader.GetString(8);
                    //9:Parameter ORD_DIS_DistributionOrder_PositionID of type Guid
                    resultItem.ORD_DIS_DistributionOrder_PositionID = reader.GetGuid(9);
                    //10:Parameter DistributionOrder_Header_RefID of type Guid
                    resultItem.DistributionOrder_Header_RefID = reader.GetGuid(10);
                    //11:Parameter ORD_DIS_DistributionOrder_HeaderID of type Guid
                    resultItem.ORD_DIS_DistributionOrder_HeaderID = reader.GetGuid(11);
                    //12:Parameter DistributionOrderDate of type DateTime
                    resultItem.DistributionOrderDate = reader.GetDate(12);
                    //13:Parameter DistributionOrderNumber of type String
                    resultItem.DistributionOrderNumber = reader.GetString(13);
                    //14:Parameter CMN_STR_CostCenterID of type Guid
                    resultItem.CMN_STR_CostCenterID = reader.GetGuid(14);
                    //15:Parameter Name of type Dict
                    resultItem.Name             = reader.GetDictionary(15);
                    resultItem.Name.SourceTable = "cmn_str_costcenters";
                    loader.Append(resultItem.Name);
                    //16:Parameter CMN_STR_OfficeID of type Guid
                    resultItem.CMN_STR_OfficeID = reader.GetGuid(16);
                    //17:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(17);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //18:Parameter Office_InternalName of type String
                    resultItem.Office_InternalName = reader.GetString(18);
                    //19:Parameter IsShippingAddress of type bool
                    resultItem.IsShippingAddress = reader.GetBoolean(19);
                    //20:Parameter IsBillingAddress of type bool
                    resultItem.IsBillingAddress = reader.GetBoolean(20);
                    //21:Parameter IsSpecialAddress of type bool
                    resultItem.IsSpecialAddress = reader.GetBoolean(21);
                    //22:Parameter IsDefault of type bool
                    resultItem.IsDefault = reader.GetBoolean(22);
                    //23:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(23);
                    //24:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(24);
                    //25:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(25);
                    //26:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(26);
                    //27:Parameter City_PostalCode of type String
                    resultItem.City_PostalCode = reader.GetString(27);
                    //28:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(28);
                    //29:Parameter Country_ISOCode of type String
                    resultItem.Country_ISOCode = reader.GetString(29);
                    //30:Parameter ShipmentCreationDate of type DateTime
                    resultItem.ShipmentCreationDate = reader.GetDate(30);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Example #16
0
            private static List <ORM_HEC_Patient_Finding> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_HEC_Patient_Finding> 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_Finding>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "HEC_Patient_FindingID", "Patient_RefID", "DateOfFindings", "MedicalPractice_RefID", "MedicalPracticeType_RefID", "UndersigningDoctor_RefID", "IsFindingFromReferral", "IfFindingFromReferral_Referral_RefID", "IsFindingFromProcedure", "IfFindingFromProcedure_ActionProcedure_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_HEC_Patient_Finding item = new ORM_HEC_Patient_Finding();
                        //0:Parameter HEC_Patient_FindingID of type Guid
                        item.HEC_Patient_FindingID = reader.GetGuid(0);
                        //1:Parameter Patient_RefID of type Guid
                        item.Patient_RefID = reader.GetGuid(1);
                        //2:Parameter DateOfFindings of type DateTime
                        item.DateOfFindings = reader.GetDate(2);
                        //3:Parameter MedicalPractice_RefID of type Guid
                        item.MedicalPractice_RefID = reader.GetGuid(3);
                        //4:Parameter MedicalPracticeType_RefID of type Guid
                        item.MedicalPracticeType_RefID = reader.GetGuid(4);
                        //5:Parameter UndersigningDoctor_RefID of type Guid
                        item.UndersigningDoctor_RefID = reader.GetGuid(5);
                        //6:Parameter IsFindingFromReferral of type Boolean
                        item.IsFindingFromReferral = reader.GetBoolean(6);
                        //7:Parameter IfFindingFromReferral_Referral_RefID of type Guid
                        item.IfFindingFromReferral_Referral_RefID = reader.GetGuid(7);
                        //8:Parameter IsFindingFromProcedure of type Boolean
                        item.IsFindingFromProcedure = reader.GetBoolean(8);
                        //9:Parameter IfFindingFromProcedure_ActionProcedure_RefID of type Guid
                        item.IfFindingFromProcedure_ActionProcedure_RefID = reader.GetGuid(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(12);
                        //13:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(13);


                        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);
            }
Example #17
0
        protected static FR_L5EM_GERTFFETF_1129 Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_GERTFFETF_1129 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5EM_GERTFFETF_1129();

            DbCommand command = Connection.CreateCommand();

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

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



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

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }
            private static List <ORM_CMN_SLS_Pricelist_Discount> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_CMN_SLS_Pricelist_Discount>       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_CMN_SLS_Pricelist_Discount>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_SLS_Pricelist_DiscountID", "PricelistVersion_RefID", "ProductGroup_RefID", "Product_RefID", "Product_Variant_RefID", "Product_Release_RefID", "DiscountPercentAmount", "DiscountValid_From", "DiscountValid_To", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    while (reader.Read())
                    {
                        ORM_CMN_SLS_Pricelist_Discount item = new ORM_CMN_SLS_Pricelist_Discount();
                        //0:Parameter CMN_SLS_Pricelist_DiscountID of type Guid
                        item.CMN_SLS_Pricelist_DiscountID = reader.GetGuid(0);
                        //1:Parameter PricelistVersion_RefID of type Guid
                        item.PricelistVersion_RefID = reader.GetGuid(1);
                        //2:Parameter ProductGroup_RefID of type Guid
                        item.ProductGroup_RefID = reader.GetGuid(2);
                        //3:Parameter Product_RefID of type Guid
                        item.Product_RefID = reader.GetGuid(3);
                        //4:Parameter Product_Variant_RefID of type Guid
                        item.Product_Variant_RefID = reader.GetGuid(4);
                        //5:Parameter Product_Release_RefID of type Guid
                        item.Product_Release_RefID = reader.GetGuid(5);
                        //6:Parameter DiscountPercentAmount of type Decimal
                        item.DiscountPercentAmount = reader.GetDecimal(6);
                        //7:Parameter DiscountValid_From of type DateTime
                        item.DiscountValid_From = reader.GetDate(7);
                        //8:Parameter DiscountValid_To of type DateTime
                        item.DiscountValid_To = reader.GetDate(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);


                        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);
            }
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 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_ORD_PRC.ORD_PRC_SPB_SupplierBill_Header.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
                _ORD_PRC_SPB_SupplierBill_HeaderID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ORD_PRC_SPB_SupplierBill_HeaderID", 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[] { "ORD_PRC_SPB_SupplierBill_HeaderID", "Supplier_RefID", "Currency_RefID", "SupplierBillNumber", "DateOnBill", "TotalValue_BeforeTax", "TotalValue_IncludingTax", "BillComment", "PaymentTargetDate", "CashDiscountInPercent", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter ORD_PRC_SPB_SupplierBill_HeaderID of type Guid
                        _ORD_PRC_SPB_SupplierBill_HeaderID = reader.GetGuid(0);
                        //1:Parameter Supplier_RefID of type Guid
                        _Supplier_RefID = reader.GetGuid(1);
                        //2:Parameter Currency_RefID of type Guid
                        _Currency_RefID = reader.GetGuid(2);
                        //3:Parameter SupplierBillNumber of type String
                        _SupplierBillNumber = reader.GetString(3);
                        //4:Parameter DateOnBill of type DateTime
                        _DateOnBill = reader.GetDate(4);
                        //5:Parameter TotalValue_BeforeTax of type Decimal
                        _TotalValue_BeforeTax = reader.GetDecimal(5);
                        //6:Parameter TotalValue_IncludingTax of type Decimal
                        _TotalValue_IncludingTax = reader.GetDecimal(6);
                        //7:Parameter BillComment of type String
                        _BillComment = reader.GetString(7);
                        //8:Parameter PaymentTargetDate of type DateTime
                        _PaymentTargetDate = reader.GetDate(8);
                        //9:Parameter CashDiscountInPercent of type Double
                        _CashDiscountInPercent = reader.GetDouble(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(12);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_ORD_PRC_SPB_SupplierBill_HeaderID != 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 #20
0
            private static List <ORM_CMN_CTR_Contract_Parameter> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_CMN_CTR_Contract_Parameter>       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_CMN_CTR_Contract_Parameter>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_CTR_Contract_ParameterID", "Contract_DefaultParameter_RefID", "Contract_RefID", "ParameterName", "IsStringValue", "IfStringValue_Value", "IsNumericValue", "IfNumericValue_Value", "IsBooleanValue", "IfBooleanValue_Value", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_CMN_CTR_Contract_Parameter item = new ORM_CMN_CTR_Contract_Parameter();
                        //0:Parameter CMN_CTR_Contract_ParameterID of type Guid
                        item.CMN_CTR_Contract_ParameterID = reader.GetGuid(0);
                        //1:Parameter Contract_DefaultParameter_RefID of type Guid
                        item.Contract_DefaultParameter_RefID = reader.GetGuid(1);
                        //2:Parameter Contract_RefID of type Guid
                        item.Contract_RefID = reader.GetGuid(2);
                        //3:Parameter ParameterName of type String
                        item.ParameterName = reader.GetString(3);
                        //4:Parameter IsStringValue of type Boolean
                        item.IsStringValue = reader.GetBoolean(4);
                        //5:Parameter IfStringValue_Value of type String
                        item.IfStringValue_Value = reader.GetString(5);
                        //6:Parameter IsNumericValue of type Boolean
                        item.IsNumericValue = reader.GetBoolean(6);
                        //7:Parameter IfNumericValue_Value of type double
                        item.IfNumericValue_Value = reader.GetDouble(7);
                        //8:Parameter IsBooleanValue of type Boolean
                        item.IsBooleanValue = reader.GetBoolean(8);
                        //9:Parameter IfBooleanValue_Value of type Boolean
                        item.IfBooleanValue_Value = reader.GetBoolean(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(12);
                        //13:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(13);


                        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);
            }
Example #21
0
        protected static FR_L5AR_GART_1118_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AR_GART_1118_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_VacationPlanner_Absence.Atomic.Retrieval.SQL.cls_Get_AbsenceReasons_For_Tenant.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;
            List <L5AR_GART_1118> results = new List <L5AR_GART_1118>();
            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_STA_AbsenceReasonID", "Parent_RefID", "ShortName", "ColorCode", "IsIncludedInCapacityCalculation", "IsAuthorizationRequired", "IsAllowedAbsence", "IsCarryOverEnabled", "IsDeactivated", "Creation_Timestamp", "Name_DictID", "Description_DictID", "IsLeaveTimeReducing_WorkingHours", "IsLeaveTimeReducingOverTime" });
                while (reader.Read())
                {
                    L5AR_GART_1118 resultItem = new L5AR_GART_1118();
                    //0:Parameter CMN_BPT_STA_AbsenceReasonID of type Guid
                    resultItem.CMN_BPT_STA_AbsenceReasonID = reader.GetGuid(0);
                    //1:Parameter Parent_RefID of type Guid
                    resultItem.Parent_RefID = reader.GetGuid(1);
                    //2:Parameter ShortName of type String
                    resultItem.ShortName = reader.GetString(2);
                    //3:Parameter ColorCode of type String
                    resultItem.ColorCode = reader.GetString(3);
                    //4:Parameter IsIncludedInCapacityCalculation of type bool
                    resultItem.IsIncludedInCapacityCalculation = reader.GetBoolean(4);
                    //5:Parameter IsAuthorizationRequired of type bool
                    resultItem.IsAuthorizationRequired = reader.GetBoolean(5);
                    //6:Parameter IsAllowedAbsence of type bool
                    resultItem.IsAllowedAbsence = reader.GetBoolean(6);
                    //7:Parameter IsCarryOverEnabled of type Boolean
                    resultItem.IsCarryOverEnabled = reader.GetBoolean(7);
                    //8:Parameter IsDeactivated of type Boolean
                    resultItem.IsDeactivated = reader.GetBoolean(8);
                    //9:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(9);
                    //10:Parameter ReasonName of type Dict
                    resultItem.ReasonName             = reader.GetDictionary(10);
                    resultItem.ReasonName.SourceTable = "cmn_bpt_sta_absencereasons";
                    loader.Append(resultItem.ReasonName);
                    //11:Parameter ReasonDescription of type Dict
                    resultItem.ReasonDescription             = reader.GetDictionary(11);
                    resultItem.ReasonDescription.SourceTable = "cmn_bpt_sta_absencereasons";
                    loader.Append(resultItem.ReasonDescription);
                    //12:Parameter IsLeaveTimeReducing_WorkingHours of type bool
                    resultItem.IsLeaveTimeReducing_WorkingHours = reader.GetBoolean(12);
                    //13:Parameter IsLeaveTimeReducingOverTime of type bool
                    resultItem.IsLeaveTimeReducingOverTime = reader.GetBoolean(13);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw ex;
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

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

            DbCommand command = Connection.CreateCommand();

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

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


            List <L5BH_GBFDfR_1443_raw> results = new List <L5BH_GBFDfR_1443_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[] { "VorgangsNumber", "FollowupDate", "GPOS", "FirstName", "LastName", "PositionValue_IncludingTax", "BIL_BillPositionID", "BirthDate", "FollowupPracticeID", "External_PositionType", "TCode", "CMN_PRO_ProductID", "Product_Name_DictID" });
                while (reader.Read())
                {
                    L5BH_GBFDfR_1443_raw resultItem = new L5BH_GBFDfR_1443_raw();
                    //0:Parameter VorgangsNumber of type String
                    resultItem.VorgangsNumber = reader.GetString(0);
                    //1:Parameter FollowupDate of type DateTime
                    resultItem.FollowupDate = reader.GetDate(1);
                    //2:Parameter GPOS of type String
                    resultItem.GPOS = reader.GetString(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 PositionValue_IncludingTax of type String
                    resultItem.PositionValue_IncludingTax = reader.GetString(5);
                    //6:Parameter BIL_BillPositionID of type Guid
                    resultItem.BIL_BillPositionID = reader.GetGuid(6);
                    //7:Parameter BirthDate of type DateTime
                    resultItem.BirthDate = reader.GetDate(7);
                    //8:Parameter FollowupPracticeID of type Guid
                    resultItem.FollowupPracticeID = reader.GetGuid(8);
                    //9:Parameter External_PositionType of type String
                    resultItem.External_PositionType = reader.GetString(9);
                    //10:Parameter TCode of type String
                    resultItem.TCode = reader.GetString(10);
                    //11:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(11);
                    //12:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(12);
                    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_BilledFollowupData_for_Report", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Articles.Atomic.Retrieval.SQL.cls_Get_Articles_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, "LanguageID", Parameter.LanguageID);

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

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

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

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

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

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

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

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

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

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

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

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



            List <L3AR_GAfT_0942_raw> results = new List <L3AR_GAfT_0942_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[] { "ProductName", "Product_Number", "ProductGroup", "CMN_PRO_ProductID", "PackageInfo_RefID", "ProductDistributionStatus", "ProductType_Name_DictID", "Product_Description_DictID", "Abbreviation_DictID", "Label_DictID", "IsPlaceholderArticle", "ProductITL", "UnitAmount", "UnitAmount_DisplayLabel", "UnitIsoCode", "DossageFormName", "ProducerName", "IfImportedFromExternalCatalog_CatalogSubscription_RefID", "IsProductPartOfDefaultStock", "HEC_PRO_ComponentID", "Component_Name_DictID", "Component_SimpleName", "IsActiveComponent", "HEC_SUB_SubstanceID", "SubstanceName", "ACC_TAX_TaxeID", "EconomicRegion_RefID", "TaxRate", "TaxName_DictID" });
                while (reader.Read())
                {
                    L3AR_GAfT_0942_raw resultItem = new L3AR_GAfT_0942_raw();
                    //0:Parameter ProductName of type String
                    resultItem.ProductName = reader.GetString(0);
                    //1:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(1);
                    //2:Parameter ProductGroup of type String
                    resultItem.ProductGroup = reader.GetString(2);
                    //3:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(3);
                    //4:Parameter PackageInfo_RefID of type Guid
                    resultItem.PackageInfo_RefID = reader.GetGuid(4);
                    //5:Parameter ProductDistributionStatus of type int
                    resultItem.ProductDistributionStatus = reader.GetInteger(5);
                    //6:Parameter ProductType_Name of type Dict
                    resultItem.ProductType_Name             = reader.GetDictionary(6);
                    resultItem.ProductType_Name.SourceTable = "cmn_pro_product_types";
                    loader.Append(resultItem.ProductType_Name);
                    //7:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(7);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //8:Parameter Abbreviation of type Dict
                    resultItem.Abbreviation             = reader.GetDictionary(8);
                    resultItem.Abbreviation.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation);
                    //9:Parameter Label of type Dict
                    resultItem.Label             = reader.GetDictionary(9);
                    resultItem.Label.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label);
                    //10:Parameter IsPlaceholderArticle of type bool
                    resultItem.IsPlaceholderArticle = reader.GetBoolean(10);
                    //11:Parameter ProductITL of type String
                    resultItem.ProductITL = reader.GetString(11);
                    //12:Parameter UnitAmount of type double
                    resultItem.UnitAmount = reader.GetDouble(12);
                    //13:Parameter UnitAmount_DisplayLabel of type String
                    resultItem.UnitAmount_DisplayLabel = reader.GetString(13);
                    //14:Parameter UnitIsoCode of type String
                    resultItem.UnitIsoCode = reader.GetString(14);
                    //15:Parameter DossageFormName of type string
                    resultItem.DossageFormName = reader.GetString(15);
                    //16:Parameter ProducerName of type string
                    resultItem.ProducerName = reader.GetString(16);
                    //17:Parameter IfImportedFromExternalCatalog_CatalogSubscription_RefID of type Guid
                    resultItem.IfImportedFromExternalCatalog_CatalogSubscription_RefID = reader.GetGuid(17);
                    //18:Parameter IsProductPartOfDefaultStock of type bool
                    resultItem.IsProductPartOfDefaultStock = reader.GetBoolean(18);
                    //19:Parameter HEC_PRO_ComponentID of type Guid
                    resultItem.HEC_PRO_ComponentID = reader.GetGuid(19);
                    //20:Parameter Component_Name of type Dict
                    resultItem.Component_Name             = reader.GetDictionary(20);
                    resultItem.Component_Name.SourceTable = "hec_pro_components";
                    loader.Append(resultItem.Component_Name);
                    //21:Parameter Component_SimpleName of type String
                    resultItem.Component_SimpleName = reader.GetString(21);
                    //22:Parameter IsActiveComponent of type bool
                    resultItem.IsActiveComponent = reader.GetBoolean(22);
                    //23:Parameter HEC_SUB_SubstanceID of type Guid
                    resultItem.HEC_SUB_SubstanceID = reader.GetGuid(23);
                    //24:Parameter SubstanceName of type String
                    resultItem.SubstanceName = reader.GetString(24);
                    //25:Parameter ACC_TAX_TaxeID of type Guid
                    resultItem.ACC_TAX_TaxeID = reader.GetGuid(25);
                    //26:Parameter EconomicRegion_RefID of type Guid
                    resultItem.EconomicRegion_RefID = reader.GetGuid(26);
                    //27:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(27);
                    //28:Parameter TaxName_DictID of type Dict
                    resultItem.TaxName_DictID             = reader.GetDictionary(28);
                    resultItem.TaxName_DictID.SourceTable = "acc_tax_taxes";
                    loader.Append(resultItem.TaxName_DictID);

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

            returnStatus.Result = L3AR_GAfT_0942_raw.Convert(results).ToArray();
            return(returnStatus);
        }
Example #24
0
            private static List <ORM_USR_Device_AccountCode_StatusHistory> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection     managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_USR_Device_AccountCode_StatusHistory> 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_USR_Device_AccountCode_StatusHistory>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "USR_Device_AccountCode_StatusHistoryID", "Device_AccountCode_RefID", "IsAccountCode_Active", "IsAccountCode_Revoked", "IsAccountCode_Banned", "IsAccountCode_Disabled", "IsAccountCode_Expired", "IsAccountCode_UsageLimitReached", "AccountCode_StatusComment", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_USR_Device_AccountCode_StatusHistory item = new ORM_USR_Device_AccountCode_StatusHistory();
                        //0:Parameter USR_Device_AccountCode_StatusHistoryID of type Guid
                        item.USR_Device_AccountCode_StatusHistoryID = reader.GetGuid(0);
                        //1:Parameter Device_AccountCode_RefID of type Guid
                        item.Device_AccountCode_RefID = reader.GetGuid(1);
                        //2:Parameter IsAccountCode_Active of type Boolean
                        item.IsAccountCode_Active = reader.GetBoolean(2);
                        //3:Parameter IsAccountCode_Revoked of type Boolean
                        item.IsAccountCode_Revoked = reader.GetBoolean(3);
                        //4:Parameter IsAccountCode_Banned of type Boolean
                        item.IsAccountCode_Banned = reader.GetBoolean(4);
                        //5:Parameter IsAccountCode_Disabled of type Boolean
                        item.IsAccountCode_Disabled = reader.GetBoolean(5);
                        //6:Parameter IsAccountCode_Expired of type Boolean
                        item.IsAccountCode_Expired = reader.GetBoolean(6);
                        //7:Parameter IsAccountCode_UsageLimitReached of type Boolean
                        item.IsAccountCode_UsageLimitReached = reader.GetBoolean(7);
                        //8:Parameter AccountCode_StatusComment of type String
                        item.AccountCode_StatusComment = reader.GetString(8);
                        //9:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(9);
                        //10:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(10);
                        //11:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(11);


                        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);
            }
            private static List <ORM_ORD_CUO_CustomerOrder_Position> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_ORD_CUO_CustomerOrder_Position>   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_ORD_CUO_CustomerOrder_Position>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "ORD_CUO_CustomerOrder_PositionID", "CustomerProcurementOrderPositionITL", "CustomerOrder_Header_RefID", "Position_OrdinalNumber", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "Position_Comment", "Position_Description", "Position_Unit_RefID", "Position_RequestedDateOfDelivery", "CMN_PRO_Product_Variant_RefID", "CMN_PRO_Product_RefID", "CMN_PRO_Product_Release_RefID", "IsProductReplacementAllowed", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    while (reader.Read())
                    {
                        ORM_ORD_CUO_CustomerOrder_Position item = new ORM_ORD_CUO_CustomerOrder_Position();
                        //0:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid
                        item.ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(0);
                        //1:Parameter CustomerProcurementOrderPositionITL of type String
                        item.CustomerProcurementOrderPositionITL = reader.GetString(1);
                        //2:Parameter CustomerOrder_Header_RefID of type Guid
                        item.CustomerOrder_Header_RefID = reader.GetGuid(2);
                        //3:Parameter Position_OrdinalNumber of type int
                        item.Position_OrdinalNumber = reader.GetInteger(3);
                        //4:Parameter Position_Quantity of type Double
                        item.Position_Quantity = reader.GetDouble(4);
                        //5:Parameter Position_ValuePerUnit of type Decimal
                        item.Position_ValuePerUnit = reader.GetDecimal(5);
                        //6:Parameter Position_ValueTotal of type Decimal
                        item.Position_ValueTotal = reader.GetDecimal(6);
                        //7:Parameter Position_Comment of type String
                        item.Position_Comment = reader.GetString(7);
                        //8:Parameter Position_Description of type String
                        item.Position_Description = reader.GetString(8);
                        //9:Parameter Position_Unit_RefID of type Guid
                        item.Position_Unit_RefID = reader.GetGuid(9);
                        //10:Parameter Position_RequestedDateOfDelivery of type DateTime
                        item.Position_RequestedDateOfDelivery = reader.GetDate(10);
                        //11:Parameter CMN_PRO_Product_Variant_RefID of type Guid
                        item.CMN_PRO_Product_Variant_RefID = reader.GetGuid(11);
                        //12:Parameter CMN_PRO_Product_RefID of type Guid
                        item.CMN_PRO_Product_RefID = reader.GetGuid(12);
                        //13:Parameter CMN_PRO_Product_Release_RefID of type Guid
                        item.CMN_PRO_Product_Release_RefID = reader.GetGuid(13);
                        //14:Parameter IsProductReplacementAllowed of type Boolean
                        item.IsProductReplacementAllowed = reader.GetBoolean(14);
                        //15:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(15);
                        //16:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(16);
                        //17:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(17);


                        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);
            }
Example #26
0
        protected static FR_L5AC_GDSfDID_1214_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AC_GDSfDID_1214 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AC_GDSfDID_1214_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_Actions.Atomic.Retrieval.SQL.cls_Get_DiagnosesStatistics_for_DoctorID.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]*@ListDoctorID", " IN $$ListDoctorID$$");
            CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$ListDoctorID$", Parameter.ListDoctorID);


            List <L5AC_GDSfDID_1214> results = new List <L5AC_GDSfDID_1214>();
            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[] { "PotentialDiagnosis_Name_DictID", "IfPerfomed_DateOfAction", "Office_Name_DictID", "HEC_DIA_PotentialDiagnosisID", "CMN_STR_OfficeID", "HEC_Doctor_RefID", "HEC_ACT_PerformedActionID", "IsDiagnosisNegated", "DoctorTitle", "DoctorFirstName", "DoctorLastName", "ICD10_Code" });
                while (reader.Read())
                {
                    L5AC_GDSfDID_1214 resultItem = new L5AC_GDSfDID_1214();
                    //0:Parameter PotentialDiagnosis_Name of type Dict
                    resultItem.PotentialDiagnosis_Name             = reader.GetDictionary(0);
                    resultItem.PotentialDiagnosis_Name.SourceTable = "hec_dia_potentialdiagnoses";
                    loader.Append(resultItem.PotentialDiagnosis_Name);
                    //1:Parameter IfPerfomed_DateOfAction of type DateTime
                    resultItem.IfPerfomed_DateOfAction = reader.GetDate(1);
                    //2:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(2);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //3:Parameter HEC_DIA_PotentialDiagnosisID of type Guid
                    resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(3);
                    //4:Parameter CMN_STR_OfficeID of type Guid
                    resultItem.CMN_STR_OfficeID = reader.GetGuid(4);
                    //5:Parameter HEC_Doctor_RefID of type Guid
                    resultItem.HEC_Doctor_RefID = reader.GetGuid(5);
                    //6:Parameter HEC_ACT_PerformedActionID of type Guid
                    resultItem.HEC_ACT_PerformedActionID = reader.GetGuid(6);
                    //7:Parameter IsDiagnosisNegated of type bool
                    resultItem.IsDiagnosisNegated = reader.GetBoolean(7);
                    //8:Parameter DoctorTitle of type String
                    resultItem.DoctorTitle = reader.GetString(8);
                    //9:Parameter DoctorFirstName of type String
                    resultItem.DoctorFirstName = reader.GetString(9);
                    //10:Parameter DoctorLastName of type String
                    resultItem.DoctorLastName = reader.GetString(10);
                    //11:Parameter ICD10_Code of type String
                    resultItem.ICD10_Code = reader.GetString(11);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
        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_CMN_BPT_EMP.CMN_BPT_EMP_SalaryType.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
                _CMN_BPT_EMP_SalaryTypeID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_EMP_SalaryTypeID", 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[] { "CMN_BPT_EMP_SalaryTypeID", "GlobalPropertyMatchingID", "SalaryType_Code", "SalaryType_Name_DictID", "SalaryTypeStatus", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter CMN_BPT_EMP_SalaryTypeID of type Guid
                        _CMN_BPT_EMP_SalaryTypeID = reader.GetGuid(0);
                        //1:Parameter GlobalPropertyMatchingID of type String
                        _GlobalPropertyMatchingID = reader.GetString(1);
                        //2:Parameter SalaryType_Code of type String
                        _SalaryType_Code = reader.GetString(2);
                        //3:Parameter SalaryType_Name of type Dict
                        _SalaryType_Name = reader.GetDictionary(3);
                        loader.Append(_SalaryType_Name, TableName);
                        //4:Parameter SalaryTypeStatus of type int
                        _SalaryTypeStatus = reader.GetInteger(4);
                        //5:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(5);
                        //6:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(6);
                        //7:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(7);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_CMN_BPT_EMP_SalaryTypeID != 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);
        }
        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.HEC_PotentialMedication.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_PotentialMedicationID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_PotentialMedicationID", 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_PotentialMedicationID", "IsHealthcareProduct", "HEC_Product_RefID", "IsSubstance", "IfSubstance_Strength", "IfSubstance_Unit_RefID", "HEC_SUB_Substance_RefiD", "RecommendedDosage", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter HEC_PotentialMedicationID of type Guid
                        _HEC_PotentialMedicationID = reader.GetGuid(0);
                        //1:Parameter IsHealthcareProduct of type Boolean
                        _IsHealthcareProduct = reader.GetBoolean(1);
                        //2:Parameter HEC_Product_RefID of type Guid
                        _HEC_Product_RefID = reader.GetGuid(2);
                        //3:Parameter IsSubstance of type Boolean
                        _IsSubstance = reader.GetBoolean(3);
                        //4:Parameter IfSubstance_Strength of type double
                        _IfSubstance_Strength = reader.GetDouble(4);
                        //5:Parameter IfSubstance_Unit_RefID of type Guid
                        _IfSubstance_Unit_RefID = reader.GetGuid(5);
                        //6:Parameter HEC_SUB_Substance_RefiD of type Guid
                        _HEC_SUB_Substance_RefiD = reader.GetGuid(6);
                        //7:Parameter RecommendedDosage of type String
                        _RecommendedDosage = reader.GetString(7);
                        //8:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(8);
                        //9:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(9);
                        //10:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(10);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_HEC_PotentialMedicationID != 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);
        }
        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_ACC_DUN.ACC_DUN_DunningProcess.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
                _ACC_DUN_DunningProcessID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ACC_DUN_DunningProcessID", 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[] { "ACC_DUN_DunningProcessID", "DunnedCustomer_RefID", "DunningModel_RefID", "Currency_RefID", "Current_DunningLevel_RefID", "DunnedAmount_Total", "ReachesNextDunningLevelAtDate", "IsDunningProcessClosed", "DunningProcessClosedAt_Date", "DunningProcessClosedBy_BusinessParticipnant_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter ACC_DUN_DunningProcessID of type Guid
                        _ACC_DUN_DunningProcessID = reader.GetGuid(0);
                        //1:Parameter DunnedCustomer_RefID of type Guid
                        _DunnedCustomer_RefID = reader.GetGuid(1);
                        //2:Parameter DunningModel_RefID of type Guid
                        _DunningModel_RefID = reader.GetGuid(2);
                        //3:Parameter Currency_RefID of type Guid
                        _Currency_RefID = reader.GetGuid(3);
                        //4:Parameter Current_DunningLevel_RefID of type Guid
                        _Current_DunningLevel_RefID = reader.GetGuid(4);
                        //5:Parameter DunnedAmount_Total of type Decimal
                        _DunnedAmount_Total = reader.GetDecimal(5);
                        //6:Parameter ReachesNextDunningLevelAtDate of type DateTime
                        _ReachesNextDunningLevelAtDate = reader.GetDate(6);
                        //7:Parameter IsDunningProcessClosed of type Boolean
                        _IsDunningProcessClosed = reader.GetBoolean(7);
                        //8:Parameter DunningProcessClosedAt_Date of type DateTime
                        _DunningProcessClosedAt_Date = reader.GetDate(8);
                        //9:Parameter DunningProcessClosedBy_BusinessParticipnant_RefID of type Guid
                        _DunningProcessClosedBy_BusinessParticipnant_RefID = reader.GetGuid(9);
                        //10:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(10);
                        //11:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(11);
                        //12:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(12);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_ACC_DUN_DunningProcessID != 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);
        }
        protected static FR_L5AR_GPaPfAaCID_1020_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AR_GPaPfAaCID_1020 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5AR_GPaPfAaCID_1020_Array();

            DbCommand command = Connection.CreateCommand();

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

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



            List <L5AR_GPaPfAaCID_1020> results = new List <L5AR_GPaPfAaCID_1020>();
            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[] { "Pricelist_Name_DictID", "CMN_SLS_PricelistID", "CMN_SLS_PriceID", "GlobalPropertyMatchingID", "PriceAmount", "Release_Version", "CMN_SLS_Pricelist_ReleaseID", "CMN_PRO_Product_RefID", "CMN_Currency_RefID", "IsDynamicPricingUsed", "DynamicPricingFormula_Type_RefID", "DynamicPricingFormula" });
                while (reader.Read())
                {
                    L5AR_GPaPfAaCID_1020 resultItem = new L5AR_GPaPfAaCID_1020();
                    //0:Parameter Pricelist_Name of type Dict
                    resultItem.Pricelist_Name             = reader.GetDictionary(0);
                    resultItem.Pricelist_Name.SourceTable = "cmn_sls_pricelist";
                    loader.Append(resultItem.Pricelist_Name);
                    //1:Parameter CMN_SLS_PricelistID of type Guid
                    resultItem.CMN_SLS_PricelistID = reader.GetGuid(1);
                    //2:Parameter CMN_SLS_PriceID of type Guid
                    resultItem.CMN_SLS_PriceID = reader.GetGuid(2);
                    //3:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(3);
                    //4:Parameter PriceAmount of type decimal
                    resultItem.PriceAmount = reader.GetDecimal(4);
                    //5:Parameter Release_Version of type String
                    resultItem.Release_Version = reader.GetString(5);
                    //6:Parameter CMN_SLS_Pricelist_ReleaseID of type Guid
                    resultItem.CMN_SLS_Pricelist_ReleaseID = reader.GetGuid(6);
                    //7:Parameter CMN_PRO_Product_RefID of type Guid
                    resultItem.CMN_PRO_Product_RefID = reader.GetGuid(7);
                    //8:Parameter CMN_Currency_RefID of type Guid
                    resultItem.CMN_Currency_RefID = reader.GetGuid(8);
                    //9:Parameter IsDynamicPricingUsed of type bool
                    resultItem.IsDynamicPricingUsed = reader.GetBoolean(9);
                    //10:Parameter DynamicPricingFormula_Type_RefID of type Guid
                    resultItem.DynamicPricingFormula_Type_RefID = reader.GetGuid(10);
                    //11:Parameter DynamicPricingFormula of type String
                    resultItem.DynamicPricingFormula = reader.GetString(11);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }