public ActionResult Create(CampaignReview campaignreview)
        {
            if (ModelState.IsValid)
            {
                _db.CampaignReviews.Add(campaignreview);
                _db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", campaignreview.CampaignID);
            ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", campaignreview.UserID);
            return View(campaignreview);
        }
 public ActionResult Edit(CampaignReview campaignreview)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(campaignreview).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.CampaignID = new SelectList(_db.Campaigns, "CampaignID", "Name", campaignreview.CampaignID);
     ViewBag.UserID = new SelectList(_db.Users, "UserId", "UserName", campaignreview.UserID);
     return View(campaignreview);
 }
예제 #3
0
 partial void DeleteCampaignReview(CampaignReview instance);
예제 #4
0
 partial void UpdateCampaignReview(CampaignReview instance);
예제 #5
0
 partial void InsertCampaignReview(CampaignReview instance);
예제 #6
0
		private void detach_CampaignReviews(CampaignReview entity)
		{
			this.SendPropertyChanging();
			entity.Campaign = null;
		}