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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_BBV_Patient.Atomic.Retrieval.SQL.cls_Get_BBV_Patients_For_ID.sql";

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


            List <L6PA_GBBVPfID_1714_raw> results = new List <L6PA_GBBVPfID_1714_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[] { "Salutation_General", "FirstName", "LastName", "PrimaryEmail", "HealthInsurance_Number", "PatientComment", "HasFulfilledParticipationPolicyRequirements", "CMN_PER_PersonInfoID", "CMN_BPT_BusinessParticipantID", "HEC_Patient_HealthInsurancesID", "HEC_PatientID", "HEC_STU_Study_ParticipatingPatientID", "Participation_DateOfSigning", "Participation_Comment", "Content", "CMN_PER_CommunicationContactID", "Contact_Type", "Street_Number", "Street_Name", "City_Name", "City_PostalCode", "Province_Name", "SequenceNumber", "IsPrimary", "CMN_AddressID", "AssignmentID", "GlobalPropertyMatchingID", "HEC_STU_Study_PatientDocumentID", "File_Name", "File_Extension", "File_ServerLocation", "File_Size_Bytes" });
                while (reader.Read())
                {
                    L6PA_GBBVPfID_1714_raw resultItem = new L6PA_GBBVPfID_1714_raw();
                    //0:Parameter Salutation_General of type string
                    resultItem.Salutation_General = reader.GetString(0);
                    //1:Parameter FirstName of type string
                    resultItem.FirstName = reader.GetString(1);
                    //2:Parameter LastName of type string
                    resultItem.LastName = reader.GetString(2);
                    //3:Parameter PrimaryEmail of type string
                    resultItem.PrimaryEmail = reader.GetString(3);
                    //4:Parameter HealthInsurance_Number of type string
                    resultItem.HealthInsurance_Number = reader.GetString(4);
                    //5:Parameter PatientComment of type string
                    resultItem.PatientComment = reader.GetString(5);
                    //6:Parameter HasFulfilledParticipationPolicyRequirements of type bool
                    resultItem.HasFulfilledParticipationPolicyRequirements = reader.GetBoolean(6);
                    //7:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(7);
                    //8:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(8);
                    //9:Parameter HEC_Patient_HealthInsurancesID of type Guid
                    resultItem.HEC_Patient_HealthInsurancesID = reader.GetGuid(9);
                    //10:Parameter HEC_PatientID of type Guid
                    resultItem.HEC_PatientID = reader.GetGuid(10);
                    //11:Parameter HEC_STU_Study_ParticipatingPatientID of type Guid
                    resultItem.HEC_STU_Study_ParticipatingPatientID = reader.GetGuid(11);
                    //12:Parameter Participation_DateOfSigning of type DateTime
                    resultItem.Participation_DateOfSigning = reader.GetDate(12);
                    //13:Parameter Participation_Comment of type string
                    resultItem.Participation_Comment = reader.GetString(13);
                    //14:Parameter Content of type String
                    resultItem.Content = reader.GetString(14);
                    //15:Parameter CMN_PER_CommunicationContactID of type Guid
                    resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(15);
                    //16:Parameter Contact_Type of type Guid
                    resultItem.Contact_Type = reader.GetGuid(16);
                    //17:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(17);
                    //18:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(18);
                    //19:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(19);
                    //20:Parameter City_PostalCode of type String
                    resultItem.City_PostalCode = reader.GetString(20);
                    //21:Parameter Province_Name of type String
                    resultItem.Province_Name = reader.GetString(21);
                    //22:Parameter SequenceNumber of type int
                    resultItem.SequenceNumber = reader.GetInteger(22);
                    //23:Parameter IsPrimary of type bool
                    resultItem.IsPrimary = reader.GetBoolean(23);
                    //24:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(24);
                    //25:Parameter AssignmentID of type Guid
                    resultItem.AssignmentID = reader.GetGuid(25);
                    //26:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(26);
                    //27:Parameter HEC_STU_Study_PatientDocumentID of type Guid
                    resultItem.HEC_STU_Study_PatientDocumentID = reader.GetGuid(27);
                    //28:Parameter File_Name of type String
                    resultItem.File_Name = reader.GetString(28);
                    //29:Parameter File_Extension of type String
                    resultItem.File_Extension = reader.GetString(29);
                    //30:Parameter File_ServerLocation of type String
                    resultItem.File_ServerLocation = reader.GetString(30);
                    //31:Parameter File_Size_Bytes of type int
                    resultItem.File_Size_Bytes = reader.GetInteger(31);

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

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

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

            FR_L6PA_GBBVPfID_1714 functionReturn = new FR_L6PA_GBBVPfID_1714();

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