///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DO_GDaSaDfT_1613_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DO_GDaSaDfT_1613_Array functionReturn = new FR_L5DO_GDaSaDfT_1613_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_Doctors_and_Staff_allData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L5DO_GDaSaDfT_1613_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DO_GDaSaDfT_1613_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_DoctorsAndStaff.Atomic.Retrieval.SQL.cls_Get_Doctors_and_Staff_allData_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 <L5DO_GDaSaDfT_1613_raw> results = new List <L5DO_GDaSaDfT_1613_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_BPT_BusinessParticipantID", "CMN_BPT_EMP_EmployeeID", "DisplayName", "FirstName", "LastName", "Gender", "IsTreatingChildren", "PrimaryEmail", "Initials", "Title", "DoctorIDNumber", "Staff_Number", "hasOpeningTime", "ProfessionName_DictID", "DisplayImage_RefID", "CMN_BPT_BusinessParticipant_ExcludedAvailabilityTypeID", "Account_RefID", "CMN_STR_OfficeID", "Office_Name_DictID", "Office_InternalNumber", "Name_DictID", "CMN_LanguageID", "CMN_STR_SkillID", "Skill_Name_DictID", "PPS_TSK_Task_TemplateID", "TaskTemplateName_DictID", "CMN_STR_ProfessionID", "IsPrimary", "CMN_PER_CommunicationContact_TypeID", "Type", "Content" }); while (reader.Read()) { L5DO_GDaSaDfT_1613_raw resultItem = new L5DO_GDaSaDfT_1613_raw(); //0:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(0); //1:Parameter CMN_BPT_EMP_EmployeeID of type Guid resultItem.CMN_BPT_EMP_EmployeeID = reader.GetGuid(1); //2:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(2); //3:Parameter FirstName of type String resultItem.FirstName = reader.GetString(3); //4:Parameter LastName of type String resultItem.LastName = reader.GetString(4); //5:Parameter Gender of type int resultItem.Gender = reader.GetInteger(5); //6:Parameter IsTreatingChildren of type Boolean resultItem.IsTreatingChildren = reader.GetBoolean(6); //7:Parameter PrimaryEmail of type String resultItem.PrimaryEmail = reader.GetString(7); //8:Parameter Initials of type String resultItem.Initials = reader.GetString(8); //9:Parameter Title of type String resultItem.Title = reader.GetString(9); //10:Parameter DoctorIDNumber of type String resultItem.DoctorIDNumber = reader.GetString(10); //11:Parameter Staff_Number of type String resultItem.Staff_Number = reader.GetString(11); //12:Parameter hasOpeningTime of type bool resultItem.hasOpeningTime = reader.GetBoolean(12); //13:Parameter ProfessionName of type Dict resultItem.ProfessionName = reader.GetDictionary(13); resultItem.ProfessionName.SourceTable = "cmn_str_professions"; loader.Append(resultItem.ProfessionName); //14:Parameter DisplayImage_RefID of type Guid resultItem.DisplayImage_RefID = reader.GetGuid(14); //15:Parameter CMN_BPT_BusinessParticipant_ExcludedAvailabilityTypeID of type Guid resultItem.CMN_BPT_BusinessParticipant_ExcludedAvailabilityTypeID = reader.GetGuid(15); //16:Parameter Account_RefID of type Guid resultItem.Account_RefID = reader.GetGuid(16); //17:Parameter CMN_STR_OfficeID of type Guid resultItem.CMN_STR_OfficeID = reader.GetGuid(17); //18:Parameter Office_Name of type Dict resultItem.Office_Name = reader.GetDictionary(18); resultItem.Office_Name.SourceTable = "cmn_str_offices"; loader.Append(resultItem.Office_Name); //19:Parameter Office_InternalNumber of type String resultItem.Office_InternalNumber = reader.GetString(19); //20:Parameter Name of type Dict resultItem.Name = reader.GetDictionary(20); resultItem.Name.SourceTable = "cmn_languages"; loader.Append(resultItem.Name); //21:Parameter CMN_LanguageID of type Guid resultItem.CMN_LanguageID = reader.GetGuid(21); //22:Parameter CMN_STR_SkillID of type Guid resultItem.CMN_STR_SkillID = reader.GetGuid(22); //23:Parameter Skill_Name of type Dict resultItem.Skill_Name = reader.GetDictionary(23); resultItem.Skill_Name.SourceTable = "cmn_str_skills"; loader.Append(resultItem.Skill_Name); //24:Parameter PPS_TSK_Task_TemplateID of type Guid resultItem.PPS_TSK_Task_TemplateID = reader.GetGuid(24); //25:Parameter AppointmentType_Name of type Dict resultItem.AppointmentType_Name = reader.GetDictionary(25); resultItem.AppointmentType_Name.SourceTable = "pps_tsk_task_templates"; loader.Append(resultItem.AppointmentType_Name); //26:Parameter CMN_STR_ProfessionID of type Guid resultItem.CMN_STR_ProfessionID = reader.GetGuid(26); //27:Parameter IsPrimary of type bool resultItem.IsPrimary = reader.GetBoolean(27); //28:Parameter CMN_PER_CommunicationContact_TypeID of type Guid resultItem.CMN_PER_CommunicationContact_TypeID = reader.GetGuid(28); //29:Parameter Type of type String resultItem.Type = reader.GetString(29); //30:Parameter Content of type String resultItem.Content = reader.GetString(30); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Doctors_and_Staff_allData_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5DO_GDaSaDfT_1613_raw.Convert(results).ToArray(); return(returnStatus); }