Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "Id,AppointmentDate,Description")] Appointments appointments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(appointments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointments));
 }
Esempio n. 2
0
        public async Task <IActionResult> PutDataModel(string id, DataPlanner dataPlanner)
        {
            if (id != dataPlanner.Id)
            {
                return(BadRequest());
            }

            _context.Entry(dataPlanner).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            } catch (DbUpdateConcurrencyException) {
                if (!DataPlannerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }