public ActionResult Edit(Sick sick)
        {
            db.Entry(sick).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,StudentName,StudentCode")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "Id,name,decription")] Roles roles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roles));
 }
 public ActionResult Edit([Bind(Include = "Id,BookName,ISBN,DatePublish,Publisher,Author")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(book));
 }
Exemple #5
0
 public ActionResult Edit([Bind(Include = "Id,BookId,StatusId,Date,StudentId")] IssueBook issueBook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(issueBook).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookId    = new SelectList(db.Books, "Id", "BookName", issueBook.BookId);
     ViewBag.StatusId  = new SelectList(db.Status, "Id", "Status1", issueBook.StatusId);
     ViewBag.StudentId = new SelectList(db.Students, "Id", "StudentName", issueBook.StudentId);
     return(View(issueBook));
 }
Exemple #6
0
 public IHttpActionResult Patch(int Id, [FromBody] medical_card medical)
 {
     try
     {
         db.Entry(medical).State = EntityState.Modified;
         db.SaveChanges();
         return(Ok(medical));
     }
     catch (Exception error)
     {
         return(InternalServerError(error));
     }
 }