Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ResearchAreaId,FieldName,AreaDescription")] Researcharea researcharea)
        {
            if (id != researcharea.ResearchAreaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(researcharea);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ResearchareaExists(researcharea.ResearchAreaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(researcharea));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("ResearchAreaId,FieldName,AreaDescription")] Researcharea researcharea)
        {
            if (ModelState.IsValid)
            {
                _context.Add(researcharea);
                await _context.SaveChangesAsync();

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