///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AT_GATMDfTID_0922_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AT_GATMDfTID_0922_Array functionReturn = new FR_L5AT_GATMDfTID_0922_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, 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_MainData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L5AT_GATMDfTID_0922_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AT_GATMDfTID_0922_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_TaskTemplate.Atomic.Retrieval.SQL.cls_Get_AppointmentType_MainData_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; List <L5AT_GATMDfTID_0922_raw> results = new List <L5AT_GATMDfTID_0922_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", "DeviceQuantity", "DeviceDisplayName", "PPS_TSK_Task_RequiredStaffID", "PPS_TSK_Task_RequiredStaff_ProfessionID", "ProfessionName_DictID", "Required_Employee_RefID", "ReqEmployeeFirstName", "ReqEmployeeLastName", "EmployeeTitle", "StaffQuantity", "PPS_TSK_Task_RequiredStaff_SkillID", "Skill_Name_DictID" }); while (reader.Read()) { L5AT_GATMDfTID_0922_raw resultItem = new L5AT_GATMDfTID_0922_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 DeviceQuantity of type String resultItem.DeviceQuantity = reader.GetString(6); //7:Parameter DeviceDisplayName of type String resultItem.DeviceDisplayName = reader.GetString(7); //8:Parameter PPS_TSK_Task_RequiredStaffID of type Guid resultItem.PPS_TSK_Task_RequiredStaffID = reader.GetGuid(8); //9:Parameter PPS_TSK_Task_RequiredStaff_ProfessionID of type Guid resultItem.PPS_TSK_Task_RequiredStaff_ProfessionID = reader.GetGuid(9); //10:Parameter ProfessionName of type Dict resultItem.ProfessionName = reader.GetDictionary(10); resultItem.ProfessionName.SourceTable = "cmn_str_professions"; loader.Append(resultItem.ProfessionName); //11:Parameter Required_Employee_RefID of type Guid resultItem.Required_Employee_RefID = reader.GetGuid(11); //12:Parameter ReqEmployeeFirstName of type String resultItem.ReqEmployeeFirstName = reader.GetString(12); //13:Parameter ReqEmployeeLastName of type String resultItem.ReqEmployeeLastName = reader.GetString(13); //14:Parameter EmployeeTitle of type String resultItem.EmployeeTitle = reader.GetString(14); //15:Parameter StaffQuantity of type int resultItem.StaffQuantity = reader.GetInteger(15); //16:Parameter PPS_TSK_Task_RequiredStaff_SkillID of type Guid resultItem.PPS_TSK_Task_RequiredStaff_SkillID = reader.GetGuid(16); //17:Parameter Skill_Name of type Dict resultItem.Skill_Name = reader.GetDictionary(17); 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_MainData_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AT_GATMDfTID_0922_raw.Convert(results).ToArray(); return(returnStatus); }