Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("StudyStatusId,StudyStatusDesc")] StudyStatus studyStatus)
        {
            if (id != studyStatus.StudyStatusId)
            {
                return(RedirectToAction("Index", "Errors"));
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(studyStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StudyStatusExists(studyStatus.StudyStatusId))
                    {
                        return(RedirectToAction("Index", "Errors"));
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(studyStatus));
        }
Ejemplo n.º 2
0
        public Study(string institution, string title, StudyStatus status)
        {
            Institution = institution;
            Title       = title;
            Status      = status;

            Validate();
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("StudyStatusId,StudyStatusDesc")] StudyStatus studyStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(studyStatus);
                await _context.SaveChangesAsync();

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