Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(string id, [Bind("Session,studentname,email,problemDetails,DrugList")] DailyStudentServiceList dailyStudentServiceList)
        {
            if (id != dailyStudentServiceList.Session)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(dailyStudentServiceList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DailyStudentServiceListExists(dailyStudentServiceList.Session))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(dailyStudentServiceList));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(string id, [Bind("name,amount,Session")] DrugInfoPerStudent drugInfoPerStudent)
        {
            if (id != drugInfoPerStudent.name)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(drugInfoPerStudent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DrugInfoPerStudentExists(drugInfoPerStudent.name))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(drugInfoPerStudent));
        }