Beispiel #1
0
        private TagRegistrationDto GetByPatientId(int patientId)
        {
            TagRegistrationDto result = new TagRegistrationDto();

            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.TagRegistration, string.Format(UrgentAppQueries.TAGREGISTRATION_SELECT_BYPATIENTID, patientId));

            result = baseMapper.BindData <TagRegistrationDto>(ds.TagRegistration);

            return(result);
        }
Beispiel #2
0
        private void CheckForPKViolations(TagRegistrationDto tagRegistration)
        {
            var check = GetByTagId(tagRegistration.Tag_Id);

            if (check != null)
            {
                throw new ApplicationException();
            }

            var tagCheck = tagTasks.GetById(tagRegistration.Tag_Id);

            if (tagCheck == null)
            {
                throw new ApplicationException();
            }
        }
Beispiel #3
0
        public void Create(TagRegistrationDto tagRegistration)
        {
            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            CheckForPKViolations(tagRegistration);

            string query = string.Format(
                UrgentAppQueries.TAGREGISTRATION_INSERT,
                tagRegistration.Id,
                tagRegistration.Tag_Id,
                tagRegistration.Patient_Id
                );

            DbTools.ExecuteQuery(
                FireBirdConnection.Connection, query);
        }