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