public async Task <ActionResult> DeleteConfirmed(int id) { TypeOfPastor typeOfPastor = await db.TypeOfpastors.FindAsync(id); db.TypeOfpastors.Remove(typeOfPastor); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "TypeOfPastorID,Pastortype")] TypeOfPastor typeOfPastor) { if (ModelState.IsValid) { db.Entry(typeOfPastor).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(typeOfPastor)); }
public async Task <ActionResult> Create([Bind(Include = "TypeOfPastorID,Pastortype")] TypeOfPastor typeOfPastor) { if (ModelState.IsValid) { db.TypeOfpastors.Add(typeOfPastor); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(typeOfPastor)); }
// GET: TypeOfPastors/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypeOfPastor typeOfPastor = await db.TypeOfpastors.FindAsync(id); if (typeOfPastor == null) { return(HttpNotFound()); } return(View(typeOfPastor)); }