Esempio n. 1
0
        private void StartEvaluation()
        {
            var physicianId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId;
            var physicianEvaluationRepository = IoC.Resolve <IPhysicianEvaluationRepository>();
            var evaluation = physicianEvaluationRepository.GetPhysicianEvaluationinTransaction(EventCustomerId, physicianId);

            if (evaluation == null || evaluation.IsPrimaryEvaluator == IsforOveread)
            {
                evaluation = new PhysicianEvaluation
                {
                    PhysicianId         = physicianId,
                    EventCustomerId     = EventCustomerId,
                    EvaluationStartTime = DateTime.Now,
                    IpAddress           = Request.UserHostAddress,
                    IsPrimaryEvaluator  = !IsforOveread
                };
            }
            else
            {
                evaluation.EvaluationStartTime = DateTime.Now;
                evaluation.IpAddress           = Request.UserHostAddress;
            }

            physicianEvaluationRepository.Save(evaluation);
        }
Esempio n. 2
0
        public PhysicianEvaluation Save(PhysicianEvaluation physicianEvaluation)
        {
            using (var adapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var entityToSave = _mapper.Map(physicianEvaluation);

                if (!adapter.SaveEntity(entityToSave, true))
                {
                    throw new PersistenceFailureException();
                }

                return(_mapper.Map(entityToSave));
            }
        }