// // GET: /Finance/Create public ActionResult Create() { var Budget = new Finances(); Budget.Room = 0; Budget.GasHouse = 0; Budget.Electricity = 0; Budget.Water = 0; Budget.OtherUtilities = 0; Budget.CarPayment = 0; Budget.CarInsurance = 0; Budget.GasCar = 0; Budget.PublicTransportation = 0; Budget.OtherTransportation = 0; Budget.CellPhone = 0; Budget.HousePhone = 0; Budget.TVPlan = 0; Budget.Internet = 0; Budget.OtherMedia = 0; Budget.LoanPayments = 0; Budget.OtherMonthlyLoanPayments = 0; Budget.Other = 0; Budget.Food = 0; Budget.Income = 0; return View(Budget); }
public ActionResult Create(Finances finances) { if (ModelState.IsValid) { db.Finances.Add(finances); db.SaveChanges(); return RedirectToAction("Edit", new { id=finances.ID }); } return View(finances); }
public ActionResult Edit(Finances finances) { if (ModelState.IsValid) { db.Entry(finances).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(finances); }