예제 #1
0
 public JsonResult DelProviders(Provider _delpro)
 {
     var delitems = db.Providers.Find(_delpro.id);
     db.Providers.Remove(delitems);
     db.SaveChanges();
     var result = db.Providers.ToList();
     return Json(result, JsonRequestBehavior.AllowGet);
 }
예제 #2
0
 //get provider by id
 public JsonResult GetProviderById(Provider EdtProvider)
 {
     var getId = db.Providers.Find(EdtProvider.id);
     var data = db.Providers.Where(s => s.id == getId.id).Select(x => new { id = x.id, name = x.name, address = x.address, phone = x.phone }).FirstOrDefault();
     return Json(data, JsonRequestBehavior.AllowGet);
 }