///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3MD_GDBIfID_1150 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3MD_GDBIfID_1150 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3MD_GDBIfID_1150 functionReturn = new FR_L3MD_GDBIfID_1150(); 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_Doctor_BaseInfo_byID", ex); } return(functionReturn); }
protected static FR_L3MD_GDBIfID_1150 Execute(DbConnection Connection, DbTransaction Transaction, P_L3MD_GDBIfID_1150 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3MD_GDBIfID_1150(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL3_Doctors.Atomic.Retrieval.SQL.cls_Get_Doctor_BaseInfo_byID.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, "DoctorID", Parameter.DoctorID); List <L3MD_GDBIfID_1150_raw> results = new List <L3MD_GDBIfID_1150_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", "Content", "Contact_Type" }); while (reader.Read()) { L3MD_GDBIfID_1150_raw resultItem = new L3MD_GDBIfID_1150_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 Content of type String resultItem.Content = reader.GetString(10); //11:Parameter Contact_Type of type Guid resultItem.Contact_Type = reader.GetGuid(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Doctor_BaseInfo_byID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L3MD_GDBIfID_1150_raw.Convert(results).FirstOrDefault(); return(returnStatus); }