public ActionResult Create(CampaignUpdate campaignupdate) { if (ModelState.IsValid) { _db.CampaignUpdates.Add(campaignupdate); _db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", campaignupdate.CampaignID); ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", campaignupdate.UserID); return View(campaignupdate); }
partial void DeleteCampaignUpdate(CampaignUpdate instance);
partial void InsertCampaignUpdate(CampaignUpdate instance);
private void detach_CampaignUpdates(CampaignUpdate entity) { this.SendPropertyChanging(); entity.Campaign = null; }
public ActionResult Edit(CampaignUpdate campaignupdate) { if (ModelState.IsValid) { _db.Entry(campaignupdate).State = EntityState.Modified; _db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", campaignupdate.CampaignID); ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", campaignupdate.UserID); return View(campaignupdate); }