public async Task <IActionResult> Edit(int id, [Bind("id,ClientID,ClientTradingProfileName,CurrencyPairID,Price,DateTimeModified,DateTimeAdded")] ClientTradingProfile clientTradingProfile)
        {
            if (id != clientTradingProfile.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    clientTradingProfile.DateTimeModified = Utility.GetLocalDateTime();
                    _context.Update(clientTradingProfile);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientTradingProfileExists(clientTradingProfile.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.Client       = new SelectList(_context.Client.OrderBy(m => m.ClientName).ToList(), "id", "ClientName");
            ViewBag.CurrencyPair = new SelectList(_context.CurrencyPair.OrderBy(m => m.CurrencyPairName).ToList(), "id", "CurrencyPairName");

            return(View(clientTradingProfile));
        }
        public async Task <IActionResult> Create([Bind("id,ClientID,ClientTradingProfileName,CurrencyPairID,Price,DateTimeModified,DateTimeAdded")] ClientTradingProfile clientTradingProfile)
        {
            if (ModelState.IsValid)
            {
                clientTradingProfile.DateTimeModified = Utility.GetLocalDateTime();
                clientTradingProfile.DateTimeAdded    = Utility.GetLocalDateTime();
                _context.Add(clientTradingProfile);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.Client       = new SelectList(_context.Client.OrderBy(m => m.ClientName).ToList(), "id", "ClientName");
            ViewBag.CurrencyPair = new SelectList(_context.CurrencyPair.OrderBy(m => m.CurrencyPairName).ToList(), "id", "CurrencyPairName");

            return(View(clientTradingProfile));
        }