コード例 #1
0
        public async Task <IActionResult> Putmanagement(int id, management management)
        {
            if (id != management.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "BrandID,BrandName")] Brand brand)
 {
     if (ModelState.IsValid)
     {
         db.Entry(brand).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(brand));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "VehicleID,LicencePlate,Color,EngineCapacity,Fuel,BrandID")] Vehicle vehicle)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicle).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BrandID = new SelectList(db.Brands, "BrandID", "BrandName", vehicle.BrandID);
     return(View(vehicle));
 }