Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Balance,Name,UnitSize,ExpectedPriceChange,RiskFreeInterestRate")] TradingAccount tradingAccount)
        {
            if (id != tradingAccount.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tradingAccount);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TradingAccountExists(tradingAccount.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(tradingAccount));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Ask,Bid,Contents,Delta,Quantity,Strike")] Option option)
        {
            if (id != option.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(option);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OptionExists(option.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(option));
        }