示例#1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6US_GAMDMDfAU_1317 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6US_GAMDMDfAU_1317 functionReturn = new FR_L6US_GAMDMDfAU_1317();

            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_AdminModuleDashboardMenuData_for_ActiveUser", ex);
            }
            return(functionReturn);
        }
示例#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
        }