Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Type")] LabWork labwork)
        {
            if (id != labwork.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(labwork);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LabWorkExists(labwork.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(labwork));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,LabWorkID,StudentID")] StudentLabWork studentLabWork)
        {
            if (id != studentLabWork.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(studentLabWork);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StudentLabWorkExists(studentLabWork.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LabWorkID"] = new SelectList(_context.LabWorks, "ID", "Name", studentLabWork.LabWorkID);
            ViewData["StudentID"] = new SelectList(_context.Student, "ID", "FullName", studentLabWork.StudentID);
            return(View(studentLabWork));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Group,Email")] Student student)
        {
            if (id != student.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(student);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StudentExists(student.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,LabWorkID,TeacherID,Name,Date,Place")] Passing passing)
        {
            if (id != passing.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(passing);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PassingExists(passing.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TeacherID"] = new SelectList(_context.Teachers, "ID", "Address", passing.TeacherID);
            ViewData["LabWorkID"] = new SelectList(_context.LabWorks, "ID", "Name", passing.LabWorkID);
            return(View(passing));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,FullName,Date,Address")] Teacher teacher)
        {
            if (id != teacher.ID)
            {
                return(NotFound());
            }

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