Ejemplo n.º 1
0
 /// <summary>
 /// Destroys the Audit.
 /// </summary>
 /// <param name="audit">The audit.</param>
 public void DestroyAudit( Audit audit )
 {
     _auditRepository.MakeTransient(audit);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the audit.
        /// </summary>
        /// <param name="visit">The visit.</param>
        /// <returns>
        /// An Audit.
        /// </returns>
        public Audit CreateAudit( Visit visit)
        {
            // TODO: This checks only the currently submitted session activities. Need to implement a solution that addresses multiple session concurrency issues.
            var auditFirst = visit.Activities.FirstOrDefault(a => a.ActivityType.WellKnownName == WellKnownNames.VisitModule.ActivityType.Audit);
            if (auditFirst != null)
            {
                return auditFirst as Audit;
            }

            var activityType = _lookupValueRepository.GetLookupByWellKnownName<ActivityType>(WellKnownNames.VisitModule.ActivityType.Audit);
            var audit = new Audit(visit, activityType);

            _auditRepository.MakePersistent(audit);

            return audit;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Destroys the Audit.
 /// </summary>
 /// <param name="audit">The audit.</param>
 public void DestroyAudit(Audit audit)
 {
     _auditRepository.MakeTransient(audit);
 }