public async Task <IActionResult> PutUser(int id, User user) { if (id != user.U_id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutNotice(int id, Notice notice) { if (id != notice.Id) { return(BadRequest()); } _context.Entry(notice).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NoticeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "ID,Name,Email,Cell,NameOfClass,Subject")] AllTheTeacher allTheTeacher) { if (ModelState.IsValid) { db.Entry(allTheTeacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(allTheTeacher)); }
public ActionResult Edit([Bind(Include = "ID,EventName,EventDate,EventPlace,EventDetails")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Edit([Bind(Include = "ID,Roll,SBA,Final,Total,GPA,Grade")] Phy phy) { if (ModelState.IsValid) { db.Entry(phy).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(phy)); }