public async Task <IActionResult> PutBattery(int id, Battery battery)
        {
            if (id != battery.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutLead(long id, Lead lead)
        {
            if (id != lead.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> PutElevator(int id, Elevator elevator)
        {
            if (id != elevator.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
 public ActionResult Edit([Bind(Include = "ID,Email,Password")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "ID,Description,DueDateTime")] Task task)
 {
     if (ModelState.IsValid)
     {
         db.Entry(task).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(task));
 }
示例#6
0
        public async Task <IActionResult> PutTodoItem(int?id, Taxon item)
        {
            if (id != item.TaxonId)
            {
                return(BadRequest());
            }

            _infContext.Entry(item).State = EntityState.Modified;
            await _infContext.SaveChangesAsync();

            return(NoContent());
        }