示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("id,name,quantity,isDeleted,deleted_at,deleted_by,created_at,created_by,updated_at,updated_by")] TypeMoneys typeMoneys)
        {
            if (id != typeMoneys.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(typeMoneys);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TypeMoneysExists(typeMoneys.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeMoneys));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("id,name,quantity,isDeleted,deleted_at,deleted_by,created_at,created_by,updated_at,updated_by")] TypeMoneys typeMoneys)
        {
            if (ModelState.IsValid)
            {
                _context.Add(typeMoneys);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeMoneys));
        }