public async Task <IActionResult> Edit(int id, [Bind("Id,Subject_Name,Subject_description,Subject_language")] Subject subject)
        {
            if (id != subject.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(subject);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SubjectExists(subject.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(subject));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,School_Name,School_Address,School_Mobile,School_Webite")] School school)
        {
            if (id != school.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(school);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SchoolExists(school.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(school));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Student_Name,Student_age,Mobile_Number,Student_Address,Father_Name")] Student_participate student_participate)
        {
            if (id != student_participate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(student_participate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Student_participateExists(student_participate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(student_participate));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Student_participateId,SchoolId,SubjectId,Marks")] Meritlist meritlist)
        {
            if (id != meritlist.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(meritlist);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MeritlistExists(meritlist.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }