public HomeJobSeeker() { InitializeComponent(); List <JobOffer> offerList = JobOfferService.GetAllOffers(); //render promoted offers foreach (var item in offerList) { if (item.Promoted) { parentPanel.Controls.Add(new offerComponent(item)); } } //render not prometed offers foreach (var item in offerList) { if (!item.Promoted) { parentPanel.Controls.Add(new offerComponent(item)); } } parentPanel.Refresh(); }
public AllOffers() { InitializeComponent(); foreach (var item in JobOfferService.GetAllOffers()) { flowLayoutPanel1.Controls.Add(new offerComponent(item, this)); } flowLayoutPanel1.Refresh(); }