Example #1
0
        public Visit GetVisit(int id)
        {
            VisitEntity   visitEntity   = _repo.GetVisit(id);
            PatientEntity patientEntity = _patientRepo.GetPatient(visitEntity.PatientId);
            DentistEntity dentistEntity = _dentistRepo.GetDentist(visitEntity.DentistId);

            Visit visit = _converter.Convert(visitEntity, dentistEntity, patientEntity);

            return(visit);
        }
Example #2
0
        public VisitEntity Convert(Visit source)
        {
            VisitEntity destination = _repo.GetVisit(source.Id);

            if (destination == null)
            {
                return new VisitEntity
                       {
                           Balance               = source.Balance,
                           DentistId             = source.Dentist.Id,
                           InsuranceCompany      = source.InsuranceCompany,
                           InsurancePolicyNumber = source.InsurancePolicyNumber,
                           PaidAmount            = source.PaidAmount,
                           PatientId             = source.Patient.Id,
                           TotalCost             = source.TotalCost,
                           VisitDate             = source.VisitDate,
                           VisitId               = source.Id
                       }
            }
            ;

            return(destination);
        }