public ActionResult DESTINO_LOGISTIC_Create([DataSourceRequest] DataSourceRequest request, DESTINO_LOGISTIC dESTINO_LOGISTIC) { if (ModelState.IsValid) { var entity = new DESTINO_LOGISTIC { dest_name = dESTINO_LOGISTIC.dest_name, dest_addres = dESTINO_LOGISTIC.dest_addres }; db.DESTINO_LOGISTIC.Add(entity); db.SaveChanges(); dESTINO_LOGISTIC.dest_id = entity.dest_id; } return(Json(new[] { dESTINO_LOGISTIC }.ToDataSourceResult(request, ModelState))); }
public ActionResult DESTINO_LOGISTIC_Update([DataSourceRequest] DataSourceRequest request, DESTINO_LOGISTIC dESTINO_LOGISTIC) { if (ModelState.IsValid) { var entity = new DESTINO_LOGISTIC { dest_id = dESTINO_LOGISTIC.dest_id, dest_name = dESTINO_LOGISTIC.dest_name, dest_addres = dESTINO_LOGISTIC.dest_addres }; db.DESTINO_LOGISTIC.Attach(entity); db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); } return(Json(new[] { dESTINO_LOGISTIC }.ToDataSourceResult(request, ModelState))); }