///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5PA_GPDDfPID_1358 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5PA_GPDDfPID_1358 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5PA_GPDDfPID_1358 functionReturn = new FR_L5PA_GPDDfPID_1358(); 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_Get_PatientDetailData_for_PatientID", ex); } return(functionReturn); }
protected static FR_L5PA_GPDDfPID_1358 Execute(DbConnection Connection, DbTransaction Transaction, P_L5PA_GPDDfPID_1358 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PA_GPDDfPID_1358(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_Patient.Atomic.Retrieval.SQL.cls_Get_PatientDetailData_for_PatientID.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, "PatientID", Parameter.PatientID); List <L5PA_GPDDfPID_1358_raw> results = new List <L5PA_GPDDfPID_1358_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[] { "FirstName", "LastName", "PrimaryEmail", "Title", "ID", "Gender", "AcademicTitle", "BirthDate", "ProfileImage_Document_RefID", "Name_DictID", "CMN_LanguageID", "CMN_PER_CommunicationContactID", "Content", "Type", "CMN_PER_PersonInfo_SocialSecurityNumberID", "SocialSecurityNumber", "CMN_AddressID", "Street_Name", "Street_Number", "City_Name", "City_PostalCode", "Country_ISOCode" }); while (reader.Read()) { L5PA_GPDDfPID_1358_raw resultItem = new L5PA_GPDDfPID_1358_raw(); //0:Parameter FirstName of type String resultItem.FirstName = reader.GetString(0); //1:Parameter LastName of type String resultItem.LastName = reader.GetString(1); //2:Parameter PrimaryEmail of type String resultItem.PrimaryEmail = reader.GetString(2); //3:Parameter Title of type String resultItem.Title = reader.GetString(3); //4:Parameter ID of type Guid resultItem.ID = reader.GetGuid(4); //5:Parameter Gender of type String resultItem.Gender = reader.GetString(5); //6:Parameter AcademicTitle of type String resultItem.AcademicTitle = reader.GetString(6); //7:Parameter BirthDate of type DateTime resultItem.BirthDate = reader.GetDate(7); //8:Parameter ProfileImage_Document_RefID of type Guid resultItem.ProfileImage_Document_RefID = reader.GetGuid(8); //9:Parameter Name of type Dict resultItem.Name = reader.GetDictionary(9); resultItem.Name.SourceTable = "cmn_languages"; loader.Append(resultItem.Name); //10:Parameter CMN_LanguageID of type Guid resultItem.CMN_LanguageID = reader.GetGuid(10); //11:Parameter CMN_PER_CommunicationContactID of type Guid resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(11); //12:Parameter Content of type String resultItem.Content = reader.GetString(12); //13:Parameter Type of type String resultItem.Type = reader.GetString(13); //14:Parameter CMN_PER_PersonInfo_SocialSecurityNumberID of type Guid resultItem.CMN_PER_PersonInfo_SocialSecurityNumberID = reader.GetGuid(14); //15:Parameter SocialSecurityNumber of type String resultItem.SocialSecurityNumber = reader.GetString(15); //16:Parameter CMN_AddressID of type Guid resultItem.CMN_AddressID = reader.GetGuid(16); //17:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(17); //18:Parameter Street_Number of type String resultItem.Street_Number = 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 Country_ISOCode of type String resultItem.Country_ISOCode = reader.GetString(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_PatientDetailData_for_PatientID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5PA_GPDDfPID_1358_raw.Convert(results).FirstOrDefault(); return(returnStatus); }