public void Process(CampaignContext context)
 {
     using (AppDbContext db = new AppDbContext())
     {
         Campaign campaign = db.Campaigns.Where(o => o.Id == context.Campaign.Id).SingleOrDefault();
         campaign.Status = "Campaign has been successfully run";
         db.SaveChanges();
     }
     context.State = new CreateState();
 }
 public void Process(CampaignContext context)
 {
     using (AppDbContext db = new AppDbContext())
     {
         Campaign campaign = db.Campaigns.Where(o => o.Id == context.Campaign.Id).SingleOrDefault();
         campaign.Status = "Material for the campaign has been ordered";
         db.SaveChanges();
     }
     context.State = new RunState();
 }
Beispiel #3
0
 public void Process(CampaignContext context)
 {
     using (AppDbContext db = new AppDbContext())
     {
         context.Campaign.Status = "Campaign has been created";
         db.Campaigns.Add(context.Campaign);
         db.SaveChanges();
     }
     context.State = new ApprovalState();
 }