Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id,ChannelName")] Channel channel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(channel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(channel));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,ProgramName,Time,Date,ChannelId,Category,Length,Info")] Program program)
 {
     if (ModelState.IsValid)
     {
         db.Entry(program).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ChannelId = new SelectList(db.Channel, "Id", "ChannelName", program.ChannelId);
     return(View(program));
 }