public async Task <ActionResult> DeleteConfirmed(int id) { BusinessChannel businessChannel = await db.BusinessChannels.FindAsync(id); db.BusinessChannels.Remove(businessChannel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "BusinessChannelID,CategoryID,Title,Description,CreationDate")] BusinessChannel businessChannel) { if (ModelState.IsValid) { db.Entry(businessChannel).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Title", businessChannel.CategoryID); return(View(businessChannel)); }
// GET: BusinessChannels/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BusinessChannel businessChannel = await db.BusinessChannels.FindAsync(id); if (businessChannel == null) { return(HttpNotFound()); } return(View(businessChannel)); }
// GET: BusinessChannels/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BusinessChannel businessChannel = await db.BusinessChannels.FindAsync(id); if (businessChannel == null) { return(HttpNotFound()); } ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Title", businessChannel.CategoryID); return(View(businessChannel)); }