Example #1
0
        protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L6PA_DBBVP_1711 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_Guid();


            P_L6PA_GBBVPfID_1714 getParam = new P_L6PA_GBBVPfID_1714();
            getParam.HEC_PatientID = Parameter.HEC_PatientID;
            var patient = cls_Get_BBV_Patients_For_ID.Invoke(Connection, Transaction, getParam, securityTicket).Result;
            if (patient != null)
            {
                if (patient.Addresses != null)
                {
                    foreach (var address in patient.Addresses)
                    {
                        P_L6PA_DBBVAFP_1703 delAddressPar = new P_L6PA_DBBVAFP_1703();
                        delAddressPar.CMN_AddressID = address.CMN_AddressID;
                        cls_Delete_BBV_AddressForPatient.Invoke(Connection, Transaction, delAddressPar, securityTicket);
                    }
                }
                if (patient.Contacts != null)
                {
                    foreach (var contact in patient.Contacts)
                    {
                        ORM_CMN_PER_CommunicationContact.Query cQuery = new ORM_CMN_PER_CommunicationContact.Query();
                        cQuery.CMN_PER_CommunicationContactID = contact.CMN_PER_CommunicationContactID;
                        cQuery.IsDeleted    = false;
                        cQuery.Tenant_RefID = securityTicket.TenantID;
                        ORM_CMN_PER_CommunicationContact.Query.SoftDelete(Connection, Transaction, cQuery);
                    }
                }

                ORM_CMN_PER_PersonInfo.Query ORM_CMN_PER_PersonInfoQuery = new ORM_CMN_PER_PersonInfo.Query();
                ORM_CMN_PER_PersonInfoQuery.CMN_PER_PersonInfoID = patient.CMN_PER_PersonInfoID;
                ORM_CMN_PER_PersonInfoQuery.IsDeleted            = false;
                ORM_CMN_PER_PersonInfoQuery.Tenant_RefID         = securityTicket.TenantID;
                ORM_CMN_PER_PersonInfo.Query.SoftDelete(Connection, Transaction, ORM_CMN_PER_PersonInfoQuery);

                ORM_CMN_BPT_BusinessParticipant.Query ORM_CMN_BPT_BusinessParticipantoQuery = new ORM_CMN_BPT_BusinessParticipant.Query();
                ORM_CMN_BPT_BusinessParticipantoQuery.CMN_BPT_BusinessParticipantID = patient.CMN_BPT_BusinessParticipantID;
                ORM_CMN_BPT_BusinessParticipantoQuery.IsDeleted    = false;
                ORM_CMN_BPT_BusinessParticipantoQuery.Tenant_RefID = securityTicket.TenantID;
                ORM_CMN_BPT_BusinessParticipant.Query.SoftDelete(Connection, Transaction, ORM_CMN_BPT_BusinessParticipantoQuery);

                ORM_HEC_Patient.Query ORM_HEC_PatientQuery = new ORM_HEC_Patient.Query();
                ORM_HEC_PatientQuery.HEC_PatientID = patient.HEC_PatientID;
                ORM_HEC_PatientQuery.IsDeleted     = false;
                ORM_HEC_PatientQuery.Tenant_RefID  = securityTicket.TenantID;
                ORM_HEC_Patient.Query.SoftDelete(Connection, Transaction, ORM_HEC_PatientQuery);

                ORM_HEC_Patient_HealthInsurance.Query ORM_HEC_Patient_HealthInsuranceoQuery = new ORM_HEC_Patient_HealthInsurance.Query();
                ORM_HEC_Patient_HealthInsuranceoQuery.HEC_Patient_HealthInsurancesID = patient.HEC_Patient_HealthInsurancesID;
                ORM_HEC_Patient_HealthInsuranceoQuery.IsDeleted    = false;
                ORM_HEC_Patient_HealthInsuranceoQuery.Tenant_RefID = securityTicket.TenantID;
                ORM_HEC_Patient_HealthInsurance.Query.SoftDelete(Connection, Transaction, ORM_HEC_Patient_HealthInsuranceoQuery);

                ORM_HEC_STU_Study_ParticipatingPatient.Query ORM_HEC_STU_Study_ParticipatingPatientQuery = new ORM_HEC_STU_Study_ParticipatingPatient.Query();
                ORM_HEC_STU_Study_ParticipatingPatientQuery.HEC_STU_Study_ParticipatingPatientID = patient.HEC_STU_Study_ParticipatingPatientID;
                ORM_HEC_STU_Study_ParticipatingPatientQuery.IsDeleted    = false;
                ORM_HEC_STU_Study_ParticipatingPatientQuery.Tenant_RefID = securityTicket.TenantID;
                ORM_HEC_STU_Study_ParticipatingPatient.Query.SoftDelete(Connection, Transaction, ORM_HEC_STU_Study_ParticipatingPatientQuery);

                var transactionsQuery = new ORM_HEC_Patient_Prescription_Transaction.Query();
                transactionsQuery.PrescriptionTransaction_Patient_RefID = patient.HEC_PatientID;
                transactionsQuery.IsDeleted = false;
                ORM_HEC_Patient_Prescription_Transaction.Query.SoftDelete(Connection, Transaction, transactionsQuery);
            }
            return(returnValue);

            #endregion UserCode
        }
Example #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, P_L6PA_DBBVP_1711 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Example #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6PA_DBBVP_1711 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Guid functionReturn = new FR_Guid();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);


                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

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

                throw ex;
            }
            return(functionReturn);
        }
Example #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_Guid Invoke(string ConnectionString, P_L6PA_DBBVP_1711 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }