using NFine.Code; using NFine.Domain.Entity.SystemSecurity; using NFine.Domain.IRepository.SystemSecurity; using NFine.Repository.SystemSecurity; using System.Collections.Generic; using System.Linq; namespace NFine.Application.SystemSecurity { public class FilterIPApp { private IFilterIPRepository service = new FilterIPRepository(); public List GetList(string keyword) { var expression = ExtLinq.True(); if (!string.IsNullOrEmpty(keyword)) { expression = expression.And(t => t.F_StartIP.Contains(keyword)); } return service.IQueryable(expression).OrderByDescending(t => t.F_DeleteTime).ToList(); } public FilterIPEntity GetForm(string keyValue) { return service.FindEntity(keyValue); } public void DeleteForm(string keyValue) { service.Delete(t => t.F_Id == keyValue); } public void SubmitForm(FilterIPEntity filterIPEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { filterIPEntity.Modify(keyValue); service.Update(filterIPEntity); } else { filterIPEntity.Create(); service.Insert(filterIPEntity); } } } }