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; } }
public CallContext AllowIPSave(AllowIP entity, CallContext resultContext) { resultContext.securitySettings = ETEMEnums.SecuritySettings.AllowIPSave; CallContext resContext = new AllowIPBL().EntitySave <Setting>(entity, resultContext); return(resContext); }
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); } }
public List <AllowIPDataView> GetAllAllowIP(ICollection <AbstractSearch> searchCriteria, string sortExpression, string sortDirection) { List <AllowIPDataView> listView = new AllowIPBL().GetAllAllowIP(searchCriteria, sortExpression, sortDirection); return(listView); }