///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AC_GAIfID_1621 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AC_GAIfID_1621 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AC_GAIfID_1621 functionReturn = new FR_L5AC_GAIfID_1621(); 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_AcctionInfo_for_ID", ex); } return(functionReturn); }
protected static FR_L5AC_GAIfID_1621 Execute(DbConnection Connection, DbTransaction Transaction, P_L5AC_GAIfID_1621 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AC_GAIfID_1621(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MPC_Account.Atomic.Retrieval.SQL.cls_Get_AcctionInfo_for_ID.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, "CMN_BPT_USR_UserID", Parameter.CMN_BPT_USR_UserID); List <L5AC_GAIfID_1621_raw> results = new List <L5AC_GAIfID_1621_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_USR_UserID", "CMN_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "Title", "CMN_AddressID", "Street_Name", "Street_Number", "City_Name", "City_PostalCode", "Country_Name", "HEC_CMT_MembershipID", "IsAvailableFor_Tenants", "IsAvailableFor_Doctors", "CMN_BPT_BusinessParticipantID" }); while (reader.Read()) { L5AC_GAIfID_1621_raw resultItem = new L5AC_GAIfID_1621_raw(); //0:Parameter CMN_BPT_USR_UserID of type Guid resultItem.CMN_BPT_USR_UserID = reader.GetGuid(0); //1:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(1); //2:Parameter FirstName of type string resultItem.FirstName = reader.GetString(2); //3:Parameter LastName of type string resultItem.LastName = reader.GetString(3); //4:Parameter PrimaryEmail of type string resultItem.PrimaryEmail = reader.GetString(4); //5:Parameter Title of type string resultItem.Title = reader.GetString(5); //6:Parameter CMN_AddressID of type Guid resultItem.CMN_AddressID = reader.GetGuid(6); //7:Parameter Street_Name of type string resultItem.Street_Name = reader.GetString(7); //8:Parameter Street_Number of type string resultItem.Street_Number = reader.GetString(8); //9:Parameter City_Name of type string resultItem.City_Name = reader.GetString(9); //10:Parameter City_PostalCode of type string resultItem.City_PostalCode = reader.GetString(10); //11:Parameter Country_Name of type string resultItem.Country_Name = reader.GetString(11); //12:Parameter HEC_CMT_MembershipID of type Guid resultItem.HEC_CMT_MembershipID = reader.GetGuid(12); //13:Parameter IsAvailableFor_Tenants of type bool resultItem.IsAvailableFor_Tenants = reader.GetBoolean(13); //14:Parameter IsAvailableFor_Doctors of type bool resultItem.IsAvailableFor_Doctors = reader.GetBoolean(14); //15:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(15); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AcctionInfo_for_ID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AC_GAIfID_1621_raw.Convert(results).FirstOrDefault(); return(returnStatus); }