private void GetSponsorsNotInSeason(string value) { using (var db = new CSBCDbContext()) { try { var rep = new SponsorProfileRepository(db); List<SponsorProfile> sponsors; if (String.IsNullOrEmpty(value)) sponsors = rep.GetSponsorsNotInSeason(Master.CompanyId, Master.SeasonId).ToList<SponsorProfile>(); else sponsors = rep.GetAll(Master.CompanyId, value).ToList<SponsorProfile>(); grdSearchSponsor.DataSource = sponsors; grdSearchSponsor.DataBind(); } catch (Exception ex) { lblError.Text = "GetData::" + ex.Message; } } }
protected void LoadSponsors() { using (var db = new CSBCDbContext()) { var rep = new SponsorProfileRepository(db); var sponsors = rep.GetAll(Master.CompanyId).ToList<SponsorProfile>(); cmbSponsorNames.DataSource = sponsors; cmbSponsorNames.DataValueField = "SponsorProfileId"; cmbSponsorNames.DataTextField = "SpoName"; cmbSponsorNames.DataBind(); } }
public void SearchSponsorProfileTest2() { using (var db = new CSBCDbContext()) { var repProfile = new SponsorProfileRepository(db); var sponsors = repProfile.GetAll(1, "Fa"); Assert.IsTrue(sponsors.Any()); } }