public ActionResult Edit([Bind(Include = "Id,PlantationId,WarehouseId,ScheduledDate,ClosedDate,Status")] Supply supply)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supply).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PlantationId = new SelectList(db.Plantations, "Id", "Name", supply.PlantationId);
     ViewBag.WarehouseId  = new SelectList(db.Warehouses, "Id", "Name", supply.WarehouseId);
     return(View(supply));
 }
 public ActionResult Edit([Bind(Include = "Id,PlantationId,Amount,FlowerId")] PlantationFlower plantationFlower)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plantationFlower).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FlowerId     = new SelectList(db.Flowers, "Id", "Name", plantationFlower.FlowerId);
     ViewBag.PlantationId = new SelectList(db.Plantations, "Id", "Name", plantationFlower.PlantationId);
     return(View(plantationFlower));
 }
Beispiel #3
0
 public void Update(T entity)
 {
     _context.Entry(entity).State = EntityState.Modified;
     Save();
 }
Beispiel #4
0
 public virtual void Update(T entity)
 {
     dbSet.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
 }