public ActionResult DeleteConfirmed(string id) { TypeOfIncome typeOfIncome = db.typeOfIncomes.Find(id); db.typeOfIncomes.Remove(typeOfIncome); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,description")] TypeOfIncome typeOfIncome) { if (ModelState.IsValid) { db.Entry(typeOfIncome).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeOfIncome)); }
public ActionResult Create([Bind(Include = "Id,description")] TypeOfIncome typeOfIncome) { if (ModelState.IsValid) { db.typeOfIncomes.Add(typeOfIncome); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeOfIncome)); }
// GET: TypeOfIncomes/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypeOfIncome typeOfIncome = db.typeOfIncomes.Find(id); if (typeOfIncome == null) { return(HttpNotFound()); } return(View(typeOfIncome)); }