宁虹看板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

2 years ago
  1. using NFine.Code;
  2. using NFine.Domain.Entity.SystemSecurity;
  3. using NFine.Domain.IRepository.SystemSecurity;
  4. using NFine.Repository.SystemSecurity;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. namespace NFine.Application.SystemSecurity
  8. {
  9. public class FilterIPApp
  10. {
  11. private IFilterIPRepository service = new FilterIPRepository();
  12. public List<FilterIPEntity> GetList(string keyword)
  13. {
  14. var expression = ExtLinq.True<FilterIPEntity>();
  15. if (!string.IsNullOrEmpty(keyword))
  16. {
  17. expression = expression.And(t => t.F_StartIP.Contains(keyword));
  18. }
  19. return service.IQueryable(expression).OrderByDescending(t => t.F_DeleteTime).ToList();
  20. }
  21. public FilterIPEntity GetForm(string keyValue)
  22. {
  23. return service.FindEntity(keyValue);
  24. }
  25. public void DeleteForm(string keyValue)
  26. {
  27. service.Delete(t => t.F_Id == keyValue);
  28. }
  29. public void SubmitForm(FilterIPEntity filterIPEntity, string keyValue)
  30. {
  31. if (!string.IsNullOrEmpty(keyValue))
  32. {
  33. filterIPEntity.Modify(keyValue);
  34. service.Update(filterIPEntity);
  35. }
  36. else
  37. {
  38. filterIPEntity.Create();
  39. service.Insert(filterIPEntity);
  40. }
  41. }
  42. }
  43. }