public AlarmPublisher getAlarmPublisher(int id) { var publisher = new AlarmPublisher(); using (var db = new HealthModelsDataContext()) { var query = db.AlarmPublishers.SingleOrDefault(targetPublisher => targetPublisher.id == id); publisher = query; } return publisher; }
public void createAlarmPublisher(string pacientName, string condition, string location, string password) { using (var db = new HealthModelsDataContext()) { var publisher = new AlarmPublisher(); publisher.pacient_name = pacientName; publisher.condition = condition; publisher.location = location; publisher.password = password; db.AlarmPublishers.InsertOnSubmit(publisher); db.SubmitChanges(); } }
public void updateAlarmPublisher(int id, string pacientName, string condition, string location, string password) { var publisher = new AlarmPublisher(); using (var db = new HealthModelsDataContext()) { publisher = db.AlarmPublishers.SingleOrDefault(targetPublisher => targetPublisher.id == id); if (publisher != null) { publisher.pacient_name = pacientName; publisher.condition = condition; publisher.location = location; publisher.password = password; db.SubmitChanges(); } } }
partial void DeleteAlarmPublisher(AlarmPublisher instance);
partial void UpdateAlarmPublisher(AlarmPublisher instance);
partial void InsertAlarmPublisher(AlarmPublisher instance);