Esempio n. 1
0
 public ActionResult Index(IncomeRequest request)
 {
     var model = new Income();
     //this.RenderMyViewData(model);
     var result = this.ProjectService.GetIncomeList(request);            
     return View(result);
 }
Esempio n. 2
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         var model = new Income();
         this.TryUpdateModel<Income>(model);
         this.ProjectService.SaveIncome(model);
         return this.RefreshParent();
     }
     catch
     {
         return View();
     }
 }
Esempio n. 3
0
        //
        // GET: /Project/Income/Create

        public ActionResult Create()
        {
            var model = new Income();
            //this.RenderMyViewData(model);
            return View("Edit",model);
        }
Esempio n. 4
0
        public void SaveIncome(Income income)
        {
            using (var dbContext = new ProjectDbContext())
            {

                if (income.ID > 0)
                {

                    dbContext.Update<Income>(income);
                }
                else
                {
                    dbContext.Insert<Income>(income);
                }
            }
        }