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

            FR_L3_DfT_1425_Array functionReturn = new FR_L3_DfT_1425_Array();

            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 new Exception("Exception occured in method cls_Doctors_for_Tenant", ex);
            }
            return(functionReturn);
        }
Example #2
0
        protected static FR_L3_DfT_1425_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_DfT_1425 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3_DfT_1425_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Doctors.Atomic.Retrieval.SQL.cls_Doctors_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, "Tenant", Parameter.Tenant);



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

            try
            {
                reader.SetOrdinals(new string[] { "CMN_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "BirthDate", "Gender", "DefaultLanguage_RefID", "HEC_DoctorID", "Tenant_RefID", "IsDeleted", "Creation_Timestamp", "Account_RefID", "Modification_TimestampDoctors", "Modification_TimestampBpart", "Modification_TimestampPersonInfo", "AgeCalculation_YearOfBirth", "Initials", "Office_Name_DictID", "MedicalPracticeType_Name_DictID", "Default_PhoneNumber", "Street_Name", "Street_Number", "City_Name", "City_PostalCode", "Country_Name", "Modification_TimestampAdress", "Title", "Default_Email", "Default_Website", "DoctorIDNumber" });
                while (reader.Read())
                {
                    L3_DfT_1425 resultItem = new L3_DfT_1425();
                    //0:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(0);
                    //1:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(1);
                    //2:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(2);
                    //3:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(3);
                    //4:Parameter BirthDate of type DateTime
                    resultItem.BirthDate = reader.GetDate(4);
                    //5:Parameter Gender of type String
                    resultItem.Gender = reader.GetString(5);
                    //6:Parameter DefaultLanguage_RefID of type Guid
                    resultItem.DefaultLanguage_RefID = reader.GetGuid(6);
                    //7:Parameter HEC_DoctorID of type Guid
                    resultItem.HEC_DoctorID = reader.GetGuid(7);
                    //8:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(8);
                    //9:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(9);
                    //10:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(10);
                    //11:Parameter Account_RefID of type Guid
                    resultItem.Account_RefID = reader.GetGuid(11);
                    //12:Parameter Modification_TimestampDoctors of type DateTime
                    resultItem.Modification_TimestampDoctors = reader.GetDate(12);
                    //13:Parameter Modification_TimestampBpart of type DateTime
                    resultItem.Modification_TimestampBpart = reader.GetDate(13);
                    //14:Parameter Modification_TimestampPersonInfo of type DateTime
                    resultItem.Modification_TimestampPersonInfo = reader.GetDate(14);
                    //15:Parameter AgeCalculation_YearOfBirth of type int
                    resultItem.AgeCalculation_YearOfBirth = reader.GetInteger(15);
                    //16:Parameter Initials of type String
                    resultItem.Initials = reader.GetString(16);
                    //17:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(17);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //18:Parameter MedicalPracticeType_Name of type Dict
                    resultItem.MedicalPracticeType_Name             = reader.GetDictionary(18);
                    resultItem.MedicalPracticeType_Name.SourceTable = "hec_medicalpractice_types";
                    loader.Append(resultItem.MedicalPracticeType_Name);
                    //19:Parameter Default_PhoneNumber of type String
                    resultItem.Default_PhoneNumber = reader.GetString(19);
                    //20:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(20);
                    //21:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(21);
                    //22:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(22);
                    //23:Parameter City_PostalCode of type String
                    resultItem.City_PostalCode = reader.GetString(23);
                    //24:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(24);
                    //25:Parameter Modification_TimestampAdress of type DateTime
                    resultItem.Modification_TimestampAdress = reader.GetDate(25);
                    //26:Parameter Title of type String
                    resultItem.Title = reader.GetString(26);
                    //27:Parameter Default_Email of type String
                    resultItem.Default_Email = reader.GetString(27);
                    //28:Parameter Default_Website of type String
                    resultItem.Default_Website = reader.GetString(28);
                    //29:Parameter DoctorIDNumber of type String
                    resultItem.DoctorIDNumber = reader.GetString(29);

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

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