Example #1
0
        private DataContainerViewModel CreateVisitDataModel(int patientNumber, string visitName, string formName)
        {
            Visit visit = visitRepository.GetVisitByPatientNumberAndVisitName(patientNumber, visitName);

            if (visit == null)
            {
                return(null);
            }

            var model = new DataContainerViewModel {
                Id                = visit.Id,
                PatientNumber     = patientNumber,
                SelectedVisitName = visitName,
                SelectedFormName  = formName,
                Children          = new List <ConteinerChildViewModel>(from form in visit.Forms
                                                                       orderby form.OrderNo
                                                                       select new ConteinerChildViewModel {
                    Id      = form.Id,
                    Caption = form.Caption,
                    OrderNo = form.OrderNo
                })
            };

            return(model);
        }