public List<cliente_empleadoList> save(cliente_empleado o) { try { using (var db = new PruebaContext()) { db.cliente_empleado.Add(o); var validationErrors = db.GetValidationErrors(); db.SaveChanges(); return listAll(); } } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }
public List<cliente_empleadoList> update(cliente_empleado o,int id) { try { using (var db = new PruebaContext()) { var entity = db.cliente_empleado.Find(id); entity.id_evaluador = o.id_evaluador; entity.id_cliente = o.id_cliente; entity.id_empleado = o.id_empleado; db.SaveChanges(); return listAll(); } } catch (Exception) { throw; } }
public JsonResult update(cliente_empleado o,int id) { return new JsonResult { Data = new ClienteEmpleadoDB().update(o, id) }; }
public JsonResult save(cliente_empleado o) { return new JsonResult { Data = new ClienteEmpleadoDB().save(o) }; }