コード例 #1
0
        public ActionResult EditIncomeSource(int id)
        {
            var source = incomeSourceService.GetSourceById(id);

            if (source != null)
            {
                var model = new IncomeSourceModel(source);
                return(View("EditIncomeSource", model));
            }
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult SaveIncomeSource(IncomeSourceModel newIncome)
        {
            if (ModelState.IsValid)
            {
                var saveIncomeSource = new IncomeSource
                {
                    Id     = newIncome.Id,
                    Source = newIncome.Source
                };

                incomeSourceService.SaveIncomeSource(saveIncomeSource);
                return(RedirectToAction("Index"));
            }

            return(View("EditIncomeSource", newIncome));
        }
コード例 #3
0
        public ActionResult CreateIncomeSource()
        {
            var model = new IncomeSourceModel();

            return(View("EditIncomeSource", model));
        }