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

            DbCommand command = Connection.CreateCommand();

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

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



            List <L5AP_GAMDfTID_1035_raw> results = new List <L5AP_GAMDfTID_1035_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[] { "TaskTemplateName_DictID", "DisplayName", "PPS_TSK_TaskID", "Office_Name_DictID", "CMN_PER_PersonInfoID", "PatientID", "PatientFirstName", "PatientLastName", "PatientEmail", "AcademicTitle", "PlannedDuration_in_sec", "PatientBirthDay", "PlannedStartDate", "DoctorID", "DoctorFirstName", "DoctorLastName", "DoctorTitle", "DoctorFlag", "RequiredDoctorID", "RequiredDoctorFirstName", "RequiredDoctorLastName", "RequiredDoctorTitle", "RequiredDoctorFlag" });
                while (reader.Read())
                {
                    L5AP_GAMDfTID_1035_raw resultItem = new L5AP_GAMDfTID_1035_raw();
                    //0:Parameter TaskTemplateName of type Dict
                    resultItem.TaskTemplateName             = reader.GetDictionary(0);
                    resultItem.TaskTemplateName.SourceTable = "pps_tsk_task_templates";
                    loader.Append(resultItem.TaskTemplateName);
                    //1:Parameter DisplayName of type String
                    resultItem.DisplayName = reader.GetString(1);
                    //2:Parameter PPS_TSK_TaskID of type Guid
                    resultItem.PPS_TSK_TaskID = reader.GetGuid(2);
                    //3:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(3);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //4:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(4);
                    //5:Parameter PatientID of type Guid
                    resultItem.PatientID = reader.GetGuid(5);
                    //6:Parameter PatientFirstName of type String
                    resultItem.PatientFirstName = reader.GetString(6);
                    //7:Parameter PatientLastName of type String
                    resultItem.PatientLastName = reader.GetString(7);
                    //8:Parameter PatientEmail of type String
                    resultItem.PatientEmail = reader.GetString(8);
                    //9:Parameter AcademicTitle of type String
                    resultItem.AcademicTitle = reader.GetString(9);
                    //10:Parameter PlannedDuration_in_sec of type String
                    resultItem.PlannedDuration_in_sec = reader.GetString(10);
                    //11:Parameter PatientBirthDay of type DateTime
                    resultItem.PatientBirthDay = reader.GetDate(11);
                    //12:Parameter PlannedStartDate of type DateTime
                    resultItem.PlannedStartDate = reader.GetDate(12);
                    //13:Parameter DoctorID of type Guid
                    resultItem.DoctorID = reader.GetGuid(13);
                    //14:Parameter DoctorFirstName of type String
                    resultItem.DoctorFirstName = reader.GetString(14);
                    //15:Parameter DoctorLastName of type String
                    resultItem.DoctorLastName = reader.GetString(15);
                    //16:Parameter DoctorTitle of type String
                    resultItem.DoctorTitle = reader.GetString(16);
                    //17:Parameter DoctorFlag of type Guid
                    resultItem.DoctorFlag = reader.GetGuid(17);
                    //18:Parameter RequiredDoctorID of type Guid
                    resultItem.RequiredDoctorID = reader.GetGuid(18);
                    //19:Parameter RequiredDoctorFirstName of type String
                    resultItem.RequiredDoctorFirstName = reader.GetString(19);
                    //20:Parameter RequiredDoctorLastName of type String
                    resultItem.RequiredDoctorLastName = reader.GetString(20);
                    //21:Parameter RequiredDoctorTitle of type String
                    resultItem.RequiredDoctorTitle = reader.GetString(21);
                    //22:Parameter RequiredDoctorFlag of type Guid
                    resultItem.RequiredDoctorFlag = reader.GetGuid(22);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_Diagnosis.Atomic.Retrieval.SQL.cls_Get_PossibleHospitalReferral_for_DiagnosisID.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, "DiagnosisID", Parameter.DiagnosisID);



            List <L5DI_GPHRfDID_1139> results = new List <L5DI_GPHRfDID_1139>();
            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[] { "HospitalName", "ContactPersonTitle", "ContactPersonFirstName", "ContactPersonLastName", "Street_Name", "Street_Number", "Town", "Contact_Telephone", "MedicalPracticeType_Name_DictID", "PotentialDiagnosis_RefID", "HEC_DIA_FrequentPotentialDiagnosisID", "MedicalPractice_RefID" });
                while (reader.Read())
                {
                    L5DI_GPHRfDID_1139 resultItem = new L5DI_GPHRfDID_1139();
                    //0:Parameter HospitalName of type String
                    resultItem.HospitalName = reader.GetString(0);
                    //1:Parameter ContactPersonTitle of type String
                    resultItem.ContactPersonTitle = reader.GetString(1);
                    //2:Parameter ContactPersonFirstName of type String
                    resultItem.ContactPersonFirstName = reader.GetString(2);
                    //3:Parameter ContactPersonLastName of type String
                    resultItem.ContactPersonLastName = reader.GetString(3);
                    //4:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(4);
                    //5:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(5);
                    //6:Parameter Town of type String
                    resultItem.Town = reader.GetString(6);
                    //7:Parameter Contact_Telephone of type String
                    resultItem.Contact_Telephone = reader.GetString(7);
                    //8:Parameter MedicalPracticeType_Name of type Dict
                    resultItem.MedicalPracticeType_Name             = reader.GetDictionary(8);
                    resultItem.MedicalPracticeType_Name.SourceTable = "hec_medicalpractice_types";
                    loader.Append(resultItem.MedicalPracticeType_Name);
                    //9:Parameter PotentialDiagnosis_RefID of type Guid
                    resultItem.PotentialDiagnosis_RefID = reader.GetGuid(9);
                    //10:Parameter HEC_DIA_FrequentPotentialDiagnosisID of type Guid
                    resultItem.HEC_DIA_FrequentPotentialDiagnosisID = reader.GetGuid(10);
                    //11:Parameter MedicalPractice_RefID of type Guid
                    resultItem.MedicalPractice_RefID = reader.GetGuid(11);

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

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

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

            try
            {
                #region Verify/Create Connections
                //Create connection if Connection is null
                if (Connection == null)
                {
                    cleanupConnection = true;
                    Connection        = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                //If transaction is not open/not valid
                if (Transaction == null)
                {
                    cleanupTransaction = true;
                    Transaction        = Connection.BeginTransaction();
                }
                #endregion
                //Get the SelectQuerry
                string SelectQuery = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CL1_HEC_CAS.HEC_CAS_Case_Status.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_CAS_Case_StatusID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_CAS_Case_StatusID", 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_CAS_Case_StatusID", "GlobalPropertyMatchingID", "Status_Code", "Status_Name_DictID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter HEC_CAS_Case_StatusID of type Guid
                        _HEC_CAS_Case_StatusID = reader.GetGuid(0);
                        //1:Parameter GlobalPropertyMatchingID of type String
                        _GlobalPropertyMatchingID = reader.GetString(1);
                        //2:Parameter Status_Code of type int
                        _Status_Code = reader.GetInteger(2);
                        //3:Parameter Status_Name of type Dict
                        _Status_Name = reader.GetDictionary(3);
                        loader.Append(_Status_Name, TableName);
                        //4:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(4);
                        //5:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(5);
                        //6:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(6);
                        //7:Parameter Modification_Timestamp of type DateTime
                        _Modification_Timestamp = reader.GetDate(7);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_HEC_CAS_Case_StatusID != 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);
        }
Exemple #4
0
        protected static FR_L3CA_GRPfCR_1525_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3CA_GRPfCR_1525 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3CA_GRPfCR_1525_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Catalog.Atomic.Retrieval.SQL.cls_Get_Root_Products_for_Catalog_Revision.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, "CatalogRevisionID", Parameter.CatalogRevisionID);



            List <L3CA_GRPfCR_1525> results = new List <L3CA_GRPfCR_1525>();
            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_Revision_RefID", "CMN_PRO_Catalog_ProductID", "PackageContent_Amount", "Product_Name_DictID", "Product_Description_DictID", "CMN_PRO_ProductID", "Product_Number", "Label_DictID", "Abbreviation_DictID", "ISOCode", "DosageForm_Name_DictID", "DosageForm_Description_DictID", "GlobalPropertyMatchingID" });
                while (reader.Read())
                {
                    L3CA_GRPfCR_1525 resultItem = new L3CA_GRPfCR_1525();
                    //0:Parameter CMN_PRO_Catalog_Revision_RefID of type Guid
                    resultItem.CMN_PRO_Catalog_Revision_RefID = reader.GetGuid(0);
                    //1:Parameter CMN_PRO_Catalog_ProductID of type Guid
                    resultItem.CMN_PRO_Catalog_ProductID = reader.GetGuid(1);
                    //2:Parameter PackageContent_Amount of type String
                    resultItem.PackageContent_Amount = reader.GetString(2);
                    //3:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(3);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //4:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(4);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //5:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(5);
                    //6:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(6);
                    //7:Parameter Label_DictID of type Dict
                    resultItem.Label_DictID             = reader.GetDictionary(7);
                    resultItem.Label_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label_DictID);
                    //8:Parameter Abbreviation_DictID of type Dict
                    resultItem.Abbreviation_DictID             = reader.GetDictionary(8);
                    resultItem.Abbreviation_DictID.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation_DictID);
                    //9:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(9);
                    //10:Parameter DosageForm_Name_DictID of type Dict
                    resultItem.DosageForm_Name_DictID             = reader.GetDictionary(10);
                    resultItem.DosageForm_Name_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name_DictID);
                    //11:Parameter DosageForm_Description_DictID of type Dict
                    resultItem.DosageForm_Description_DictID             = reader.GetDictionary(11);
                    resultItem.DosageForm_Description_DictID.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Description_DictID);
                    //12:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(12);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_APOLogistic_ShippingOrder.Atomic.Retrieval.SQL.cls_Get_AllShippingPositions_for_PickingControlFlags_and_ShippingHeaderID.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, "ShippmentHeaderID", Parameter.ShippmentHeaderID);



            List <L6SO_GASPfPCFaSH_1202> results = new List <L6SO_GASPfPCFaSH_1202>();
            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[] { "Product_Number", "Product_Name_DictID", "Product_Description_DictID", "ISOCode", "PackageContent_Amount", "GlobalPropertyMatchingID", "DosageForm_Name_DictID", "LOG_SHP_Shipment_HeaderID", "LOG_SHP_Shipment_PositionID", "QuantityToShip", "ProducerName", "CMN_BPT_CTM_OrganizationalUnitID", "OrganizationalUnit_SimpleName", "OrganizationalUnit_Name_DictID" });
                while (reader.Read())
                {
                    L6SO_GASPfPCFaSH_1202 resultItem = new L6SO_GASPfPCFaSH_1202();
                    //0:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(0);
                    //1:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(1);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //2:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(2);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //3:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(3);
                    //4:Parameter PackageContent_Amount of type String
                    resultItem.PackageContent_Amount = reader.GetString(4);
                    //5:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(5);
                    //6:Parameter DosageForm_Name of type Dict
                    resultItem.DosageForm_Name             = reader.GetDictionary(6);
                    resultItem.DosageForm_Name.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name);
                    //7:Parameter LOG_SHP_Shipment_HeaderID of type Guid
                    resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(7);
                    //8:Parameter LOG_SHP_Shipment_PositionID of type Guid
                    resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(8);
                    //9:Parameter QuantityToShip of type Double
                    resultItem.QuantityToShip = reader.GetDouble(9);
                    //10:Parameter ProducerName of type String
                    resultItem.ProducerName = reader.GetString(10);
                    //11:Parameter CMN_BPT_CTM_OrganizationalUnitID of type Guid
                    resultItem.CMN_BPT_CTM_OrganizationalUnitID = reader.GetGuid(11);
                    //12:Parameter OrganizationalUnit_SimpleName of type String
                    resultItem.OrganizationalUnit_SimpleName = reader.GetString(12);
                    //13:Parameter OrganizationalUnit_Name of type Dict
                    resultItem.OrganizationalUnit_Name             = reader.GetDictionary(13);
                    resultItem.OrganizationalUnit_Name.SourceTable = "";
                    loader.Append(resultItem.OrganizationalUnit_Name);

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

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

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "TMS_PRO_BusinessTaskID", "IdentificationNumber", "DOC_Structure_Header_RefID", "BusinessTasksPackage_RefID", "Project_RefID", "Estimated_StartDate", "Estimated_EndDate", "Task_Name_DictID", "Task_Description_DictID", "Task_Type_RefID", "Task_Status_RefID", "Task_Deadline", "IsArchived", "CreatedByAccount_RefID", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_TMS_PRO_BusinessTask item = new ORM_TMS_PRO_BusinessTask();
                        //0:Parameter TMS_PRO_BusinessTaskID of type Guid
                        item.TMS_PRO_BusinessTaskID = reader.GetGuid(0);
                        //1:Parameter IdentificationNumber of type String
                        item.IdentificationNumber = reader.GetString(1);
                        //2:Parameter DOC_Structure_Header_RefID of type Guid
                        item.DOC_Structure_Header_RefID = reader.GetGuid(2);
                        //3:Parameter BusinessTasksPackage_RefID of type Guid
                        item.BusinessTasksPackage_RefID = reader.GetGuid(3);
                        //4:Parameter Project_RefID of type Guid
                        item.Project_RefID = reader.GetGuid(4);
                        //5:Parameter Estimated_StartDate of type DateTime
                        item.Estimated_StartDate = reader.GetDate(5);
                        //6:Parameter Estimated_EndDate of type DateTime
                        item.Estimated_EndDate = reader.GetDate(6);
                        //7:Parameter Task_Name of type Dict
                        item.Task_Name = reader.GetDictionary(7);
                        loader.Append(item.Task_Name, TableName);
                        //8:Parameter Task_Description of type Dict
                        item.Task_Description = reader.GetDictionary(8);
                        loader.Append(item.Task_Description, TableName);
                        //9:Parameter Task_Type_RefID of type Guid
                        item.Task_Type_RefID = reader.GetGuid(9);
                        //10:Parameter Task_Status_RefID of type Guid
                        item.Task_Status_RefID = reader.GetGuid(10);
                        //11:Parameter Task_Deadline of type DateTime
                        item.Task_Deadline = reader.GetDate(11);
                        //12:Parameter IsArchived of type Boolean
                        item.IsArchived = reader.GetBoolean(12);
                        //13:Parameter CreatedByAccount_RefID of type Guid
                        item.CreatedByAccount_RefID = reader.GetGuid(13);
                        //14:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(14);
                        //15:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(15);
                        //16:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(16);


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

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "TMS_PRO_DeveloperTask_PriorityID", "GlobalPropertyMatchingID", "Label_DictID", "Description_DictID", "IconLocationURL", "Priority_Colour", "Groups", "PriorityLevel", "IsPersistent", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_TMS_PRO_DeveloperTask_Priority item = new ORM_TMS_PRO_DeveloperTask_Priority();
                        //0:Parameter TMS_PRO_DeveloperTask_PriorityID of type Guid
                        item.TMS_PRO_DeveloperTask_PriorityID = reader.GetGuid(0);
                        //1:Parameter GlobalPropertyMatchingID of type String
                        item.GlobalPropertyMatchingID = reader.GetString(1);
                        //2:Parameter Label of type Dict
                        item.Label = reader.GetDictionary(2);
                        loader.Append(item.Label, TableName);
                        //3:Parameter Description of type Dict
                        item.Description = reader.GetDictionary(3);
                        loader.Append(item.Description, TableName);
                        //4:Parameter IconLocationURL of type String
                        item.IconLocationURL = reader.GetString(4);
                        //5:Parameter Priority_Colour of type String
                        item.Priority_Colour = reader.GetString(5);
                        //6:Parameter Groups of type String
                        item.Groups = reader.GetString(6);
                        //7:Parameter PriorityLevel of type int
                        item.PriorityLevel = reader.GetInteger(7);
                        //8:Parameter IsPersistent of type Boolean
                        item.IsPersistent = reader.GetBoolean(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 ex;
                }
                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_CMN_BPT_CTM.CMN_BPT_CTM_OrganizationalUnit.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_CTM_OrganizationalUnitID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CMN_BPT_CTM_OrganizationalUnitID", 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_CTM_OrganizationalUnitID", "CustomerTenant_OfficeITL", "InternalOrganizationalUnitNumber", "InternalOrganizationalUnitSimpleName", "ExternalOrganizationalUnitNumber", "Customer_RefID", "Parent_OrganizationalUnit_RefID", "OrganizationalUnit_SimpleName", "OrganizationalUnit_Name_DictID", "OrganizationalUnit_Description_DictID", "Default_PhoneNumber", "Default_FaxNumber", "DisplayImage_Document_RefID", "IsMedicalPractice", "IfMedicalPractise_HEC_MedicalPractice_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter CMN_BPT_CTM_OrganizationalUnitID of type Guid
                        _CMN_BPT_CTM_OrganizationalUnitID = reader.GetGuid(0);
                        //1:Parameter CustomerTenant_OfficeITL of type String
                        _CustomerTenant_OfficeITL = reader.GetString(1);
                        //2:Parameter InternalOrganizationalUnitNumber of type String
                        _InternalOrganizationalUnitNumber = reader.GetString(2);
                        //3:Parameter InternalOrganizationalUnitSimpleName of type String
                        _InternalOrganizationalUnitSimpleName = reader.GetString(3);
                        //4:Parameter ExternalOrganizationalUnitNumber of type String
                        _ExternalOrganizationalUnitNumber = reader.GetString(4);
                        //5:Parameter Customer_RefID of type Guid
                        _Customer_RefID = reader.GetGuid(5);
                        //6:Parameter Parent_OrganizationalUnit_RefID of type Guid
                        _Parent_OrganizationalUnit_RefID = reader.GetGuid(6);
                        //7:Parameter OrganizationalUnit_SimpleName of type String
                        _OrganizationalUnit_SimpleName = reader.GetString(7);
                        //8:Parameter OrganizationalUnit_Name of type Dict
                        _OrganizationalUnit_Name = reader.GetDictionary(8);
                        loader.Append(_OrganizationalUnit_Name, TableName);
                        //9:Parameter OrganizationalUnit_Description of type Dict
                        _OrganizationalUnit_Description = reader.GetDictionary(9);
                        loader.Append(_OrganizationalUnit_Description, TableName);
                        //10:Parameter Default_PhoneNumber of type String
                        _Default_PhoneNumber = reader.GetString(10);
                        //11:Parameter Default_FaxNumber of type String
                        _Default_FaxNumber = reader.GetString(11);
                        //12:Parameter DisplayImage_Document_RefID of type Guid
                        _DisplayImage_Document_RefID = reader.GetGuid(12);
                        //13:Parameter IsMedicalPractice of type Boolean
                        _IsMedicalPractice = reader.GetBoolean(13);
                        //14:Parameter IfMedicalPractise_HEC_MedicalPractice_RefID of type Guid
                        _IfMedicalPractise_HEC_MedicalPractice_RefID = reader.GetGuid(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);
                        //18:Parameter Modification_Timestamp of type DateTime
                        _Modification_Timestamp = reader.GetDate(18);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_CMN_BPT_CTM_OrganizationalUnitID != 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 static List <ORM_CMN_BPT_CTM_OrganizationalUnit> Search(Query query, string connectionString, DbConnection connection, DbTransaction transaction)
            {
                CSV2Core.Core.Interfaces.IManagedConnection managedConnection = new CSV2Core_MySQL.MySQLManagedConnection();
                List <ORM_CMN_BPT_CTM_OrganizationalUnit>   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_CTM_OrganizationalUnit>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_BPT_CTM_OrganizationalUnitID", "CustomerTenant_OfficeITL", "InternalOrganizationalUnitNumber", "InternalOrganizationalUnitSimpleName", "ExternalOrganizationalUnitNumber", "Customer_RefID", "Parent_OrganizationalUnit_RefID", "OrganizationalUnit_SimpleName", "OrganizationalUnit_Name_DictID", "OrganizationalUnit_Description_DictID", "Default_PhoneNumber", "Default_FaxNumber", "DisplayImage_Document_RefID", "IsMedicalPractice", "IfMedicalPractise_HEC_MedicalPractice_RefID", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_CMN_BPT_CTM_OrganizationalUnit item = new ORM_CMN_BPT_CTM_OrganizationalUnit();
                        //0:Parameter CMN_BPT_CTM_OrganizationalUnitID of type Guid
                        item.CMN_BPT_CTM_OrganizationalUnitID = reader.GetGuid(0);
                        //1:Parameter CustomerTenant_OfficeITL of type String
                        item.CustomerTenant_OfficeITL = reader.GetString(1);
                        //2:Parameter InternalOrganizationalUnitNumber of type String
                        item.InternalOrganizationalUnitNumber = reader.GetString(2);
                        //3:Parameter InternalOrganizationalUnitSimpleName of type String
                        item.InternalOrganizationalUnitSimpleName = reader.GetString(3);
                        //4:Parameter ExternalOrganizationalUnitNumber of type String
                        item.ExternalOrganizationalUnitNumber = reader.GetString(4);
                        //5:Parameter Customer_RefID of type Guid
                        item.Customer_RefID = reader.GetGuid(5);
                        //6:Parameter Parent_OrganizationalUnit_RefID of type Guid
                        item.Parent_OrganizationalUnit_RefID = reader.GetGuid(6);
                        //7:Parameter OrganizationalUnit_SimpleName of type String
                        item.OrganizationalUnit_SimpleName = reader.GetString(7);
                        //8:Parameter OrganizationalUnit_Name of type Dict
                        item.OrganizationalUnit_Name = reader.GetDictionary(8);
                        loader.Append(item.OrganizationalUnit_Name, TableName);
                        //9:Parameter OrganizationalUnit_Description of type Dict
                        item.OrganizationalUnit_Description = reader.GetDictionary(9);
                        loader.Append(item.OrganizationalUnit_Description, TableName);
                        //10:Parameter Default_PhoneNumber of type String
                        item.Default_PhoneNumber = reader.GetString(10);
                        //11:Parameter Default_FaxNumber of type String
                        item.Default_FaxNumber = reader.GetString(11);
                        //12:Parameter DisplayImage_Document_RefID of type Guid
                        item.DisplayImage_Document_RefID = reader.GetGuid(12);
                        //13:Parameter IsMedicalPractice of type Boolean
                        item.IsMedicalPractice = reader.GetBoolean(13);
                        //14:Parameter IfMedicalPractise_HEC_MedicalPractice_RefID of type Guid
                        item.IfMedicalPractise_HEC_MedicalPractice_RefID = reader.GetGuid(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);
                        //18:Parameter Modification_Timestamp of type DateTime
                        item.Modification_Timestamp = reader.GetDate(18);


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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MPC_Community.Atomic.Retrieval.SQL.cls_Get_Groups_for_BPID.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, "BPID", Parameter.BPID);



            List <L5AC_GGfBPID_1747_raw> results = new List <L5AC_GGfBPID_1747_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "HEC_CMT_CommunityGroupID", "CommunityGroup_Name_DictID", "CommunityGroup_Description_DictID", "IsPrivate", "CommunityGroupCode", "HealthcareCommunityGroupITL", "AssignmentID", "Role_GlobalPropertyMatchingID", "Role_HEC_CMT_OfferedRoleID", "HEC_CMT_GroupSubscription_RequestID", "Request_GlobalPropertyMatchingID", "Request_HEC_CMT_OfferedRoleID" });
                while (reader.Read())
                {
                    L5AC_GGfBPID_1747_raw resultItem = new L5AC_GGfBPID_1747_raw();
                    //0:Parameter HEC_CMT_CommunityGroupID of type Guid
                    resultItem.HEC_CMT_CommunityGroupID = reader.GetGuid(0);
                    //1:Parameter CommunityGroup_Name of type Dict
                    resultItem.CommunityGroup_Name             = reader.GetDictionary(1);
                    resultItem.CommunityGroup_Name.SourceTable = "hec_cmt_communitygroups";
                    loader.Append(resultItem.CommunityGroup_Name);
                    //2:Parameter CommunityGroup_Description of type Dict
                    resultItem.CommunityGroup_Description             = reader.GetDictionary(2);
                    resultItem.CommunityGroup_Description.SourceTable = "hec_cmt_communitygroups";
                    loader.Append(resultItem.CommunityGroup_Description);
                    //3:Parameter IsPrivate of type bool
                    resultItem.IsPrivate = reader.GetBoolean(3);
                    //4:Parameter CommunityGroupCode of type string
                    resultItem.CommunityGroupCode = reader.GetString(4);
                    //5:Parameter HealthcareCommunityGroupITL of type string
                    resultItem.HealthcareCommunityGroupITL = reader.GetString(5);
                    //6:Parameter AssignmentID of type Guid
                    resultItem.AssignmentID = reader.GetGuid(6);
                    //7:Parameter Role_GlobalPropertyMatchingID of type string
                    resultItem.Role_GlobalPropertyMatchingID = reader.GetString(7);
                    //8:Parameter Role_HEC_CMT_OfferedRoleID of type Guid
                    resultItem.Role_HEC_CMT_OfferedRoleID = reader.GetGuid(8);
                    //9:Parameter HEC_CMT_GroupSubscription_RequestID of type Guid
                    resultItem.HEC_CMT_GroupSubscription_RequestID = reader.GetGuid(9);
                    //10:Parameter Request_GlobalPropertyMatchingID of type string
                    resultItem.Request_GlobalPropertyMatchingID = reader.GetString(10);
                    //11:Parameter Request_HEC_CMT_OfferedRoleID of type Guid
                    resultItem.Request_HEC_CMT_OfferedRoleID = reader.GetGuid(11);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOAdmin_Catalogs.Atomic.Retrieval.SQL.cls_Get_AllCatalogsProducts_for_RevisionID.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, "RevisionID", Parameter.RevisionID);



            List <L5CA_GACPfR_1558> results = new List <L5CA_GACPfR_1558>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "CMN_PRO_ProductID", "HEC_ProductID", "ProductITL", "Product_Name_DictID", "Product_Number", "Product_Description_DictID", "ISOCode", "PackageContent_DisplayLabel", "DosageForm", "TaxRate", "Producer_DisplayName", "ProductDistributionStatus", "IsStorage_CoolingRequired", "DefaultExpirationPeriod_in_sec", "DefaultStorageTemperature_max_in_kelvin", "DefaultStorageTemperature_min_in_kelvin", "IsProduct_AddictiveDrug", "ProductAdditionalInfoXML" });
                while (reader.Read())
                {
                    L5CA_GACPfR_1558 resultItem = new L5CA_GACPfR_1558();
                    //0:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(0);
                    //1:Parameter HEC_ProductID of type Guid
                    resultItem.HEC_ProductID = reader.GetGuid(1);
                    //2:Parameter ProductITL of type String
                    resultItem.ProductITL = reader.GetString(2);
                    //3:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(3);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //4:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(4);
                    //5:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(5);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //6:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(6);
                    //7:Parameter PackageContent_DisplayLabel of type String
                    resultItem.PackageContent_DisplayLabel = reader.GetString(7);
                    //8:Parameter DosageForm of type String
                    resultItem.DosageForm = reader.GetString(8);
                    //9:Parameter TaxRate of type Decimal
                    resultItem.TaxRate = reader.GetDecimal(9);
                    //10:Parameter Producer_DisplayName of type String
                    resultItem.Producer_DisplayName = reader.GetString(10);
                    //11:Parameter ProductDistributionStatus of type int
                    resultItem.ProductDistributionStatus = reader.GetInteger(11);
                    //12:Parameter IsStorage_CoolingRequired of type bool
                    resultItem.IsStorage_CoolingRequired = reader.GetBoolean(12);
                    //13:Parameter DefaultExpirationPeriod_in_sec of type long
                    resultItem.DefaultExpirationPeriod_in_sec = reader.GetLong(13);
                    //14:Parameter DefaultStorageTemperature_max_in_kelvin of type Double
                    resultItem.DefaultStorageTemperature_max_in_kelvin = reader.GetDouble(14);
                    //15:Parameter DefaultStorageTemperature_min_in_kelvin of type Double
                    resultItem.DefaultStorageTemperature_min_in_kelvin = reader.GetDouble(15);
                    //16:Parameter IsProduct_AddictiveDrug of type bool
                    resultItem.IsProduct_AddictiveDrug = reader.GetBoolean(16);
                    //17:Parameter ProductAdditionalInfoXML of type String
                    resultItem.ProductAdditionalInfoXML = reader.GetString(17);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_OrgUnits.Atomic.Retrieval.SQL.cls_Get_OrgUnit_WorktimeExceptions_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 <L5OU_GOWEfTID_1156> results = new List <L5OU_GOWEfTID_1156>();
            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[] { "IsRepetitive", "IsWholeDayEvent", "StartTime", "EndTime", "IsDaily", "IsWeekly", "IsMonthly", "IsYearly", "Office_Name_DictID", "Description" });
                while (reader.Read())
                {
                    L5OU_GOWEfTID_1156 resultItem = new L5OU_GOWEfTID_1156();
                    //0:Parameter IsRepetitive of type bool
                    resultItem.IsRepetitive = reader.GetBoolean(0);
                    //1:Parameter IsWholeDayEvent of type bool
                    resultItem.IsWholeDayEvent = reader.GetBoolean(1);
                    //2:Parameter StartTime of type DateTime
                    resultItem.StartTime = reader.GetDate(2);
                    //3:Parameter EndTime of type DateTime
                    resultItem.EndTime = reader.GetDate(3);
                    //4:Parameter IsDaily of type bool
                    resultItem.IsDaily = reader.GetBoolean(4);
                    //5:Parameter IsWeekly of type bool
                    resultItem.IsWeekly = reader.GetBoolean(5);
                    //6:Parameter IsMonthly of type bool
                    resultItem.IsMonthly = reader.GetBoolean(6);
                    //7:Parameter IsYearly of type bool
                    resultItem.IsYearly = reader.GetBoolean(7);
                    //8:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(8);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //9:Parameter Description of type String
                    resultItem.Description = reader.GetString(9);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Exemple #13
0
        protected static FR_L5DD_GFSIfRID_1438_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DD_GFSIfRID_1438 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5DD_GFSIfRID_1438_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_KPRS_DueDiligences.Atomic.Retrieval.SQL.cls_Get_FacadeSubmisionInfo_For_RevisionID.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, "RevisionID", Parameter.RevisionID);

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

            if (Parameter.BuildingPartID_IsSpecified == false)
            {
                var regex = new System.Text.RegularExpressions.Regex(@"((and|or)\s*)?(\w*\.)?\w*\s*(=|like|<|>)\s*@BuildingPartID", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                command.CommandText = regex.Replace(command.CommandText, "");
            }


            List <L5DD_GFSIfRID_1438_raw> results = new List <L5DD_GFSIfRID_1438_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "RES_STR_FacadeID", "Facade_DocumentHeader_RefID", "Facade_Comment", "AverageRating_RefID", "RES_BLD_Facade_RefID", "RES_STR_Facade_PropertyAssessmentID", "DocumentHeader_RefID", "Rating_RefID", "GlobalPropertyMatchingID", "RES_STR_Facade_PropertyID", "PropertyAssessment_Comment", "SelectedActionVersion_RefID", "Action_PricePerUnit_RefID", "Action_UnitAmount", "Action_Unit_RefID", "RES_STR_Facade_RequiredActionID", "IfCustom_Description", "IfCustom_Name", "IsCustom", "Action_Timeframe_RefID", "RequiredActions_Comment", "EffectivePrice_RefID", "Action_Name_DictID", "PriceValue_Amount" });
                while (reader.Read())
                {
                    L5DD_GFSIfRID_1438_raw resultItem = new L5DD_GFSIfRID_1438_raw();
                    //0:Parameter RES_STR_FacadeID of type Guid
                    resultItem.RES_STR_FacadeID = reader.GetGuid(0);
                    //1:Parameter Facade_DocumentHeader_RefID of type Guid
                    resultItem.Facade_DocumentHeader_RefID = reader.GetGuid(1);
                    //2:Parameter Facade_Comment of type String
                    resultItem.Facade_Comment = reader.GetString(2);
                    //3:Parameter AverageRating_RefID of type Guid
                    resultItem.AverageRating_RefID = reader.GetGuid(3);
                    //4:Parameter RES_BLD_Facade_RefID of type Guid
                    resultItem.RES_BLD_Facade_RefID = reader.GetGuid(4);
                    //5:Parameter RES_STR_Facade_PropertyAssessmentID of type Guid
                    resultItem.RES_STR_Facade_PropertyAssessmentID = reader.GetGuid(5);
                    //6:Parameter DocumentHeader_RefID of type Guid
                    resultItem.DocumentHeader_RefID = reader.GetGuid(6);
                    //7:Parameter Rating_RefID of type Guid
                    resultItem.Rating_RefID = reader.GetGuid(7);
                    //8:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(8);
                    //9:Parameter RES_STR_Facade_PropertyID of type Guid
                    resultItem.RES_STR_Facade_PropertyID = reader.GetGuid(9);
                    //10:Parameter PropertyAssessment_Comment of type String
                    resultItem.PropertyAssessment_Comment = reader.GetString(10);
                    //11:Parameter SelectedActionVersion_RefID of type Guid
                    resultItem.SelectedActionVersion_RefID = reader.GetGuid(11);
                    //12:Parameter Action_PricePerUnit_RefID of type Guid
                    resultItem.Action_PricePerUnit_RefID = reader.GetGuid(12);
                    //13:Parameter Action_UnitAmount of type double
                    resultItem.Action_UnitAmount = reader.GetDouble(13);
                    //14:Parameter Action_Unit_RefID of type Guid
                    resultItem.Action_Unit_RefID = reader.GetGuid(14);
                    //15:Parameter RES_STR_Facade_RequiredActionID of type Guid
                    resultItem.RES_STR_Facade_RequiredActionID = reader.GetGuid(15);
                    //16:Parameter IfCustom_Description of type String
                    resultItem.IfCustom_Description = reader.GetString(16);
                    //17:Parameter IfCustom_Name of type String
                    resultItem.IfCustom_Name = reader.GetString(17);
                    //18:Parameter IsCustom of type bool
                    resultItem.IsCustom = reader.GetBoolean(18);
                    //19:Parameter Action_Timeframe_RefID of type Guid
                    resultItem.Action_Timeframe_RefID = reader.GetGuid(19);
                    //20:Parameter RequiredActions_Comment of type String
                    resultItem.RequiredActions_Comment = reader.GetString(20);
                    //21:Parameter EffectivePrice_RefID of type Guid
                    resultItem.EffectivePrice_RefID = reader.GetGuid(21);
                    //22:Parameter Action_Name of type Dict
                    resultItem.Action_Name             = reader.GetDictionary(22);
                    resultItem.Action_Name.SourceTable = "res_act_action_version";
                    loader.Append(resultItem.Action_Name);
                    //23:Parameter PriceValue_Amount of type double
                    resultItem.PriceValue_Amount = reader.GetDouble(23);

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

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

            DbCommand command = Connection.CreateCommand();

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



            List <L3CA_GCaRfC_1249_raw> results = new List <L3CA_GCaRfC_1249_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_PRO_CatalogID", "Catalog_Currency_RefID", "Catalog_Language_RefID", "IsPublicCatalog", "CatalogCodeITL", "Catalog_Name_DictID", "CMN_PRO_Catalog_RevisionID", "Valid_From", "Valid_Through", "PublishedBy_BusinessParticipant_RefID", "Default_PricelistRelease_RefID", "PublishedOn_Date", "CatalogRevision_Name", "CatalogRevision_Description", "RevisionNumber" });
                while (reader.Read())
                {
                    L3CA_GCaRfC_1249_raw resultItem = new L3CA_GCaRfC_1249_raw();
                    //0:Parameter CMN_PRO_CatalogID of type Guid
                    resultItem.CMN_PRO_CatalogID = reader.GetGuid(0);
                    //1:Parameter Catalog_Currency_RefID of type Guid
                    resultItem.Catalog_Currency_RefID = reader.GetGuid(1);
                    //2:Parameter Catalog_Language_RefID of type Guid
                    resultItem.Catalog_Language_RefID = reader.GetGuid(2);
                    //3:Parameter IsPublicCatalog of type bool
                    resultItem.IsPublicCatalog = reader.GetBoolean(3);
                    //4:Parameter CatalogCodeITL of type String
                    resultItem.CatalogCodeITL = reader.GetString(4);
                    //5:Parameter Catalog_Name of type Dict
                    resultItem.Catalog_Name             = reader.GetDictionary(5);
                    resultItem.Catalog_Name.SourceTable = "cmn_pro_mastercatalogs";
                    loader.Append(resultItem.Catalog_Name);
                    //6:Parameter CMN_PRO_Catalog_RevisionID of type Guid
                    resultItem.CMN_PRO_Catalog_RevisionID = reader.GetGuid(6);
                    //7:Parameter Valid_From of type DateTime
                    resultItem.Valid_From = reader.GetDate(7);
                    //8:Parameter Valid_Through of type DateTime
                    resultItem.Valid_Through = reader.GetDate(8);
                    //9:Parameter PublishedBy_BusinessParticipant_RefID of type Guid
                    resultItem.PublishedBy_BusinessParticipant_RefID = reader.GetGuid(9);
                    //10:Parameter Default_PricelistRelease_RefID of type Guid
                    resultItem.Default_PricelistRelease_RefID = reader.GetGuid(10);
                    //11:Parameter PublishedOn_Date of type DateTime
                    resultItem.PublishedOn_Date = reader.GetDate(11);
                    //12:Parameter CatalogRevision_Name of type String
                    resultItem.CatalogRevision_Name = reader.GetString(12);
                    //13:Parameter CatalogRevision_Description of type String
                    resultItem.CatalogRevision_Description = reader.GetString(13);
                    //14:Parameter RevisionNumber of type int
                    resultItem.RevisionNumber = reader.GetInteger(14);

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

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

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

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

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

                    items = new List <ORM_RES_ACT_Action_Version>();

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "RES_ACT_Action_VersionID", "Action_RefID", "Action_Name_DictID", "Action_Description_DictID", "Action_Version", "Default_PricePerUnit_RefID", "Default_Unit_RefID", "Default_UnitAmount", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    while (reader.Read())
                    {
                        ORM_RES_ACT_Action_Version item = new ORM_RES_ACT_Action_Version();
                        //0:Parameter RES_ACT_Action_VersionID of type Guid
                        item.RES_ACT_Action_VersionID = reader.GetGuid(0);
                        //1:Parameter Action_RefID of type Guid
                        item.Action_RefID = reader.GetGuid(1);
                        //2:Parameter Action_Name of type Dict
                        item.Action_Name = reader.GetDictionary(2);
                        loader.Append(item.Action_Name, TableName);
                        //3:Parameter Action_Description of type Dict
                        item.Action_Description = reader.GetDictionary(3);
                        loader.Append(item.Action_Description, TableName);
                        //4:Parameter Action_Version of type int
                        item.Action_Version = reader.GetInteger(4);
                        //5:Parameter Default_PricePerUnit_RefID of type Guid
                        item.Default_PricePerUnit_RefID = reader.GetGuid(5);
                        //6:Parameter Default_Unit_RefID of type Guid
                        item.Default_Unit_RefID = reader.GetGuid(6);
                        //7:Parameter Default_UnitAmount of type double
                        item.Default_UnitAmount = reader.GetDouble(7);
                        //8:Parameter Creation_Timestamp of type DateTime
                        item.Creation_Timestamp = reader.GetDate(8);
                        //9:Parameter IsDeleted of type Boolean
                        item.IsDeleted = reader.GetBoolean(9);
                        //10:Parameter Tenant_RefID of type Guid
                        item.Tenant_RefID = reader.GetGuid(10);


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

            DbCommand command = Connection.CreateCommand();

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

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



            List <CAS_GCFR_0910> results = new List <CAS_GCFR_0910>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "Patient_LastName", "Patient_FirstName", "Patient_BirthDate", "Patient_Gender", "CaseNumber", "IM_PotentialDiagnosisLocalization_Code", "IM_PotentialDiagnosis_Name", "IM_PotentialDiagnosis_Code", "IM_PotentialDiagnosisState_Name", "IM_PotentialDiagnosisCatalog_Name", "TreatmentSubmitBPName", "TreatmentPracticeName", "AfterCaseSubmitMedicalPractice", "AfterCaseSubmitResponsibleBPNAme", "Patient_RefID", "PotentialDiagnosis_RefID", "AfterCareDoctor", "SurgeryDoctor", "CaseID", "StatusID", "TreatmentCaseSubmitActionID", "afterCaseSubmitActionID", "LocalizationID", "LocalizationImID", "DiganoseImID", "Code", "Catalog_Name_DictID", "PotentialDiagnosis_Name_DictID", "CodeForType", "TreatmentDate", "AfterCareDate", "BillingCode", "StatusNumber", "PositionNumber", "IsTreatmentP", "IsAftercareP", "TreatmentPerformedDiganoseID", "AftercasePerformedDiagnoseID", "TreatmentDiagnoseUpdateIM", "AftercareDiagnoseUpdateIM", "TreatmentLocalizationID", "AftercareLocalizationID", "TreatmentLocalizationCode", "AftercareLocalizationCode", "AftercaseLocalizationIDIM", "TreatmentLocalizationIDIM", "IsPatientFeeWaived", "orderId", "orderStatusCode", "isLabelOnly", "SendInvoiceToPractice", "NumberForPayment", "DrugID", "CodeName", "IsTreatmentID", "IsAftercareID", "TreatmentPracticeID", "AftercarePracticeID", "PatientHIP", "InsuranceID", "GposID", "BillPositionID", "CaseCreationDate" });
                while (reader.Read())
                {
                    CAS_GCFR_0910 resultItem = new CAS_GCFR_0910();
                    //0:Parameter Patient_LastName of type String
                    resultItem.Patient_LastName = reader.GetString(0);
                    //1:Parameter Patient_FirstName of type String
                    resultItem.Patient_FirstName = reader.GetString(1);
                    //2:Parameter Patient_BirthDate of type DateTime
                    resultItem.Patient_BirthDate = reader.GetDate(2);
                    //3:Parameter Patient_Gender of type Double
                    resultItem.Patient_Gender = reader.GetDouble(3);
                    //4:Parameter CaseNumber of type String
                    resultItem.CaseNumber = reader.GetString(4);
                    //5:Parameter IM_PotentialDiagnosisLocalization_Code of type String
                    resultItem.IM_PotentialDiagnosisLocalization_Code = reader.GetString(5);
                    //6:Parameter IM_PotentialDiagnosis_Name of type String
                    resultItem.IM_PotentialDiagnosis_Name = reader.GetString(6);
                    //7:Parameter IM_PotentialDiagnosis_Code of type String
                    resultItem.IM_PotentialDiagnosis_Code = reader.GetString(7);
                    //8:Parameter IM_PotentialDiagnosisState_Name of type String
                    resultItem.IM_PotentialDiagnosisState_Name = reader.GetString(8);
                    //9:Parameter IM_PotentialDiagnosisCatalog_Name of type String
                    resultItem.IM_PotentialDiagnosisCatalog_Name = reader.GetString(9);
                    //10:Parameter TreatmentSubmitBPName of type String
                    resultItem.TreatmentSubmitBPName = reader.GetString(10);
                    //11:Parameter TreatmentPracticeName of type String
                    resultItem.TreatmentPracticeName = reader.GetString(11);
                    //12:Parameter AfterCaseSubmitMedicalPractice of type String
                    resultItem.AfterCaseSubmitMedicalPractice = reader.GetString(12);
                    //13:Parameter AfterCaseSubmitResponsibleBPNAme of type String
                    resultItem.AfterCaseSubmitResponsibleBPNAme = reader.GetString(13);
                    //14:Parameter Patient_RefID of type Guid
                    resultItem.Patient_RefID = reader.GetGuid(14);
                    //15:Parameter PotentialDiagnosis_RefID of type Guid
                    resultItem.PotentialDiagnosis_RefID = reader.GetGuid(15);
                    //16:Parameter AfterCareDoctor of type Guid
                    resultItem.AfterCareDoctor = reader.GetGuid(16);
                    //17:Parameter SurgeryDoctor of type Guid
                    resultItem.SurgeryDoctor = reader.GetGuid(17);
                    //18:Parameter CaseID of type Guid
                    resultItem.CaseID = reader.GetGuid(18);
                    //19:Parameter StatusID of type Guid
                    resultItem.StatusID = reader.GetGuid(19);
                    //20:Parameter TreatmentCaseSubmitActionID of type Guid
                    resultItem.TreatmentCaseSubmitActionID = reader.GetGuid(20);
                    //21:Parameter afterCaseSubmitActionID of type Guid
                    resultItem.afterCaseSubmitActionID = reader.GetGuid(21);
                    //22:Parameter LocalizationID of type Guid
                    resultItem.LocalizationID = reader.GetGuid(22);
                    //23:Parameter LocalizationImID of type Guid
                    resultItem.LocalizationImID = reader.GetGuid(23);
                    //24:Parameter DiganoseImID of type Guid
                    resultItem.DiganoseImID = reader.GetGuid(24);
                    //25:Parameter Code of type String
                    resultItem.Code = reader.GetString(25);
                    //26:Parameter Catalog_Name_DictID of type Dict
                    resultItem.Catalog_Name_DictID             = reader.GetDictionary(26);
                    resultItem.Catalog_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs";
                    loader.Append(resultItem.Catalog_Name_DictID);
                    //27:Parameter PotentialDiagnosis_Name_DictID of type Dict
                    resultItem.PotentialDiagnosis_Name_DictID             = reader.GetDictionary(27);
                    resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs";
                    loader.Append(resultItem.PotentialDiagnosis_Name_DictID);
                    //28:Parameter CodeForType of type String
                    resultItem.CodeForType = reader.GetString(28);
                    //29:Parameter TreatmentDate of type DateTime
                    resultItem.TreatmentDate = reader.GetDate(29);
                    //30:Parameter AfterCareDate of type DateTime
                    resultItem.AfterCareDate = reader.GetDate(30);
                    //31:Parameter BillingCode of type String
                    resultItem.BillingCode = reader.GetString(31);
                    //32:Parameter StatusNumber of type String
                    resultItem.StatusNumber = reader.GetString(32);
                    //33:Parameter PositionNumber of type String
                    resultItem.PositionNumber = reader.GetString(33);
                    //34:Parameter IsTreatmentP of type bool
                    resultItem.IsTreatmentP = reader.GetBoolean(34);
                    //35:Parameter IsAftercareP of type bool
                    resultItem.IsAftercareP = reader.GetBoolean(35);
                    //36:Parameter TreatmentPerformedDiganoseID of type Guid
                    resultItem.TreatmentPerformedDiganoseID = reader.GetGuid(36);
                    //37:Parameter AftercasePerformedDiagnoseID of type Guid
                    resultItem.AftercasePerformedDiagnoseID = reader.GetGuid(37);
                    //38:Parameter TreatmentDiagnoseUpdateIM of type Guid
                    resultItem.TreatmentDiagnoseUpdateIM = reader.GetGuid(38);
                    //39:Parameter AftercareDiagnoseUpdateIM of type Guid
                    resultItem.AftercareDiagnoseUpdateIM = reader.GetGuid(39);
                    //40:Parameter TreatmentLocalizationID of type Guid
                    resultItem.TreatmentLocalizationID = reader.GetGuid(40);
                    //41:Parameter AftercareLocalizationID of type Guid
                    resultItem.AftercareLocalizationID = reader.GetGuid(41);
                    //42:Parameter TreatmentLocalizationCode of type String
                    resultItem.TreatmentLocalizationCode = reader.GetString(42);
                    //43:Parameter AftercareLocalizationCode of type String
                    resultItem.AftercareLocalizationCode = reader.GetString(43);
                    //44:Parameter AftercaseLocalizationIDIM of type Guid
                    resultItem.AftercaseLocalizationIDIM = reader.GetGuid(44);
                    //45:Parameter TreatmentLocalizationIDIM of type Guid
                    resultItem.TreatmentLocalizationIDIM = reader.GetGuid(45);
                    //46:Parameter IsPatientFeeWaived of type Boolean
                    resultItem.IsPatientFeeWaived = reader.GetBoolean(46);
                    //47:Parameter orderId of type Guid
                    resultItem.orderId = reader.GetGuid(47);
                    //48:Parameter orderStatusCode of type string
                    resultItem.orderStatusCode = reader.GetString(48);
                    //49:Parameter isLabelOnly of type Boolean
                    resultItem.isLabelOnly = reader.GetBoolean(49);
                    //50:Parameter SendInvoiceToPractice of type Boolean
                    resultItem.SendInvoiceToPractice = reader.GetBoolean(50);
                    //51:Parameter NumberForPayment of type int
                    resultItem.NumberForPayment = reader.GetInteger(51);
                    //52:Parameter DrugID of type Guid
                    resultItem.DrugID = reader.GetGuid(52);
                    //53:Parameter CodeName of type String
                    resultItem.CodeName = reader.GetString(53);
                    //54:Parameter IsTreatmentID of type Guid
                    resultItem.IsTreatmentID = reader.GetGuid(54);
                    //55:Parameter IsAftercareID of type Guid
                    resultItem.IsAftercareID = reader.GetGuid(55);
                    //56:Parameter TreatmentPracticeID of type Guid
                    resultItem.TreatmentPracticeID = reader.GetGuid(56);
                    //57:Parameter AftercarePracticeID of type Guid
                    resultItem.AftercarePracticeID = reader.GetGuid(57);
                    //58:Parameter PatientHIP of type String
                    resultItem.PatientHIP = reader.GetString(58);
                    //59:Parameter InsuranceID of type String
                    resultItem.InsuranceID = reader.GetString(59);
                    //60:Parameter GposID of type Guid
                    resultItem.GposID = reader.GetGuid(60);
                    //61:Parameter BillPositionID of type Guid
                    resultItem.BillPositionID = reader.GetGuid(61);
                    //62:Parameter CaseCreationDate of type DateTime
                    resultItem.CaseCreationDate = reader.GetDate(62);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Cases_For_Report", 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_TMS_PRO.TMS_PRO_BusinessTask.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
                _TMS_PRO_BusinessTaskID = Guid.Empty;
                CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "TMS_PRO_BusinessTaskID", 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[] { "TMS_PRO_BusinessTaskID", "IdentificationNumber", "DOC_Structure_Header_RefID", "BusinessTasksPackage_RefID", "Project_RefID", "Estimated_StartDate", "Estimated_EndDate", "Task_Name_DictID", "Task_Description_DictID", "Task_Type_RefID", "Task_Status_RefID", "Task_Deadline", "IsArchived", "CreatedByAccount_RefID", "Creation_Timestamp", "IsDeleted", "Tenant_RefID" });
                    if (reader.HasRows == true)
                    {
                        reader.Read();                         //Single result only
                        //0:Parameter TMS_PRO_BusinessTaskID of type Guid
                        _TMS_PRO_BusinessTaskID = reader.GetGuid(0);
                        //1:Parameter IdentificationNumber of type String
                        _IdentificationNumber = reader.GetString(1);
                        //2:Parameter DOC_Structure_Header_RefID of type Guid
                        _DOC_Structure_Header_RefID = reader.GetGuid(2);
                        //3:Parameter BusinessTasksPackage_RefID of type Guid
                        _BusinessTasksPackage_RefID = reader.GetGuid(3);
                        //4:Parameter Project_RefID of type Guid
                        _Project_RefID = reader.GetGuid(4);
                        //5:Parameter Estimated_StartDate of type DateTime
                        _Estimated_StartDate = reader.GetDate(5);
                        //6:Parameter Estimated_EndDate of type DateTime
                        _Estimated_EndDate = reader.GetDate(6);
                        //7:Parameter Task_Name of type Dict
                        _Task_Name = reader.GetDictionary(7);
                        loader.Append(_Task_Name, TableName);
                        //8:Parameter Task_Description of type Dict
                        _Task_Description = reader.GetDictionary(8);
                        loader.Append(_Task_Description, TableName);
                        //9:Parameter Task_Type_RefID of type Guid
                        _Task_Type_RefID = reader.GetGuid(9);
                        //10:Parameter Task_Status_RefID of type Guid
                        _Task_Status_RefID = reader.GetGuid(10);
                        //11:Parameter Task_Deadline of type DateTime
                        _Task_Deadline = reader.GetDate(11);
                        //12:Parameter IsArchived of type Boolean
                        _IsArchived = reader.GetBoolean(12);
                        //13:Parameter CreatedByAccount_RefID of type Guid
                        _CreatedByAccount_RefID = reader.GetGuid(13);
                        //14:Parameter Creation_Timestamp of type DateTime
                        _Creation_Timestamp = reader.GetDate(14);
                        //15:Parameter IsDeleted of type Boolean
                        _IsDeleted = reader.GetBoolean(15);
                        //16:Parameter Tenant_RefID of type Guid
                        _Tenant_RefID = reader.GetGuid(16);
                    }
                    //Close the reader so other connections can use it
                    reader.Close();

                    loader.Load();

                    if (_TMS_PRO_BusinessTaskID != 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);
        }
