public async Task <ActionResult> DeleteConfirmed(int id) { AuthorPlan authorPlan = await _db.AuthorPlans.FindAsync(id); _db.AuthorPlans.Remove(authorPlan); await _db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit(AuthorPlan authorPlan) { if (ModelState.IsValid) { _db.Entry(authorPlan).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CurrencyId = new SelectList(_db.Currencies, "CurrencyId", "Name", authorPlan.CurrencyId); ViewBag.PeriodicityId = new SelectList(_db.Periodicities, "PeriodicityId", "Name", authorPlan.PeriodicityId); return(View(authorPlan)); }