protected static FR_L5AT_GATDDfTTID_1015 Execute(DbConnection Connection, DbTransaction Transaction, P_L5AT_GATDDfTTID_1015 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AT_GATDDfTTID_1015(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_TaskTemplate.Atomic.Retrieval.SQL.cls_Get_AppointmentType_DetailsData_for_TaskTemplateID.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, "TaskTemplateID", Parameter.TaskTemplateID); List <L5AT_GATDDfTTID_1015_raw> results = new List <L5AT_GATDDfTTID_1015_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[] { "PPS_TSK_Task_TemplateID", "Duration_EstimatedMax_in_sec", "TaskTemplateName_DictID", "Duration_Recommended_in_sec", "isNotWebBookable", "PPS_TSK_Task_Template_RequiredDeviceID", "TaskTemplate_RefID_Device", "RequiredQuantity", "DEV_Device_RefID", "PPS_DEV_DeviceID", "DeviceName_DictID", "DeviceDisplayName", "PPS_TSK_Task_RequiredStaffID", "StaffQuantity", "CMN_STR_Profession_RefID", "ProfessionName_DictID", "Required_Employee_RefID", "CMN_STR_Skill_RefID", "Skill_Name_DictID" }); while (reader.Read()) { L5AT_GATDDfTTID_1015_raw resultItem = new L5AT_GATDDfTTID_1015_raw(); //0:Parameter PPS_TSK_Task_TemplateID of type Guid resultItem.PPS_TSK_Task_TemplateID = reader.GetGuid(0); //1:Parameter Duration_EstimatedMax_in_sec of type long resultItem.Duration_EstimatedMax_in_sec = reader.GetLong(1); //2:Parameter TaskTemplateName of type Dict resultItem.TaskTemplateName = reader.GetDictionary(2); resultItem.TaskTemplateName.SourceTable = "pps_tsk_task_templates"; loader.Append(resultItem.TaskTemplateName); //3:Parameter Duration_Recommended_in_sec of type long resultItem.Duration_Recommended_in_sec = reader.GetLong(3); //4:Parameter isNotWebBookable of type Guid resultItem.isNotWebBookable = reader.GetGuid(4); //5:Parameter PPS_TSK_Task_Template_RequiredDeviceID of type Guid resultItem.PPS_TSK_Task_Template_RequiredDeviceID = reader.GetGuid(5); //6:Parameter TaskTemplate_RefID_Device of type Guid resultItem.TaskTemplate_RefID_Device = reader.GetGuid(6); //7:Parameter RequiredQuantity of type int resultItem.RequiredQuantity = reader.GetInteger(7); //8:Parameter DEV_Device_RefID of type Guid resultItem.DEV_Device_RefID = reader.GetGuid(8); //9:Parameter PPS_DEV_DeviceID of type Guid resultItem.PPS_DEV_DeviceID = reader.GetGuid(9); //10:Parameter DeviceName of type Dict resultItem.DeviceName = reader.GetDictionary(10); resultItem.DeviceName.SourceTable = "pps_dev_devices"; loader.Append(resultItem.DeviceName); //11:Parameter DeviceDisplayName of type String resultItem.DeviceDisplayName = reader.GetString(11); //12:Parameter PPS_TSK_Task_RequiredStaffID of type Guid resultItem.PPS_TSK_Task_RequiredStaffID = reader.GetGuid(12); //13:Parameter StaffQuantity of type int resultItem.StaffQuantity = reader.GetInteger(13); //14:Parameter CMN_STR_Profession_RefID of type Guid resultItem.CMN_STR_Profession_RefID = reader.GetGuid(14); //15:Parameter ProfessionName of type Dict resultItem.ProfessionName = reader.GetDictionary(15); resultItem.ProfessionName.SourceTable = "cmn_str_professions"; loader.Append(resultItem.ProfessionName); //16:Parameter Required_Employee_RefID of type Guid resultItem.Required_Employee_RefID = reader.GetGuid(16); //17:Parameter CMN_STR_Skill_RefID of type Guid resultItem.CMN_STR_Skill_RefID = reader.GetGuid(17); //18:Parameter Skill_Name of type Dict resultItem.Skill_Name = reader.GetDictionary(18); resultItem.Skill_Name.SourceTable = "cmn_str_skills"; loader.Append(resultItem.Skill_Name); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AppointmentType_DetailsData_for_TaskTemplateID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AT_GATDDfTTID_1015_raw.Convert(results).FirstOrDefault(); return(returnStatus); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L5AT_GATDDfTTID_1015 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5AT_GATDDfTTID_1015 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AT_GATDDfTTID_1015 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AT_GATDDfTTID_1015 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AT_GATDDfTTID_1015 functionReturn = new FR_L5AT_GATDDfTTID_1015(); 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_AppointmentType_DetailsData_for_TaskTemplateID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5AT_GATDDfTTID_1015 Invoke(string ConnectionString, P_L5AT_GATDDfTTID_1015 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }