Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }