Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Scheduler_UserID,Scheduler_Pair,Scheduler_RequestRate,Scheduler_TargetRate,Scheduler_ActualRate")] Scheduler scheduler)
        {
            if (ModelState.IsValid)
            {
                _context.Add(scheduler);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(scheduler));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Request_ID,Request_Pair,Request_TargetRte,Email")] Request request)
        {
            if (ModelState.IsValid)
            {
                _context.Add(request);
                // Add requests to a new Currency Queue in order that they are received
                // Creating new CurrenyQueue object
                CurrencyQueue newReq = new CurrencyQueue(_context)
                {
                    Queue_UserID       = request.Request_ID,
                    Queue_CurrencyPair = request.Request_Pair,
                    Queue_Target       = request.Request_TargetRte
                };
                AddQueueTop(newReq);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Create)));
            }
            return(View(request));
        }