Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,EarningType,Sequence")] FncEarningType fncEarningType)
        {
            if (id != fncEarningType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fncEarningType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FncEarningTypeExists(fncEarningType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView("~/Areas/Finance/Views/FncEarningType/CreateEdit.cshtml", fncEarningType));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,EarningType,Sequence")] FncEarningType fncEarningType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fncEarningType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView("~/Areas/Finance/Views/FncEarningType/CreateEdit.cshtml", fncEarningType));
        }