public ActionResult Index(IncomeRequest request) { var model = new Income(); //this.RenderMyViewData(model); var result = this.ProjectService.GetIncomeList(request); return View(result); }
public ActionResult Create(FormCollection collection) { try { var model = new Income(); this.TryUpdateModel<Income>(model); this.ProjectService.SaveIncome(model); return this.RefreshParent(); } catch { return View(); } }
// // GET: /Project/Income/Create public ActionResult Create() { var model = new Income(); //this.RenderMyViewData(model); return View("Edit",model); }
public void SaveIncome(Income income) { using (var dbContext = new ProjectDbContext()) { if (income.ID > 0) { dbContext.Update<Income>(income); } else { dbContext.Insert<Income>(income); } } }