Пример #1
0
        public ActionResult Edit([Bind(Include = "ID,Name,PaymentFrequency,Amount,SecondAmount,Date,SecondDate")] Income subIncome)
        {
            ViewBag.Action = "Edit";
            Income income = db.Incomes.Find(subIncome.ID);

            if (income == null)
            {
                return(HttpNotFound());
            }
            income = income.MapSubmit(subIncome);
            if (ModelState.IsValid)
            {
                db.Entry(income).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", new { id = income.ID }));
            }
            return(View("Details", income));
        }