示例#1
0
        public DrugPage()
        {
            _drugController = (Application.Current as App).DrugController;
            InitializeComponent();
            DrugList           = new ObservableCollection <DrugView>();
            DrugListUnapproved = new ObservableCollection <DrugView>();


            List <Drug> drugs = new List <Drug>();

            drugs = _drugController.GetAll();

            for (int i = 0; i < drugs.Count; i++)
            {
                if (drugs[i].Approved)
                {
                    DrugList.Add(new DrugView(drugs[i]));
                }
                else
                {
                    DrugListUnapproved.Add(new DrugView(drugs[i]));
                }
            }

            dataGrid.ItemsSource = DrugList;
            dataGridAlternativeDrug.ItemsSource = DrugListUnapproved;
        }