Exemple #1
0
 async Task DeleteUnenrolledDealers(CampaignDbCall call, IDbConnection connection)
 {
     foreach (var unenrolledDealerId in call.UnenrolledDealerIds)
     {
         try
         {
             await DeleteDealerBanners(unenrolledDealerId, connection);
         }
         catch (Exception error)
         {
             call.AddError(unenrolledDealerId, error);
         }
     }
 }
Exemple #2
0
        async Task ImportDealers(CampaignDbCall call, IDbConnection connection)
        {
            var banners = await SelectBanners(connection);

            var dealers =
                from dealer in call.Dealers
                join banner in banners on dealer.Id equals banner.DealerId into dealerBanners
                select(dealer.Id, new BannerImporter(this, dealer, dealerBanners, connection));

            foreach (var(dealerId, importer) in dealers)
            {
                try
                {
                    await importer.Import();
                }
                catch (Exception error)
                {
                    call.AddError(dealerId, error);
                }
            }
        }