public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Intro,Body,Closing")] PastDueTemplate pastDueTemplate) { if (id != pastDueTemplate.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pastDueTemplate); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PastDueTemplateExists(pastDueTemplate.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(pastDueTemplate)); }
public async Task <IActionResult> Create([Bind("Id,Name,Intro,Body,Closing")] PastDueTemplate pastDueTemplate) { if (ModelState.IsValid) { _context.Add(pastDueTemplate); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(pastDueTemplate)); }
public async Task <IActionResult> PastDue(PastDueTemplate email) { var emailList = await _context.EmailTemplate.ToListAsync(); if (email == null) { email = emailList.First(); } else { email = emailList.Where(x => x.Id == email.Id).First(); } ViewBag.ListOfEmails = emailList; return(View(email)); }