Пример #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            TypeOfIncome typeOfIncome = db.typeOfIncomes.Find(id);

            db.typeOfIncomes.Remove(typeOfIncome);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 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));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,description")] TypeOfIncome typeOfIncome)
        {
            if (ModelState.IsValid)
            {
                db.typeOfIncomes.Add(typeOfIncome);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(typeOfIncome));
        }
Пример #4
0
        // 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));
        }