public bool Save(Medicalequipment entity) { try { context.Add(entity); context.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }
public bool Update(Medicalequipment entity) { try { var medicalequipmentOrigina = context.Medicalequipments.Single( x => x.Id == entity.Id ); medicalequipmentOrigina.Id = entity.Id; medicalequipmentOrigina.Statedescription = entity.Statedescription; medicalequipmentOrigina.Brand = entity.Brand; medicalequipmentOrigina.Name = entity.Name; context.Update(medicalequipmentOrigina); context.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }
public ActionResult Put([FromBody] Medicalequipment medicalequipment) { return(Ok( medicalequipmentService.Update(medicalequipment) )); }
public ActionResult Post([FromBody] Medicalequipment medicalequipment) { return(Ok( medicalequipmentService.Save(medicalequipment) )); }
public bool Update(Medicalequipment entity) { return(medicalequipmentRepository.Update(entity)); }
public bool Save(Medicalequipment entity) { return(medicalequipmentRepository.Save(entity)); }