public async Task <IActionResult> Create([Bind("ID,Name,Type")] LabWork product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
        public async Task <IActionResult> Create([Bind("ID,Name,Group,Email")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
        public async Task <IActionResult> Create([Bind("ID,FullName,Date,Address")] Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teacher);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teacher));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("ID,LabWorkID,StudentID")] StudentLabWork studentLabWork)
        {
            if (ModelState.IsValid)
            {
                _context.Add(studentLabWork);
                await _context.SaveChangesAsync();

                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> Create([Bind("ID,LabWorkID,TeacherID,Name,Date,Place")] Passing passing)
        {
            if (ModelState.IsValid)
            {
                _context.Add(passing);
                await _context.SaveChangesAsync();

                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));
        }