public List <Owner> GetFilteredOwners(Filter filter) { if (filter.CurrentPage < 0 || filter.ItemsPrPage < 0) { throw new InvalidDataException("page and items must be 0 or more!"); } if ((filter.CurrentPage - 1 * filter.ItemsPrPage) >= _ownerRepository.Count()) { throw new InvalidDataException("No Items to show!"); } if (filter.ItemsPrPage > _ownerRepository.Count()) { throw new InvalidDataException("the items number is to high!"); } return(_ownerRepository.ReadAllOwners(filter).ToList()); }
public string Binding() { //kamus GridRequestParameters param = GridRequestParameters.Current; List <owner> items = RepoOwner.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters); int total = RepoOwner.Count(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = total, data = new OwnerPresentationStub().MapList(items) })); }
public List <Owner> GetFilteredOwners(Filter filter) { if (filter.CurrentPage < 0 || filter.ItemsPrPage < 0) { throw new InvalidDataException("CurrentPage and ItemsPage Must zero or more"); } if ((filter.CurrentPage - 1 * filter.ItemsPrPage) >= _ownerRepo.Count()) { throw new InvalidDataException("Index out bounds, CurrentPage is to high"); } return(_ownerRepo.ReadAll(filter).ToList()); }
public List <Owner> GetFilteredOwners(Filter filter) { if (filter.CurrentPage < 0 || filter.ItemsPrPage < 0) { throw new InvalidDataException("CurrentPage and ItemsPrPage can not be below 0"); } if ((filter.CurrentPage - 1 * filter.ItemsPrPage) >= _ownerRepository.Count()) { throw new InvalidDataException("Index out of bounds, CurrentPage too high"); } return(_ownerRepository.GetAllOwners(filter).ToList()); }
public List <Owner> GetAllOwners(Filter filter) { if (filter == null) { return(_ownerRepo.ReadOwners(filter).ToList()); } if (filter.CurrentPage < 0 || filter.ItemsPrPage < 0) { _errorFactory.Invalid("Current page or items per page can not be below 0"); } if ((filter.CurrentPage - 1) * filter.ItemsPrPage >= _ownerRepo.Count()) { _errorFactory.Invalid("Index out of bounds. Current page is too high"); } return(_ownerRepo.ReadOwners(filter).ToList()); }
public string Binding() { //kamus GridRequestParameters param = GridRequestParameters.Current; if (param.Filters.Filters == null) { param.Filters.Filters = new List <Business.Infrastructure.FilterInfo>(); param.Filters.Logic = "and"; } List <owner> items = RepoOwner.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters); int total = RepoOwner.Count(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = total, data = new ProfilePresentationStub().MapList(items) })); }
public int Count() { return(ownerRepos.Count()); }
public int Count() { return(_ownerRepo.Count()); }