///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AP_GAMDfTID_1035_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AP_GAMDfTID_1035 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AP_GAMDfTID_1035_Array functionReturn = new FR_L5AP_GAMDfTID_1035_Array(); 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_AppointmentMainData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L5AP_GAMDfTID_1035_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AP_GAMDfTID_1035 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AP_GAMDfTID_1035_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_TaskTemplate.Atomic.Retrieval.SQL.cls_Get_AppointmentMainData_for_TenantID.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, "AvaPropertyMatchingID", Parameter.AvaPropertyMatchingID); List <L5AP_GAMDfTID_1035_raw> results = new List <L5AP_GAMDfTID_1035_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[] { "TaskTemplateName_DictID", "DisplayName", "PPS_TSK_TaskID", "Office_Name_DictID", "CMN_PER_PersonInfoID", "PatientID", "PatientFirstName", "PatientLastName", "PatientEmail", "AcademicTitle", "PlannedDuration_in_sec", "PatientBirthDay", "PlannedStartDate", "DoctorID", "DoctorFirstName", "DoctorLastName", "DoctorTitle", "DoctorFlag", "RequiredDoctorID", "RequiredDoctorFirstName", "RequiredDoctorLastName", "RequiredDoctorTitle", "RequiredDoctorFlag" }); while (reader.Read()) { L5AP_GAMDfTID_1035_raw resultItem = new L5AP_GAMDfTID_1035_raw(); //0:Parameter TaskTemplateName of type Dict resultItem.TaskTemplateName = reader.GetDictionary(0); resultItem.TaskTemplateName.SourceTable = "pps_tsk_task_templates"; loader.Append(resultItem.TaskTemplateName); //1:Parameter DisplayName of type String resultItem.DisplayName = reader.GetString(1); //2:Parameter PPS_TSK_TaskID of type Guid resultItem.PPS_TSK_TaskID = reader.GetGuid(2); //3:Parameter Office_Name of type Dict resultItem.Office_Name = reader.GetDictionary(3); resultItem.Office_Name.SourceTable = "cmn_str_offices"; loader.Append(resultItem.Office_Name); //4:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(4); //5:Parameter PatientID of type Guid resultItem.PatientID = reader.GetGuid(5); //6:Parameter PatientFirstName of type String resultItem.PatientFirstName = reader.GetString(6); //7:Parameter PatientLastName of type String resultItem.PatientLastName = reader.GetString(7); //8:Parameter PatientEmail of type String resultItem.PatientEmail = reader.GetString(8); //9:Parameter AcademicTitle of type String resultItem.AcademicTitle = reader.GetString(9); //10:Parameter PlannedDuration_in_sec of type String resultItem.PlannedDuration_in_sec = reader.GetString(10); //11:Parameter PatientBirthDay of type DateTime resultItem.PatientBirthDay = reader.GetDate(11); //12:Parameter PlannedStartDate of type DateTime resultItem.PlannedStartDate = reader.GetDate(12); //13:Parameter DoctorID of type Guid resultItem.DoctorID = reader.GetGuid(13); //14:Parameter DoctorFirstName of type String resultItem.DoctorFirstName = reader.GetString(14); //15:Parameter DoctorLastName of type String resultItem.DoctorLastName = reader.GetString(15); //16:Parameter DoctorTitle of type String resultItem.DoctorTitle = reader.GetString(16); //17:Parameter DoctorFlag of type Guid resultItem.DoctorFlag = reader.GetGuid(17); //18:Parameter RequiredDoctorID of type Guid resultItem.RequiredDoctorID = reader.GetGuid(18); //19:Parameter RequiredDoctorFirstName of type String resultItem.RequiredDoctorFirstName = reader.GetString(19); //20:Parameter RequiredDoctorLastName of type String resultItem.RequiredDoctorLastName = reader.GetString(20); //21:Parameter RequiredDoctorTitle of type String resultItem.RequiredDoctorTitle = reader.GetString(21); //22:Parameter RequiredDoctorFlag of type Guid resultItem.RequiredDoctorFlag = reader.GetGuid(22); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AppointmentMainData_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AP_GAMDfTID_1035_raw.Convert(results).ToArray(); return(returnStatus); }