Exemple #18
0
        protected static FR_L5WS_GSCfSCS_1539_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5WS_GSCfSCS_1539 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5WS_GSCfSCS_1539_Array();

            DbCommand command = Connection.CreateCommand();

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

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



            List <L5WS_GSCfSCS_1539_raw> results = new List <L5WS_GSCfSCS_1539_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "ORD_PRC_ShoppingCartID", "ShoppingCart_CreationDate", "ORD_PRC_ShoppingCart_ProductID", "CMN_PRO_Product_RefID", "Quantity", "PriceAmount", "IsProductCanceled", "IsProductDeleted", "Product_Name_DictID", "Product_Number", "TaxRate" });
                while (reader.Read())
                {
                    L5WS_GSCfSCS_1539_raw resultItem = new L5WS_GSCfSCS_1539_raw();
                    //0:Parameter ORD_PRC_ShoppingCartID of type Guid
                    resultItem.ORD_PRC_ShoppingCartID = reader.GetGuid(0);
                    //1:Parameter ShoppingCart_CreationDate of type DateTime
                    resultItem.ShoppingCart_CreationDate = reader.GetDate(1);
                    //2:Parameter ORD_PRC_ShoppingCart_ProductID of type Guid
                    resultItem.ORD_PRC_ShoppingCart_ProductID = reader.GetGuid(2);
                    //3:Parameter CMN_PRO_Product_RefID of type Guid
                    resultItem.CMN_PRO_Product_RefID = reader.GetGuid(3);
                    //4:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(4);
                    //5:Parameter PriceAmount of type double
                    resultItem.PriceAmount = reader.GetDouble(5);
                    //6:Parameter IsProductCanceled of type bool
                    resultItem.IsProductCanceled = reader.GetBoolean(6);
                    //7:Parameter IsProductDeleted of type bool
                    resultItem.IsProductDeleted = reader.GetBoolean(7);
                    //8:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(8);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //9:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(9);
                    //10:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(10);

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

            returnStatus.Result = L5WS_GSCfSCS_1539_raw.Convert(results).ToArray();
            return(returnStatus);
        }
Exemple #19
0
        protected static FR_L5LA_GPfTaPID_1234 Execute(DbConnection Connection, DbTransaction Transaction, P_L5LA_GPfTaPID_1234 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5LA_GPfTaPID_1234();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_Articles.Atomic.Retrieval.SQL.cls_Get_Products_for_TenantID_and_ProductID.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, "ProductID", Parameter.ProductID);



            List <L5LA_GPfTaPID_1234> results = new List <L5LA_GPfTaPID_1234>();
            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[] { "ArticleRecipe", "Product_Name_DictID", "Product_Number", "HEC_ProductID", "Creation_Timestamp", "Tenant_RefID", "Product_Description_DictID", "CMN_PRO_ProductID" });
                while (reader.Read())
                {
                    L5LA_GPfTaPID_1234 resultItem = new L5LA_GPfTaPID_1234();
                    //0:Parameter ArticleRecipe of type String
                    resultItem.ArticleRecipe = reader.GetString(0);
                    //1:Parameter Product_Name_DictID of type Dict
                    resultItem.Product_Name_DictID             = reader.GetDictionary(1);
                    resultItem.Product_Name_DictID.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name_DictID);
                    //2:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(2);
                    //3:Parameter HEC_ProductID of type Guid
                    resultItem.HEC_ProductID = reader.GetGuid(3);
                    //4:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(4);
                    //5:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(5);
                    //6:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(6);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //7:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(7);

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }
Exemple #20
0
        protected static FR_L5CA_GACPfR_1621_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5CA_GACPfR_1621 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5CA_GACPfR_1621_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Zugseil_Catalogs.Atomic.Retrieval.SQL.cls_Get_AllCatalogsProducts_for_RevisionID.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, "RevisionID", Parameter.RevisionID);

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

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



            List <L5CA_GACPfR_1621> results = new List <L5CA_GACPfR_1621>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Description_DictID", "Product_Number", "ProductITL", "ProductAdditionalInfoXML", "Producer_DisplayName", "CMN_BPT_BusinessParticipantID", "TaxRate", "PackageContent_DisplayLabel", "ISOCode", "PriceAmount" });
                while (reader.Read())
                {
                    L5CA_GACPfR_1621 resultItem = new L5CA_GACPfR_1621();
                    //0:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(0);
                    //1:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(1);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //2:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(2);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //3:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(3);
                    //4:Parameter ProductITL of type String
                    resultItem.ProductITL = reader.GetString(4);
                    //5:Parameter ProductAdditionalInfoXML of type String
                    resultItem.ProductAdditionalInfoXML = reader.GetString(5);
                    //6:Parameter Producer_DisplayName of type String
                    resultItem.Producer_DisplayName = reader.GetString(6);
                    //7:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(7);
                    //8:Parameter TaxRate of type String
                    resultItem.TaxRate = reader.GetString(8);
                    //9:Parameter PackageContent_DisplayLabel of type String
                    resultItem.PackageContent_DisplayLabel = reader.GetString(9);
                    //10:Parameter ISOCode of type String
                    resultItem.ISOCode = reader.GetString(10);
                    //11:Parameter PriceAmount of type Decimal
                    resultItem.PriceAmount = reader.GetDecimal(11);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Events.Atomic.Retrieval.SQL.cls_Get_EventTypes_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 <L3EV_GETFT_1059> results = new List <L3EV_GETFT_1059>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "CMN_STR_SCE_StructureCalendarEvent_TypeID", "CalendaEventName_DictID", "EventIcon_RefID", "PriorityOrdinal", "ColorCode_Foreground", "ColorCode_Background", "ColorCode_Alpha", "IsShowingNotification", "IsEventType_Imported", "IsWorkingDay", "IsHalfWorkingDay", "IsNonWorkingDay", "InternalEventTypeID" });
                while (reader.Read())
                {
                    L3EV_GETFT_1059 resultItem = new L3EV_GETFT_1059();
                    //0:Parameter CMN_STR_SCE_StructureCalendarEvent_TypeID of type Guid
                    resultItem.CMN_STR_SCE_StructureCalendarEvent_TypeID = reader.GetGuid(0);
                    //1:Parameter CalendaEventName of type Dict
                    resultItem.CalendaEventName             = reader.GetDictionary(1);
                    resultItem.CalendaEventName.SourceTable = "cmn_str_sce_structurecalendarevent_types";
                    loader.Append(resultItem.CalendaEventName);
                    //2:Parameter EventIcon_RefID of type Guid
                    resultItem.EventIcon_RefID = reader.GetGuid(2);
                    //3:Parameter PriorityOrdinal of type int
                    resultItem.PriorityOrdinal = reader.GetInteger(3);
                    //4:Parameter ColorCode_Foreground of type String
                    resultItem.ColorCode_Foreground = reader.GetString(4);
                    //5:Parameter ColorCode_Background of type String
                    resultItem.ColorCode_Background = reader.GetString(5);
                    //6:Parameter ColorCode_Alpha of type double
                    resultItem.ColorCode_Alpha = reader.GetDouble(6);
                    //7:Parameter IsShowingNotification of type bool
                    resultItem.IsShowingNotification = reader.GetBoolean(7);
                    //8:Parameter IsEventType_Imported of type bool
                    resultItem.IsEventType_Imported = reader.GetBoolean(8);
                    //9:Parameter IsWorkingDay of type bool
                    resultItem.IsWorkingDay = reader.GetBoolean(9);
                    //10:Parameter IsHalfWorkingDay of type bool
                    resultItem.IsHalfWorkingDay = reader.GetBoolean(10);
                    //11:Parameter IsNonWorkingDay of type bool
                    resultItem.IsNonWorkingDay = reader.GetBoolean(11);
                    //12:Parameter InternalEventTypeID of type String
                    resultItem.InternalEventTypeID = reader.GetString(12);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Zugseil_Product.Atomic.Retrieval.SQL.cls_Get_Products_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, "SearchCriteria", Parameter.SearchCriteria);

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

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

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


            List <L5PR_GPfT_1439_raw> results = new List <L5PR_GPfT_1439_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_PRO_ProductID", "Product_Name_DictID", "Content", "Product_Description_DictID", "Product_Number", "IsPlaceholderArticle" });
                while (reader.Read())
                {
                    L5PR_GPfT_1439_raw resultItem = new L5PR_GPfT_1439_raw();
                    //0:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(0);
                    //1:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(1);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //2:Parameter Content of type String
                    resultItem.Content = reader.GetString(2);
                    //3:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(3);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //4:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(4);
                    //5:Parameter IsPlaceholderArticle of type bool
                    resultItem.IsPlaceholderArticle = reader.GetBoolean(5);

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

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

            DbCommand command = Connection.CreateCommand();

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


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

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_Diagnosis.Atomic.Manipulation.SQL.cls_Get_AllProcedures_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;

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

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

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

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

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

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

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

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

            command.CommandText = newText;

            /***For Search**/
            string newText2 = command.CommandText.Replace("@SearchCriterium", Parameter.SearchCriterium);

            command.CommandText = newText2;

            List <L5DIGAPfTID_1318> results = new List <L5DIGAPfTID_1318>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "HEC_TRE_PotentialProcedureID", "PotentialProcedure_Name_DictID", "PotentialProcedure_Description_DictID", "Code" });
                while (reader.Read())
                {
                    L5DIGAPfTID_1318 resultItem = new L5DIGAPfTID_1318();
                    //0:Parameter HEC_TRE_PotentialProcedureID of type Guid
                    resultItem.HEC_TRE_PotentialProcedureID = reader.GetGuid(0);
                    //1:Parameter PotentialProcedure_Name of type Dict
                    resultItem.PotentialProcedure_Name             = reader.GetDictionary(1);
                    resultItem.PotentialProcedure_Name.SourceTable = "hec_tre_potentialprocedures";
                    loader.Append(resultItem.PotentialProcedure_Name);
                    //2:Parameter PotentialProcedure_Description of type Dict
                    resultItem.PotentialProcedure_Description             = reader.GetDictionary(2);
                    resultItem.PotentialProcedure_Description.SourceTable = "hec_tre_potentialprocedures";
                    loader.Append(resultItem.PotentialProcedure_Description);
                    //3:Parameter Code of type String
                    resultItem.Code = reader.GetString(3);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CLE_L3_Practice.Atomic.Retrieval.SQL.cls_Get_Practices_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 <L3MP_GPRAFT_1108> results = new List <L3MP_GPRAFT_1108>();
            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[] { "AffinityStatus_Name_DictID", "HEC_MedicalPractiseID", "Contact_EmergencyPhoneNumber", "HEC_PublicHealthcare_PhysitianAssociationID", "HealthAssociation_Name", "PracticeName", "Practice_CMN_BPT_BusinessParticipantID", "CMN_COM_CompanyInfoID", "Contact_UCD_RefID", "CMN_COM_CompanyInfo_TypeID", "CompanyType_Name_DictID", "Contact_CMN_UniversalContactDetailID", "Contact_Email", "Contact_Website_URL", "Shipping_CMN_UniversalContactDetailID", "CMN_COM_CompanyInfo_AddressID", "WeeklySurgeryHours_Template_RefID", "ContactPerson_RefID", "WeeklyOfficeHours_Template_RefID", "ContactPersonName", "ConsultingHours_FormattedOfficeHours", "WorkingHours_FormattedOfficeHours", "CMN_BPT_CTM_CustomerID", "CMN_BPT_CTM_AffinityStatusID", "ZIP", "Town", "Street_Number", "Street_Name", "Region_Name", "Street_Name1", "Street_Number1", "ZIP1", "Town1", "Region_Name1" });
                while (reader.Read())
                {
                    L3MP_GPRAFT_1108 resultItem = new L3MP_GPRAFT_1108();
                    //0:Parameter AffinityStatus_Name of type Dict
                    resultItem.AffinityStatus_Name             = reader.GetDictionary(0);
                    resultItem.AffinityStatus_Name.SourceTable = "cmn_bpt_ctm_affinitystatuses";
                    loader.Append(resultItem.AffinityStatus_Name);
                    //1:Parameter HEC_MedicalPractiseID of type Guid
                    resultItem.HEC_MedicalPractiseID = reader.GetGuid(1);
                    //2:Parameter Contact_EmergencyPhoneNumber of type String
                    resultItem.Contact_EmergencyPhoneNumber = reader.GetString(2);
                    //3:Parameter HEC_PublicHealthcare_PhysitianAssociationID of type Guid
                    resultItem.HEC_PublicHealthcare_PhysitianAssociationID = reader.GetGuid(3);
                    //4:Parameter HealthAssociation_Name of type String
                    resultItem.HealthAssociation_Name = reader.GetString(4);
                    //5:Parameter PracticeName of type String
                    resultItem.PracticeName = reader.GetString(5);
                    //6:Parameter Practice_CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.Practice_CMN_BPT_BusinessParticipantID = reader.GetGuid(6);
                    //7:Parameter CMN_COM_CompanyInfoID of type Guid
                    resultItem.CMN_COM_CompanyInfoID = reader.GetGuid(7);
                    //8:Parameter Contact_UCD_RefID of type Guid
                    resultItem.Contact_UCD_RefID = reader.GetGuid(8);
                    //9:Parameter CMN_COM_CompanyInfo_TypeID of type Guid
                    resultItem.CMN_COM_CompanyInfo_TypeID = reader.GetGuid(9);
                    //10:Parameter CompanyType_Name of type Dict
                    resultItem.CompanyType_Name             = reader.GetDictionary(10);
                    resultItem.CompanyType_Name.SourceTable = "cmn_com_companyinfo_types";
                    loader.Append(resultItem.CompanyType_Name);
                    //11:Parameter Contact_CMN_UniversalContactDetailID of type Guid
                    resultItem.Contact_CMN_UniversalContactDetailID = reader.GetGuid(11);
                    //12:Parameter Contact_Email of type String
                    resultItem.Contact_Email = reader.GetString(12);
                    //13:Parameter Contact_Website_URL of type String
                    resultItem.Contact_Website_URL = reader.GetString(13);
                    //14:Parameter Shipping_CMN_UniversalContactDetailID of type Guid
                    resultItem.Shipping_CMN_UniversalContactDetailID = reader.GetGuid(14);
                    //15:Parameter CMN_COM_CompanyInfo_AddressID of type Guid
                    resultItem.CMN_COM_CompanyInfo_AddressID = reader.GetGuid(15);
                    //16:Parameter WeeklySurgeryHours_Template_RefID of type Guid
                    resultItem.WeeklySurgeryHours_Template_RefID = reader.GetGuid(16);
                    //17:Parameter ContactPerson_RefID of type Guid
                    resultItem.ContactPerson_RefID = reader.GetGuid(17);
                    //18:Parameter WeeklyOfficeHours_Template_RefID of type Guid
                    resultItem.WeeklyOfficeHours_Template_RefID = reader.GetGuid(18);
                    //19:Parameter ContactPersonName of type String
                    resultItem.ContactPersonName = reader.GetString(19);
                    //20:Parameter ConsultingHours_FormattedOfficeHours of type String
                    resultItem.ConsultingHours_FormattedOfficeHours = reader.GetString(20);
                    //21:Parameter WorkingHours_FormattedOfficeHours of type String
                    resultItem.WorkingHours_FormattedOfficeHours = reader.GetString(21);
                    //22:Parameter CMN_BPT_CTM_CustomerID of type Guid
                    resultItem.CMN_BPT_CTM_CustomerID = reader.GetGuid(22);
                    //23:Parameter CMN_BPT_CTM_AffinityStatusID of type Guid
                    resultItem.CMN_BPT_CTM_AffinityStatusID = reader.GetGuid(23);
                    //24:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(24);
                    //25:Parameter Town of type String
                    resultItem.Town = reader.GetString(25);
                    //26:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(26);
                    //27:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(27);
                    //28:Parameter Region_Name of type String
                    resultItem.Region_Name = reader.GetString(28);
                    //29:Parameter Street_Name1 of type String
                    resultItem.Street_Name1 = reader.GetString(29);
                    //30:Parameter Street_Number1 of type String
                    resultItem.Street_Number1 = reader.GetString(30);
                    //31:Parameter ZIP1 of type String
                    resultItem.ZIP1 = reader.GetString(31);
                    //32:Parameter Town1 of type String
                    resultItem.Town1 = reader.GetString(32);
                    //33:Parameter Region_Name1 of type String
                    resultItem.Region_Name1 = reader.GetString(33);

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

                    var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());
                    reader.SetOrdinals(new string[] { "CMN_CountryID", "Default_Language_RefID", "Default_Currency_RefID", "Country_Name_DictID", "Country_ISOCode_Alpha2", "Country_ISOCode_Alpha3", "Country_ISOCode_Numeric", "IsActive", "IsDefault", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "Modification_Timestamp" });
                    while (reader.Read())
                    {
                        ORM_CMN_Country item = new ORM_CMN_Country();
                        //0:Parameter CMN_CountryID of type Guid
                        item.CMN_CountryID = reader.GetGuid(0);
                        //1:Parameter Default_Language_RefID of type Guid
                        item.Default_Language_RefID = reader.GetGuid(1);
                        //2:Parameter Default_Currency_RefID of type Guid
                        item.Default_Currency_RefID = reader.GetGuid(2);
                        //3:Parameter Country_Name of type Dict
                        item.Country_Name = reader.GetDictionary(3);
                        loader.Append(item.Country_Name, TableName);
                        //4:Parameter Country_ISOCode_Alpha2 of type String
                        item.Country_ISOCode_Alpha2 = reader.GetString(4);
                        //5:Parameter Country_ISOCode_Alpha3 of type String
                        item.Country_ISOCode_Alpha3 = reader.GetString(5);
                        //6:Parameter Country_ISOCode_Numeric of type int
                        item.Country_ISOCode_Numeric = reader.GetInteger(6);
                        //7:Parameter IsActive of type Boolean
                        item.IsActive = reader.GetBoolean(7);
                        //8:Parameter IsDefault of type Boolean
                        item.IsDefault = 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);
            }
