public bool addItem(light_meter lightMeter) { try { using (var context = new devicesEntities()) { if (!existsLightMeter(lightMeter.serial_number)) { context.light_meter.Add(lightMeter); context.SaveChanges(); return(true); } return(false); } } catch (Exception) { return(false); } }
public bool addItem(gateway gateway) { try { using (var context = new devicesEntities()) { if (!existsGateway(gateway.serial_number)) { context.gateway.Add(gateway); context.SaveChanges(); return(true); } return(false); } } catch (Exception e) { return(false); } }