public async Task <ActionResult> Edit([Bind(Include = "ID,Name")] TvChannel tvChannel) { if (ModelState.IsValid) { dbContext.Entry(tvChannel).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tvChannel)); }
public async Task <ActionResult> Edit([Bind(Include = "ID,Title,Details,Broadcasting,EndTime,TvChannelID ,Duration, IsInFocus")] TvProgram tvProgram) //public async Task<ActionResult> Edit([Bind(Include = "ID,Title,Details, IsInFocus")] TvProgram tvProgram) { if (ModelState.IsValid) { dbContext.Entry(tvProgram).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.TvChannelID = new SelectList(dbContext.TvChannels, "ID", "Name", tvProgram.TvChannelID); return(View(tvProgram)); }
public async Task <ActionResult> Edit([Bind(Include = "ID,TvChannelID,TvChannels,AspNetUsersId")] UserTablau userTablau) { if (ModelState.IsValid) { dbContext.Entry(userTablau).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.TvChannelID = new SelectList(dbContext.TvChannels, "ID", "Name", userTablau.TvChannelID); ViewBag.AspNetUsersId = new SelectList(dbContext.UserInfoes, "ID", "UserName", userTablau.AspNetUsersId); return(View(userTablau)); }