示例#1
0
        public IActionResult Put(int id, [FromBody] Student student)
        {
            if (id != student.StudentID)
            {
                return(NotFound());
            }
            StudentDataAccessLayer studentDataAccessLayer = new StudentDataAccessLayer();

            studentDataAccessLayer.UpdateStudent(student);
            return(Ok());
        }
示例#2
0
 public IActionResult Edit(Student student)
 {
     try
     {
         studentDataAccessLayer.UpdateStudent(student);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
 public ActionResult Edit(int id, [Bind] Student student)
 {
     if (id != student.RollNo)
     {
         return(new HttpNotFoundResult("Not Found"));
     }
     if (ModelState.IsValid)
     {
         objstudent.UpdateStudent(student);
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
示例#4
0
 public ActionResult Edit(Student student)
 {
     try
     {
         // TODO: Add update logic here
         studentDataAccessLayer.UpdateStudent(student);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
示例#5
0
 public IActionResult Edit(string id, [Bind] Student student)
 {
     if (id != student.StdId)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         objstudent.UpdateStudent(student);
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
 public void Put(int id, [FromBody] Student value)
 {
     sdal.UpdateStudent(value);
 }
        [HttpPost]// submit operation

        public ActionResult Edit(Student student)
        {
            objStudent.UpdateStudent(student);

            return(RedirectToAction("Index"));
        }
示例#8
0
 public int Edit([FromBody] Student Student)
 {
     return(objStudent.UpdateStudent(Student));
 }