Ejemplo n.º 1
0
        public VisitRedaktorViewModel(Visit Visit)
        {
            redaktorVisit = Visit;
            oldVisit      = Visit.Clone();
            var typeoOfVisitTable = new DataTable();

            typeoOfVisitTable.Columns.Add("Code", typeof(int));
            typeoOfVisitTable.Columns.Add("Name", typeof(string));
            typeoOfVisitTable.Rows.Add(0, "Первичный");
            typeoOfVisitTable.Rows.Add(1, "Повторный");
            TypeOfVisitView = typeoOfVisitTable.AsDataView();
            OnPropertyChanged("TypeOfVisitView");

            MainWindowModel.userContext.Patients.Load();
            allPatients = (MainWindowModel.userContext.Patients.Local);

            PatientsView = new ObservableCollection <UniversalType>
                               ((from p in allPatients.OrderBy(x => x.LastName).OrderBy(x => x.FirstName).OrderBy(x => x.FatherName)
                                 select new UniversalType(p.Id, p.LastName + " " + p.FirstName + " " + p.FatherName)).ToList());

            OnPropertyChanged("PatientsView");

            //       }
        }