protected static FR_L6US_GAUTDfT_1343_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6US_GAUTDfT_1343_Array();
            //Put your code here
            List <L6US_GAUTDfT_1343> tempResult = new List <L6US_GAUTDfT_1343>();

            var tempUsers = cls_Get_UsersBasicInfo_for_TenantID.Invoke(Connection, Transaction, securityTicket).Result;
            ORM_CMN_Account_ApplicationSubscription.Query appSubscriptionQuery = new ORM_CMN_Account_ApplicationSubscription.Query();
            Guid ApplicationID = Guid.Parse(WebConfigurationManager.AppSettings["ApplicationID"].ToString());

            foreach (var currentUser in tempUsers)
            {
                L6US_GAUTDfT_1343 tempResultItem = new L6US_GAUTDfT_1343();
                tempResultItem.User_ID       = currentUser.USR_AccountID;
                tempResultItem.User_FirsName = currentUser.FirstName;
                tempResultItem.User_LastName = currentUser.LastName;
                tempResultItem.User_Email    = currentUser.PrimaryEmail;

                P_L5US_GARfAID_1319 userRightsParameter = new P_L5US_GARfAID_1319();
                userRightsParameter.Account_ID = tempResultItem.User_ID;

                tempResultItem.User_AccountRights = cls_Get_AccountRights_for_AccountID.Invoke(Connection, Transaction, userRightsParameter, securityTicket).Result;

                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)
                {
                    tempResultItem.User_HasAccessToApp = tempSubscriptionResult.Exists(ts => ts.Application_RefID == ApplicationID && !ts.IsDisabled);
                }
                else
                {
                    tempResultItem.User_HasAccessToApp = false;
                }

                tempResultItem.IsAdmin     = false;
                tempResultItem.IsManager   = false;
                tempResultItem.IsDeveloper = false;


                tempResult.Add(tempResultItem);
            }


            returnValue.Result = tempResult.ToArray();

            return(returnValue);

            #endregion UserCode
        }
Beispiel #2
0
        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
        }