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)); }
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()); }
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)); }