Пример #1
0
 public bool Save(Medicalequipment entity)
 {
     try
     {
         context.Add(entity);
         context.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        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);
        }
Пример #3
0
 public ActionResult Put([FromBody] Medicalequipment medicalequipment)
 {
     return(Ok(
                medicalequipmentService.Update(medicalequipment)
                ));
 }
Пример #4
0
 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));
 }