///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_ED_GDOD_1208_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_ED_GDOD_1208_Array functionReturn = new FR_ED_GDOD_1208_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_OldData", ex); } return(functionReturn); }
protected static FR_ED_GDOD_1208_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_ED_GDOD_1208_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "DataImporter.DBMethods.ExportData.Atomic.Retrieval.SQL.cls_Get_Doctors_OldData.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 <ED_GDOD_1208_raw> results = new List <ED_GDOD_1208_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[] { "Doctor_CMN_BPT_BusinessParticipantID", "HEC_DoctorID", "LANR", "FirstName", "LastName", "Title", "LoginEmail", "Account_RefID", "Salutation_General", "Salutation_Letter", "AccountHolder", "AccountNumber", "BankName", "BICCode", "IBAN", "BLZ", "PracticeName", "BSNR", "PracticeID", "CMN_BPT_BusinessParticipantID", "Content", "Contact_Type" }); while (reader.Read()) { ED_GDOD_1208_raw resultItem = new ED_GDOD_1208_raw(); //0:Parameter Doctor_CMN_BPT_BusinessParticipantID of type Guid resultItem.Doctor_CMN_BPT_BusinessParticipantID = reader.GetGuid(0); //1:Parameter HEC_DoctorID of type Guid resultItem.HEC_DoctorID = reader.GetGuid(1); //2:Parameter LANR of type String resultItem.LANR = 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 Title of type String resultItem.Title = reader.GetString(5); //6:Parameter LoginEmail of type String resultItem.LoginEmail = reader.GetString(6); //7:Parameter Account_RefID of type Guid resultItem.Account_RefID = reader.GetGuid(7); //8:Parameter Salutation_General of type String resultItem.Salutation_General = reader.GetString(8); //9:Parameter Salutation_Letter of type String resultItem.Salutation_Letter = reader.GetString(9); //10:Parameter AccountHolder of type String resultItem.AccountHolder = reader.GetString(10); //11:Parameter AccountNumber of type String resultItem.AccountNumber = reader.GetString(11); //12:Parameter BankName of type String resultItem.BankName = reader.GetString(12); //13:Parameter BICCode of type String resultItem.BICCode = reader.GetString(13); //14:Parameter IBAN of type String resultItem.IBAN = reader.GetString(14); //15:Parameter BLZ of type String resultItem.BLZ = reader.GetString(15); //16:Parameter PracticeName of type String resultItem.PracticeName = reader.GetString(16); //17:Parameter BSNR of type String resultItem.BSNR = reader.GetString(17); //18:Parameter PracticeID of type Guid resultItem.PracticeID = reader.GetGuid(18); //19:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(19); //20:Parameter Content of type String resultItem.Content = reader.GetString(20); //21:Parameter Contact_Type of type Guid resultItem.Contact_Type = reader.GetGuid(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Doctors_OldData", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = ED_GDOD_1208_raw.Convert(results).ToArray(); return(returnStatus); }