Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("TwitterAccountId,Name,LastUpdated,Template")] TwitterAccount twitterAccount)
        {
            if (id != twitterAccount.TwitterAccountId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(twitterAccount);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TwitterAccountExists(twitterAccount.TwitterAccountId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(twitterAccount));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("TrasferID,IncomingAddress,OutgoingAddress,Date,Value,Token,UsdValue")] Transfer transfer)
        {
            if (id != transfer.TrasferID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(transfer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TransferExists(transfer.TrasferID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(transfer));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title")] Exchange exchange)
        {
            if (id != exchange.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(exchange);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExchangeExists(exchange.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(exchange));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("NotificationID,Description,Action,DateTime,Value")] Notification notification)
        {
            if (id != notification.NotificationID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(notification);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NotificationExists(notification.NotificationID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(notification));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("UserID,Login,Password")] User user)
        {
            if (id != user.UserID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.UserID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("TokenID,Decimals,Name,ShortName,Contract,IsObserved,PercentForNotification,TotalSupply")] Token token)
        {
            if (id != token.TokenID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(token);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TokenExists(token.TokenID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(token));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("WalletID,Name,Address,Comment,ExchangeId")] Wallet wallet)
        {
            if (id != wallet.WalletID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(wallet);

                    wallet.Exchange = GetExhangeById(wallet.ExchangeId == null ? 0 : (int)wallet.ExchangeId);

                    if (wallet.Exchange != null)
                    {
                        wallet.Exchange.NotifyOnNextUpdate = false;
                    }
                    else
                    {
                        wallet.ExchangeId = null;
                    }
                    await _context.SaveChangesAsync();
                }
                catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException)
                {
                    if (!WalletExists(wallet.WalletID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ExchangesDropDownList(wallet.Exchange);

            return(View(wallet));
        }