public MoneyAdsViewModel GetStickyAds(string idUser, int page = 1, string sort = "URL", string sortdir = "ASC") { MoneyAdsViewModel viewModel = new MoneyAdsViewModel(); PublisherAdsRepository repository = new PublisherAdsRepository(); viewModel.defaultAds = repository.GetAllStickyAds(new Guid(idUser)); viewModel.PageSize = 4; viewModel.TotalRecord = viewModel.defaultAds.Count(); return(viewModel); }
public bool ContainOneActiveAds(string idUser) { bool result = false; PublisherAdsRepository repository = new PublisherAdsRepository(); List <Comun.Models.DefaultAds> defaultAds = repository.GetAllDefaultAds(new Guid(idUser)); List <Comun.Models.DefaultAds> stickyAds = repository.GetAllStickyAds(new Guid(idUser)); //Contamos result = ((from ads in defaultAds where ads.Status == "Active" select ads).ToList().Count() > 0 || (from ads in stickyAds where ads.Status == "Active" select ads).ToList().Count() > 0); return(result); }