protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here var prioritiesQuery = new ORM_TMS_PRO_DeveloperTask_Priority.Query(); prioritiesQuery.IsDeleted = false; prioritiesQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_TMS_PRO_DeveloperTask_Priority> priorities = ORM_TMS_PRO_DeveloperTask_Priority.Query.Search(Connection, Transaction, prioritiesQuery).ToList(); if (priorities != null) { priorities = priorities.OrderBy(p => p.PriorityLevel).ToList(); for (int i = 0; i < priorities.Count; i++) { ORM_TMS_PRO_DeveloperTask_Priority p = priorities[i]; p.PriorityLevel = i; p.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_L6US_GAMDMDfAU_1317 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L6US_GAMDMDfAU_1317(); //Put your code here L6US_GAMDMDfAU_1317 tempResult = new L6US_GAMDMDfAU_1317(); Guid ApplicationID = Guid.Parse(WebConfigurationManager.AppSettings["ApplicationID"].ToString()); List <L6US_GAMDMDfAU_1317a> tempUsers = new List <L6US_GAMDMDfAU_1317a>(); //Retrieve users ORM_USR_Account.Query userQuery = new ORM_USR_Account.Query(); userQuery.Tenant_RefID = securityTicket.TenantID; userQuery.IsDeleted = false; List <ORM_USR_Account> resultUsers = ORM_USR_Account.Query.Search(Connection, Transaction, userQuery); ORM_CMN_Account_ApplicationSubscription.Query appSubscriptionQuery = new ORM_CMN_Account_ApplicationSubscription.Query(); foreach (var currentUser in resultUsers) { L6US_GAMDMDfAU_1317a tempUser = new L6US_GAMDMDfAU_1317a(); appSubscriptionQuery.Account_RefID = currentUser.USR_AccountID; appSubscriptionQuery.IsDeleted = false; appSubscriptionQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_CMN_Account_ApplicationSubscription> tempSubscriptionResult = ORM_CMN_Account_ApplicationSubscription.Query.Search(Connection, Transaction, appSubscriptionQuery); if (tempSubscriptionResult != null && tempSubscriptionResult.Count > 0) { tempUser.User_IsSubscribed = tempSubscriptionResult.Exists(ts => ts.Application_RefID == ApplicationID && !ts.IsDisabled); } else { tempUser.User_IsSubscribed = false; } tempUsers.Add(tempUser); } tempResult.ActiveUsers = tempUsers.ToArray(); ORM_TMS_PRO_Project.Query projectsQuery = new ORM_TMS_PRO_Project.Query(); projectsQuery.Tenant_RefID = securityTicket.TenantID; projectsQuery.IsDeleted = false; projectsQuery.IsArchived = false; tempResult.ProjectsCount = ORM_TMS_PRO_Project.Query.Search(Connection, Transaction, projectsQuery).Count; ORM_TMS_QuickTask_Type.Query quickTaskQuery = new ORM_TMS_QuickTask_Type.Query(); quickTaskQuery.Tenant_RefID = securityTicket.TenantID; quickTaskQuery.IsDeleted = false; tempResult.WorkingTimeTypesCount = ORM_TMS_QuickTask_Type.Query.Search(Connection, Transaction, quickTaskQuery).Count; ORM_TMS_PRO_DeveloperTask_Priority.Query developerTaskPrioritiesQuery = new ORM_TMS_PRO_DeveloperTask_Priority.Query(); developerTaskPrioritiesQuery.Tenant_RefID = securityTicket.TenantID; developerTaskPrioritiesQuery.IsDeleted = false; tempResult.DeveloperTaskPrioritiesCount = ORM_TMS_PRO_DeveloperTask_Priority.Query.Search(Connection, Transaction, developerTaskPrioritiesQuery).Count; ORM_TMP_PRO_ProjectMember_Type.Query projectMemberTypeQuery = new ORM_TMP_PRO_ProjectMember_Type.Query(); projectMemberTypeQuery.Tenant_RefID = securityTicket.TenantID; projectMemberTypeQuery.IsDeleted = false; tempResult.ProjectMemberTypesCount = ORM_TMP_PRO_ProjectMember_Type.Query.Search(Connection, Transaction, projectMemberTypeQuery).Count; //ORM_CMN_BPT_InvestedWorkTime_ChargingLevel.Query chargingLevelQuery = new ORM_CMN_BPT_InvestedWorkTime_ChargingLevel.Query(); //chargingLevelQuery.Tenant_RefID = securityTicket.TenantID; //chargingLevelQuery.IsDeleted = false; //tempResult.PriceGradesCount = ORM_CMN_BPT_InvestedWorkTime_ChargingLevel.Query.Search(Connection, Transaction, chargingLevelQuery).Count; tempResult.PriceGradesCount = cls_Get_PriceGrades_for_Tenant.Invoke(Connection, Transaction, securityTicket).Result.ToList().Count; tempResult.PlannedProjectsCount = 6; returnValue.Result = tempResult; return(returnValue); #endregion UserCode }