Exemple #27
0
        protected FR_Base Save(DbConnection Connection, DbTransaction Transaction, string ConnectionString)
        {
            //Standard return type
            FR_Base retStatus = new FR_Base();

            bool cleanupConnection  = false;
            bool cleanupTransaction = false;

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


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


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

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

                #endregion

                #region Dictionary Management

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

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

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

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

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

                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_CAS_Case_StatusID", _HEC_CAS_Case_StatusID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "GlobalPropertyMatchingID", _GlobalPropertyMatchingID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Status_Code", _Status_Code);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Status_Name", _Status_Name.DictionaryID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Creation_Timestamp", _Creation_Timestamp);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant_RefID", _Tenant_RefID);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsDeleted", _IsDeleted);
                    CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Modification_Timestamp", _Modification_Timestamp);


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

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

                    //If we opened the connection we will close it
                    if (cleanupConnection && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw;
            }

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL2_BillDunning.Atomic.Retrieval.SQL.cls_Get_DunningLevels_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 <L2BD_GDLfT_1048> results = new List <L2BD_GDLfT_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[] { "ACC_DUN_Dunning_LevelID", "ParentLevel_RefID", "GlobalPropertyMatchingID", "DunningLevelName_DictID", "OrderSequence", "Default_DunningFee", "Default_Configuration", "Creation_Timestamp", "Tenant_RefID", "IsDeleted" });
                while (reader.Read())
                {
                    L2BD_GDLfT_1048 resultItem = new L2BD_GDLfT_1048();
                    //0:Parameter ACC_DUN_Dunning_LevelID of type Guid
                    resultItem.ACC_DUN_Dunning_LevelID = reader.GetGuid(0);
                    //1:Parameter ParentLevel_RefID of type Guid
                    resultItem.ParentLevel_RefID = reader.GetGuid(1);
                    //2:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(2);
                    //3:Parameter DunningLevelName_DictID of type Dict
                    resultItem.DunningLevelName_DictID             = reader.GetDictionary(3);
                    resultItem.DunningLevelName_DictID.SourceTable = "acc_dun_dunning_levels";
                    loader.Append(resultItem.DunningLevelName_DictID);
                    //4:Parameter OrderSequence of type int
                    resultItem.OrderSequence = reader.GetInteger(4);
                    //5:Parameter Default_DunningFee of type Decimal
                    resultItem.Default_DunningFee = reader.GetDecimal(5);
                    //6:Parameter Default_Configuration of type String
                    resultItem.Default_Configuration = reader.GetString(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 Boolean
                    resultItem.IsDeleted = reader.GetBoolean(9);

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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Product.Atomic.Retrieval.SQL.cls_Get_Product_with_PictureID_for_ProductID.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, "ProductID", Parameter.ProductID);



            List <L3PR_GPwPfP_1620> results = new List <L3PR_GPwPfP_1620>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Description_DictID", "Product_Number", "IsCustomizable", "Product_DocumentationStructure_RefID", "Document_RefID", "IsImportedFromExternalCatalog" });
                while (reader.Read())
                {
                    L3PR_GPwPfP_1620 resultItem = new L3PR_GPwPfP_1620();
                    //0:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(0);
                    //1:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(1);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //2:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(2);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //3:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(3);
                    //4:Parameter IsCustomizable of type bool
                    resultItem.IsCustomizable = reader.GetBoolean(4);
                    //5:Parameter Product_DocumentationStructure_RefID of type Guid
                    resultItem.Product_DocumentationStructure_RefID = reader.GetGuid(5);
                    //6:Parameter Document_RefID of type Guid
                    resultItem.Document_RefID = reader.GetGuid(6);
                    //7:Parameter IsImportedFromExternalCatalog of type Boolean
                    resultItem.IsImportedFromExternalCatalog = reader.GetBoolean(7);

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

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

            DbCommand command = Connection.CreateCommand();

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



            List <L5AP_GADfTID_1529> results = new List <L5AP_GADfTID_1529>();
            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[] { "TaskTemplateName_DictID", "DisplayName", "PlannedStartDate", "PlannedDuration_in_sec", "Office_Name_DictID", "Street_Name", "Street_Number", "City_Name" });
                while (reader.Read())
                {
                    L5AP_GADfTID_1529 resultItem = new L5AP_GADfTID_1529();
                    //0:Parameter TaskTemplateName of type Dict
                    resultItem.TaskTemplateName             = reader.GetDictionary(0);
                    resultItem.TaskTemplateName.SourceTable = "pps_tsk_task_templates";
                    loader.Append(resultItem.TaskTemplateName);
                    //1:Parameter DisplayName of type String
                    resultItem.DisplayName = reader.GetString(1);
                    //2:Parameter PlannedStartDate of type DateTime
                    resultItem.PlannedStartDate = reader.GetDate(2);
                    //3:Parameter PlannedDuration_in_sec of type String
                    resultItem.PlannedDuration_in_sec = reader.GetString(3);
                    //4:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(4);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //5:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(5);
                    //6:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(6);
                    //7:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(7);

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

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