コード例 #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L3MP_GPBIfT_1706_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L3MP_GPBIfT_1706_Array functionReturn = new FR_L3MP_GPBIfT_1706_Array();

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

                functionReturn = Execute(Connection, Transaction, 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 new Exception("Exception occured in method cls_Get_Practice_BaseInfo_For_Tenant", ex);
            }
            return(functionReturn);
        }
コード例 #2
0
        protected static FR_L3MP_GPBIfT_1706_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3MP_GPBIfT_1706_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_MedicalPractices.Atomic.Retrieval.SQL.cls_Get_Practice_BaseInfo_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_GPBIfT_1706> results = new List <L3MP_GPBIfT_1706>();
            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[] { "Street_Number", "Street_Name", "CompanyName_Line1", "PracticeName", "BSNR", "Street_Name_Line2", "PracticeEmail", "Town", "ZIP", "CMN_UniversalContactDetailID", "Contact_EmergencyPhoneNumber", "CMN_COM_CompanyInfoID", "CMN_BPT_BusinessParticipantID", "CompanyType_RefID", "AssociatedWith_PhysitianAssociation_RefID", "WeeklyOfficeHours_Template_RefID", "WeeklySurgeryHours_Template_RefID", "HEC_MedicalPractiseID", "ContactPerson_RefID", "Contact_Website_URL", "Region_Name" });
                while (reader.Read())
                {
                    L3MP_GPBIfT_1706 resultItem = new L3MP_GPBIfT_1706();
                    //0:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(0);
                    //1:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(1);
                    //2:Parameter CompanyName_Line1 of type String
                    resultItem.CompanyName_Line1 = reader.GetString(2);
                    //3:Parameter PracticeName of type String
                    resultItem.PracticeName = reader.GetString(3);
                    //4:Parameter BSNR of type String
                    resultItem.BSNR = reader.GetString(4);
                    //5:Parameter Street_Name_Line2 of type String
                    resultItem.Street_Name_Line2 = reader.GetString(5);
                    //6:Parameter PracticeEmail of type String
                    resultItem.PracticeEmail = reader.GetString(6);
                    //7:Parameter Town of type String
                    resultItem.Town = reader.GetString(7);
                    //8:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(8);
                    //9:Parameter CMN_UniversalContactDetailID of type Guid
                    resultItem.CMN_UniversalContactDetailID = reader.GetGuid(9);
                    //10:Parameter Contact_EmergencyPhoneNumber of type String
                    resultItem.Contact_EmergencyPhoneNumber = reader.GetString(10);
                    //11:Parameter CMN_COM_CompanyInfoID of type Guid
                    resultItem.CMN_COM_CompanyInfoID = reader.GetGuid(11);
                    //12:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(12);
                    //13:Parameter CompanyType_RefID of type Guid
                    resultItem.CompanyType_RefID = reader.GetGuid(13);
                    //14:Parameter AssociatedWith_PhysitianAssociation_RefID of type Guid
                    resultItem.AssociatedWith_PhysitianAssociation_RefID = reader.GetGuid(14);
                    //15:Parameter WeeklyOfficeHours_Template_RefID of type Guid
                    resultItem.WeeklyOfficeHours_Template_RefID = reader.GetGuid(15);
                    //16:Parameter WeeklySurgeryHours_Template_RefID of type Guid
                    resultItem.WeeklySurgeryHours_Template_RefID = reader.GetGuid(16);
                    //17:Parameter HEC_MedicalPractiseID of type Guid
                    resultItem.HEC_MedicalPractiseID = reader.GetGuid(17);
                    //18:Parameter ContactPerson_RefID of type Guid
                    resultItem.ContactPerson_RefID = reader.GetGuid(18);
                    //19:Parameter Contact_Website_URL of type String
                    resultItem.Contact_Website_URL = reader.GetString(19);
                    //20:Parameter Region_Name of type String
                    resultItem.Region_Name = reader.GetString(20);

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

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