示例#1
0
        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());
        }
示例#2
0
        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));
 }
示例#4
0
 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));
 }
示例#5
0
 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));
 }