void BindGrid() { AffiliateCollection affiliateCollection = AffiliateManager.GetAllAffiliates(); gvAffiliates.DataSource = affiliateCollection; gvAffiliates.DataBind(); }
protected void FillDropDowns() { CommonHelper.FillDropDownWithEnum(this.ddlExportMode, typeof(PriceListExportModeEnum)); CommonHelper.FillDropDownWithEnum(this.ddlExportType, typeof(PriceListExportTypeEnum)); CommonHelper.FillDropDownWithEnum(this.ddlPriceAdjustmentType, typeof(PriceAdjustmentTypeEnum)); List <CultureInfo> cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures).ToList(); cultures.Sort(CompareCultures); this.ddlFormatLocalization.Items.Clear(); foreach (CultureInfo ci in cultures) { string name = string.Format("{0}. {1}", ci.IetfLanguageTag, ci.EnglishName); ListItem item2 = new ListItem(name, ci.IetfLanguageTag); this.ddlFormatLocalization.Items.Add(item2); } this.ddlAffiliate.Items.Clear(); ListItem ddlAffiliateItem = new ListItem(GetLocaleResourceString("Admin.PricelistInfo.Affiliate.None"), "0"); this.ddlAffiliate.Items.Add(ddlAffiliateItem); AffiliateCollection affiliateCollection = AffiliateManager.GetAllAffiliates(); foreach (Affiliate affiliate in affiliateCollection) { ListItem ddlAffiliateItem2 = new ListItem(affiliate.LastName + " (ID=" + affiliate.AffiliateID.ToString() + ")", affiliate.AffiliateID.ToString()); this.ddlAffiliate.Items.Add(ddlAffiliateItem2); } }
/// <summary> /// Gets all affiliates /// </summary> /// <returns>Affiliate collection</returns> public static AffiliateCollection GetAllAffiliates() { DBAffiliateCollection dbCollection = DBProviderManager <DBAffiliateProvider> .Provider.GetAllAffiliates(); AffiliateCollection affiliates = DBMapping(dbCollection); return(affiliates); }
private void FillAffiliatDropDowns() { this.ddlAffiliate.Items.Clear(); ListItem ddlAffiliateItem = new ListItem(GetLocaleResourceString("Admin.CustomerInfo.Affiliate.None"), "0"); this.ddlAffiliate.Items.Add(ddlAffiliateItem); AffiliateCollection affiliateCollection = AffiliateManager.GetAllAffiliates(); foreach (Affiliate affiliate in affiliateCollection) { ListItem ddlAffiliateItem2 = new ListItem(affiliate.LastName + " (ID=" + affiliate.AffiliateId.ToString() + ")", affiliate.AffiliateId.ToString()); this.ddlAffiliate.Items.Add(ddlAffiliateItem2); } }
private static AffiliateCollection DBMapping(DBAffiliateCollection dbCollection) { if (dbCollection == null) return null; AffiliateCollection collection = new AffiliateCollection(); foreach (DBAffiliate dbItem in dbCollection) { Affiliate item = DBMapping(dbItem); collection.Add(item); } return collection; }
private static AffiliateCollection DBMapping(DBAffiliateCollection dbCollection) { if (dbCollection == null) { return(null); } var collection = new AffiliateCollection(); foreach (var dbItem in dbCollection) { var item = DBMapping(dbItem); collection.Add(item); } return(collection); }