Esempio n. 1
0
        public bool CheckIP()
        {


            RemoteEndpointMessageProperty endpoint = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

            string endpointAdress = endpoint.Address;
            ICollection<AbstractSearch> searchCriteria = new List<AbstractSearch>();

            searchCriteria.Add(
                   new BooleanSearch
                   {
                       Comparator = BooleanComparators.Equal,
                       Property = "Allow",
                       SearchTerm = true
                   });

            List<AllowIPDataView> listAllowIP = new AllowIPBL().GetAllAllowIP(searchCriteria, string.Empty, string.Empty);

            if (listAllowIP.Select(s => s.IP).Contains(endpointAdress))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Esempio n. 2
0
        public CallContext AllowIPSave(AllowIP entity, CallContext resultContext)
        {
            resultContext.securitySettings = ETEMEnums.SecuritySettings.AllowIPSave;
            CallContext resContext = new AllowIPBL().EntitySave <Setting>(entity, resultContext);

            return(resContext);
        }
Esempio n. 3
0
        public bool CheckIP()
        {
            RemoteEndpointMessageProperty endpoint = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

            string endpointAdress = endpoint.Address;
            ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();

            searchCriteria.Add(
                new BooleanSearch
            {
                Comparator = BooleanComparators.Equal,
                Property   = "Allow",
                SearchTerm = true
            });

            List <AllowIPDataView> listAllowIP = new AllowIPBL().GetAllAllowIP(searchCriteria, string.Empty, string.Empty);

            if (listAllowIP.Select(s => s.IP).Contains(endpointAdress))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public List <AllowIPDataView> GetAllAllowIP(ICollection <AbstractSearch> searchCriteria, string sortExpression, string sortDirection)
        {
            List <AllowIPDataView> listView = new AllowIPBL().GetAllAllowIP(searchCriteria, sortExpression, sortDirection);

            return(listView);
        }