示例#1
0
        private IList <MenuDTO> GetMenu()
        {
            grdMenu.BlockUI(false);
            IList <MenuDTO> lLstObjResult = null;

            try
            {
                SecurityServicesFactory mObjSecurityServiceFactory = new SecurityServicesFactory();
                SessionDTO lObjSession = StaticSessionUtility.GetCurrentSession() as SessionDTO;

                if (IsActiveSecurity() || !IsTestMode())
                {
                    lLstObjResult = mObjSecurityServiceFactory.GetPermissionService().GetSystemMenu(lObjSession.Id);
                }
                else
                {
                    lLstObjResult = mObjSecurityServiceFactory.GetPermissionService().GetTestSystemMenu();
                }
            }
            catch (Exception lObjException)
            {
                this.Dispatcher.Invoke(() =>
                {
                    CustomMessageBox.Show("Error", lObjException.Message);
                });
            }
            finally
            {
                grdMenu.UnblockUI();
            }

            return(lLstObjResult);
        }
示例#2
0
        private bool GetActiveSession()
        {
            SessionDTO lObjCurrentSession = (SessionDTO)StaticSessionUtility.GetCurrentSession();

            if (lObjCurrentSession != null)
            {
                UserDTO pObjUserDto = mObjUserFactory.GetUserService().GetUserDTO(lObjCurrentSession.Id);

                if (pObjUserDto.UserType.Equals("Administrador"))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
示例#3
0
 private long GetCurrentUserId()
 {
     return(((SessionDTO)StaticSessionUtility.GetCurrentSession()).Id);
 }