示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("AccountMovementsID,AccountingID,Description,Ammount")] AccountMovements accountMovements)
        {
            if (id != accountMovements.AccountMovementsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(accountMovements);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AccountMovementsExists(accountMovements.AccountMovementsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountingID"] = new SelectList(_context.Accounting, "AccountingID", "Description", accountMovements.AccountingID);
            return(View(accountMovements));
        }
示例#2
0
        public async Task <IActionResult> MyCreate(int AccountID, decimal Value, string Description)
        {
            AccountMovements accountMovements = new AccountMovements()
            {
                AccountingID = AccountID, Ammount = Value, Description = Description
            };

            _context.Add(accountMovements);
            await _context.SaveChangesAsync();

            return(Accepted());
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("AccountMovementsID,AccountingID,Description,Ammount")] AccountMovements accountMovements)
        {
            if (ModelState.IsValid)
            {
                _context.Add(accountMovements);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountingID"] = new SelectList(_context.Accounting, "AccountingID", "Description", accountMovements.AccountingID);
            return(View(accountMovements));
        }