示例#1
0
        //private void Searchbox_TextChanged(object sender, TextChangedEventArgs e)
        //{
        //    var binding = ((TextBox)sender).GetBindingExpression(TextBox.TextProperty);
        //    binding.UpdateSource();
        //}

        private void PatientDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (patientDataGrid.SelectedItem != null)
            {
                var v  = new PatientDetails();
                var vm = new VMPatientEdit();
                vm.P             = (Patient)patientDataGrid.SelectedItem;
                vm.IstInEditMode = true;
                v.DataContext    = vm;
                v.ShowDialog();
                if (v.DialogResult == true)  // Save in Dialogbox clicked and inputs valid
                {
                    using (KlinikDbEntities db = new KlinikDbEntities())
                    {
                        db.Entry(vm.P).State = EntityState.Modified;
                        db.SaveChanges();
                        //PropertyChanged(this, new PropertyChangedEventArgs("PatientExams"));
                    }
                }
                else
                {
                    //PropertyChanged(this, new PropertyChangedEventArgs("PatientExams"));
                }
            }
        }
示例#2
0
        public Chart()
        {
            InitializeComponent();

            var db = new KlinikDbEntities();

            UStat.ItemsSource =
                (from e in db.Employees
                 orderby e.Examinations.Count() descending
                 select new ExamStat
            {
                ID = e.Emp_Id,
                Name = e.Emp_Lastname + " " + e.Emp_Firstname,
                Exams = e.Examinations.Count(),
                Breite = e.Examinations.Count() * 20                  // Breite als Hilfswert für die Balkendarstellung
            }).ToList();
        }