コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Subject_Name,Subject_description,Subject_language")] Subject subject)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subject);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subject));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,School_Name,School_Address,School_Mobile,School_Webite")] School school)
        {
            if (ModelState.IsValid)
            {
                _context.Add(school);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(school));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,Student_Name,Student_age,Mobile_Number,Student_Address,Father_Name")] Student_participate student_participate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student_participate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student_participate));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,Student_participateId,SchoolId,SubjectId,Marks")] Meritlist meritlist)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meritlist);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SchoolId"] = new SelectList(_context.School, "Id", "School_Address", meritlist.SchoolId);
            ViewData["Student_participateId"] = new SelectList(_context.Student_participate, "Id", "Father_Name", meritlist.Student_participateId);
            ViewData["SubjectId"]             = new SelectList(_context.Subject, "Id", "Subject_Name", meritlist.SubjectId);
            return(View(meritlist));
        }