Esempio n. 1
0
 public IActionResult Edit(int id, [Bind] Student Student)
 {
     if (ModelState.IsValid)
     {
         objStudent.UpdateEmployee(id, Student);
         return(RedirectToAction("Index"));
     }
     return(View(Student));
 }
Esempio n. 2
0
 public IActionResult Update(int id, [FromBody] Student Student)
 {
     try{ if (ModelState.IsValid)
          {
              if (objStudent.UpdateEmployee(id, Student))
              {
                  return(Accepted());
              }
              return(NotFound());
          }
          else
          {
              if (objStudent.UpdateEmployee(id, Student))
              {
                  return(Accepted());
              }
              return(NotFound());
          } }catch {
         return(BadRequest());
     }
 }