public async Task <IActionResult> Create([Bind("JobTopicTaskId,JobTopicId,TaskName,TaskOrder,Enabled")] JobSubscriptionTask jobSubscriptionTask)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobSubscriptionTask);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            ViewData["JobTopicId"] = new SelectList(_context.JobTopicSubscription, "JobTopicId", "SubscriptionName", jobSubscriptionTask.JobTopicId);
            return(View(jobSubscriptionTask));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("JobTopicId,CollectionId,TopicName,SubscriptionName,TopicOrder,IsFirstStage,Enabled")] JobTopicSubscription jobTopicSubscription)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobTopicSubscription);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            ViewData["CollectionId"] = new SelectList(_context.Collection, "CollectionId", "Name", jobTopicSubscription.CollectionId);
            return(View(jobTopicSubscription));
        }