/* Заносим данные в List<AdvertisingBrandsModel> */ private void SetSponsoredBrandsToList(IDataRecord record) { AdvertisingBrandsModel adbrandModel = new AdvertisingBrandsModel(); advbrandList.Add(adbrandModel); for (int i = 0; i < record.FieldCount; i++) { advbrandList[advbrandList.Count - 1].WriteData(i, record[i]); } }
/* Получаем id товара по выбранному имени в combobox */ private int GetProductIdByName(AdvertisingBrandsModel _abm) { for (int i = 0; i < pList.Count; i++) { if (_abm.CampaignName.ToLower().Contains(pList[i].ProdShortName.ToLower()) && _abm.ProductId1 != pList[i].ProductId && _abm.ProductId2 != pList[i].ProductId && _abm.ProductId3 != pList[i].ProductId) { return(pList[i].ProductId); } } return(1); }