public Campaign UpdateCampagne(Campaign campaign) { try { if (campaign.idStoreCloud == 0) { StoreCloudProvider SCPrv = new StoreCloudProvider(this.Connector); StoreCloud sc = SCPrv.CreateStoreCloud(campaign.Title); campaign.idStoreCloud = sc.IDStore; } base.SaveBubble(campaign); return(campaign); } catch (Exception ex) { throw new Exception("CreateCampagne " + ex.Message, ex); } }
public Campaign UpdateCampagne(int idCampaign, CampaignApiPoco campaign) { try { Campaign oldCampaign = this.getCampagne(idCampaign); oldCampaign.FromObject(campaign); if (oldCampaign.idStoreCloud == 0) { StoreCloudProvider SCPrv = new StoreCloudProvider(this.Connector); StoreCloud sc = SCPrv.CreateStoreCloud(oldCampaign.Title); oldCampaign.idStoreCloud = sc.IDStore; } base.SaveBubble(oldCampaign); return(oldCampaign); } catch (Exception ex) { throw new Exception("CreateCampagne " + ex.Message, ex); } }
public Campaign CreateCampagne(Account account, string CampaignTitle) { try { Campaign nouveau = new Campaign(); nouveau.Title = CampaignTitle; nouveau.IDAccount = account.IDAccount; nouveau.DateCreate = DateTime.Now; nouveau.Enabled = true; nouveau["IDCampaign"] = DBNull.Value; StoreCloudProvider SCPrv = new StoreCloudProvider(this.Connector); StoreCloud sc = SCPrv.CreateStoreCloud(nouveau.Title); nouveau.idStoreCloud = sc.IDStore; // Insert base.InsertBubble(nouveau, false, true); return(nouveau); } catch (Exception ex) { throw new Exception("CreateCampagne " + ex.Message, ex); } }