public async Task <IActionResult> Edit(int id, [Bind("Id,ExpendType,Sequence")] FncExpendType fncExpendType) { if (id != fncExpendType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(fncExpendType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FncExpendTypeExists(fncExpendType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(PartialView("~/Areas/Finance/Views/FncExpendType/CreateEdit.cshtml", fncExpendType)); }
public async Task <IActionResult> Create([Bind("Id,ExpendType,Sequence")] FncExpendType fncExpendType) { if (ModelState.IsValid) { _context.Add(fncExpendType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(PartialView("~/Areas/Finance/Views/FncExpendType/CreateEdit.cshtml", fncExpendType)); }