public ActionResult Edit([Bind(Include = "JournalistId,JournalistFirstName,JournalistLastName,Email,Phone")] Journalist journalist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(journalist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(journalist));
 }
 public ActionResult Edit([Bind(Include = "journalistId,name,email,phone,address")] Journalist journalist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(journalist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(journalist));
 }
 public ActionResult Edit([Bind(Include = "articleId,title,content,date,category,journalistId")] Article article)
 {
     if (ModelState.IsValid)
     {
         db.Entry(article).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.journalistId = new SelectList(db.Journalists, "journalistId", "name", article.journalistId);
     return(View(article));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "ArticleID,JournalistID,Tile,Date,Topic")] Article articles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(articles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.JournalistID = new SelectList(db.Journalists, "JournalistID", "JournalistFirstName", articles.JournalistID);
     return(View(articles));
 }