protected static FR_L5PR_GPFT_1200_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5PR_GPFT_1200_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Plannico_Projects.Atomic.Retrieval.SQL.cls_Get_Projects_For_Tenant.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 <L5PR_GPFT_1200> results = new List <L5PR_GPFT_1200>(); 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[] { "Name_DictID", "Description_DictID", "TMS_PRO_ProjectID", "IsArchived", "AssignmentID", "TMS_PRO_Project_Group_RefID", "Default_CostCenter_RefID" }); while (reader.Read()) { L5PR_GPFT_1200 resultItem = new L5PR_GPFT_1200(); //0:Parameter Name of type Dict resultItem.Name = reader.GetDictionary(0); resultItem.Name.SourceTable = "tms_pro_projects"; loader.Append(resultItem.Name); //1:Parameter Description of type Dict resultItem.Description = reader.GetDictionary(1); resultItem.Description.SourceTable = "tms_pro_projects"; loader.Append(resultItem.Description); //2:Parameter TMS_PRO_ProjectID of type Guid resultItem.TMS_PRO_ProjectID = reader.GetGuid(2); //3:Parameter IsArchived of type bool resultItem.IsArchived = reader.GetBoolean(3); //4:Parameter AssignmentID of type Guid resultItem.AssignmentID = reader.GetGuid(4); //5:Parameter TMS_PRO_Project_Group_RefID of type Guid resultItem.TMS_PRO_Project_Group_RefID = reader.GetGuid(5); //6:Parameter Default_CostCenter_RefID of type Guid resultItem.Default_CostCenter_RefID = reader.GetGuid(6); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
protected static FR_L5PR_GPFPID_1204 Execute(DbConnection Connection, DbTransaction Transaction, P_L5PR_GPFPID_1204 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5PR_GPFPID_1204(); returnValue.Result = new L5PR_GPFPID_1204(); //Put your code here L5PR_GPFT_1200 resultProject = new L5PR_GPFT_1200(); ORM_TMS_PRO_Project.Query projectsQuery = new ORM_TMS_PRO_Project.Query(); projectsQuery.TMS_PRO_ProjectID = Parameter.TMS_PRO_ProjectID; projectsQuery.IsDeleted = false; projectsQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_TMS_PRO_Project> projects = ORM_TMS_PRO_Project.Query.Search(Connection, Transaction, projectsQuery); if (projects.Count == 0) { return(null); } ORM_TMS_PRO_Project project = projects.FirstOrDefault(); ORM_TMS_PRO_Project_2_ProjectGroup.Query project2ProjectGroupQuery = new ORM_TMS_PRO_Project_2_ProjectGroup.Query(); project2ProjectGroupQuery.TMS_PRO_Project_RefID = Parameter.TMS_PRO_ProjectID; project2ProjectGroupQuery.IsDeleted = false; project2ProjectGroupQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_TMS_PRO_Project_2_ProjectGroup> project2ProjectGroup = ORM_TMS_PRO_Project_2_ProjectGroup.Query.Search(Connection, Transaction, project2ProjectGroupQuery); ORM_TMS_PRO_Project_2_ProjectGroup resultProject2ProjectGroup = new ORM_TMS_PRO_Project_2_ProjectGroup(); if (project2ProjectGroup.Count != 0) { resultProject2ProjectGroup = project2ProjectGroup.FirstOrDefault(); } resultProject.TMS_PRO_ProjectID = project.TMS_PRO_ProjectID; resultProject.Name = project.Name; resultProject.Description = project.Description; resultProject.IsArchived = project.IsArchived; resultProject.Default_CostCenter_RefID = project.Default_CostCenter_RefID; resultProject.AssignmentID = resultProject2ProjectGroup.AssignmentID; resultProject.TMS_PRO_Project_Group_RefID = resultProject2ProjectGroup.TMS_PRO_Project_Group_RefID; returnValue.Result.Project = resultProject; return(returnValue); #endregion UserCode }