public void createPublishedAlarm(int alarmId, int publisherId)
        {
            using (var db = new HealthModelsDataContext())
            {
                var publishedAlarm = new PublishedAlarm();

                publishedAlarm.alarmId = alarmId;
                publishedAlarm.publisherId = publisherId;

                db.PublishedAlarms.InsertOnSubmit(publishedAlarm);
                db.SubmitChanges();
            }
        }
        public int getPublisherId(int alarmId)
        {
            int publisherId = 0;

            using (var db = new HealthModelsDataContext())
            {
                var query = db.PublishedAlarms.SingleOrDefault(targetPublished => targetPublished.alarmId == alarmId);
                var publishedAlarm = new PublishedAlarm();
                publishedAlarm = query;
                publisherId = publishedAlarm.publisherId;
            }

            return publisherId;
        }
		private void detach_PublishedAlarms(PublishedAlarm entity)
		{
			this.SendPropertyChanging();
			entity.Alarm = null;
		}
 partial void DeletePublishedAlarm(PublishedAlarm instance);
 partial void UpdatePublishedAlarm(PublishedAlarm instance);
 partial void InsertPublishedAlarm(PublishedAlarm instance);
		private void attach_PublishedAlarms(PublishedAlarm entity)
		{
			this.SendPropertyChanging();
			entity.AlarmPublisher = this;
		}