public async Task <IActionResult> Create([Bind("StudentId,StudentName,StudentGender,StudentAddress,FatherName,FatherPhone,MotherName,MotherPhone,Email,DateOfBirth")] Students students)
        {
            if (ModelState.IsValid)
            {
                _context.Add(students);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(students));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("SectionId,SectionName")] Sections sections)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sections);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sections));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("UserId,UserType,Password,FirstName,LastName,Email")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("TeacherId,TeacherName,TeacherPhone,TeacherEmail,TeacherGender,TeacherAddress,DateOfBirth")] Teachers teachers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teachers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teachers));
        }
        public async Task <IActionResult> Create([Bind("AdminId,AdminName,AdminPhone,AdminEmail")] Admins admins)
        {
            if (ModelState.IsValid)
            {
                _context.Add(admins);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(admins));
        }
예제 #6
0
        public async Task <IActionResult> Create([Bind("ClassId,ClassName")] Classes classes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(classes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(classes));
        }
        public async Task <IActionResult> Create([Bind("SubjectId,SubjectName")] Subjects subjects)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subjects);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SubjectId"] = new SelectList(_context.Subjects, "SubjectId", "SubjectName", subjects.SubjectId);
            return(View(subjects));
        }