///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L6EX_GPED_0953 Invoke(string ConnectionString, P_L6EX_GPED_0953 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6EX_GPED_0953 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6EX_GPED_0953 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6EX_GPED_0953 functionReturn = new FR_L6EX_GPED_0953(); 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_Patient_examination_documents", ex); } return(functionReturn); }
protected static FR_L6EX_GPED_0953 Execute(DbConnection Connection, DbTransaction Transaction, P_L6EX_GPED_0953 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L6EX_GPED_0953(); returnValue.Result = new L6EX_GPED_0953(); List <L6EX_GPED_0953_referal_types> referal_typeList = new List <L6EX_GPED_0953_referal_types>(); returnValue.Result.referal_types = referal_typeList.ToArray(); var patient_findings = cls_Get_PatientFindings.Invoke(Connection, Transaction, new P_L5PA_GPF_1649 { PatientID = Parameter.PatientID }, securityTicket).Result.ToList(); var referal_types = cls_Get_MedicalPracticeTypes_for_TenantID.Invoke(Connection, Transaction, securityTicket).Result; foreach (var item in referal_types) { L6EX_GPED_0953_referal_types referal = new L6EX_GPED_0953_referal_types(); referal.referal_type_id = item.HEC_MedicalPractice_TypeID.ToString(); referal.name = item.MedicalPracticeType_Name.Contents[0].Content; var referal_findings = patient_findings.Where(i => i.referal_id == item.HEC_MedicalPractice_TypeID).ToList(); var findingsCount = 0; List <L6EX_GPED_0953_findings> findingList = new List <L6EX_GPED_0953_findings>(); List <L6EX_GPED_0953_files> documents = new List <L6EX_GPED_0953_files>(); foreach (var finding in referal_findings) { L6EX_GPED_0953_findings newFinding = new L6EX_GPED_0953_findings(); newFinding.findings_id = finding.finding_id.ToString(); newFinding.findings_date = finding.date.ToShortDateString(); newFinding.files = new List <L6EX_GPED_0953_files>().ToArray(); var findings_documents = new List <L6EX_GPED_0953_files>(); foreach (var file in finding.files) { findingsCount++; L6EX_GPED_0953_files document = new L6EX_GPED_0953_files(); document.document_id = file.file_url; document.document_name = file.file_name; findings_documents.Add(document); } newFinding.files = findings_documents.ToArray(); findingList.Add(newFinding); } referal.count = findingsCount.ToString(); referal.findings = findingList.ToArray(); referal_typeList.Add(referal); } returnValue.Result.referal_types = referal_typeList.ToArray(); return(returnValue); #endregion UserCode }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L6EX_GPED_0953 Invoke(DbConnection Connection, DbTransaction Transaction, P_L6EX_GPED_0953 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }