コード例 #1
0
 public ActionResult EditUnit([Bind(Include = "UnitId,UnitName,IsActive")] Unit unit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(unit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UnitsLists"));
     }
     return(View(unit));
 }
コード例 #2
0
 public async Task <ActionResult> BrandEdit([Bind(Include = "VehicleBrandId,BrandName,IsActive")] VehicleBrand brand)
 {
     if (ModelState.IsValid)
     {
         db.Entry(brand).State = EntityState.Modified;
         try
         {
             await db.SaveChangesAsync();
         }
         catch (Exception e)
         {
             string s = e.ToString();
         }
         return(Json(new { success = true }));
     }
     return(PartialView("_BrandEdit", brand));
 }