Esempio n. 1
0
        private void LoadAllPerson()
        {
            var personProvider = new PersonProvider(new DatabaseProvider());
            var persons        = personProvider.Load();

            AddToDictionary(persons);
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            var            person   = new Person("имя", "фамилия", "отчество", new DateTime(1666, 12, 12));
            var            provider = new PersonProvider(new DatabaseProvider());
            IList <Person> persons  = provider.Load();

            provider.Save(ref person);
            persons = provider.Load();

            person.FirstName = "Другое имя";
            provider.Update(person);
            persons = provider.Load();

            provider.Remove(person);
            persons = provider.Load();
            // String strConnString = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
            //   SqlConnection con = new SqlConnection(strConnString);
        }
Esempio n. 3
0
        private void SelectUserButton_Click(object sender, RoutedEventArgs e)
        {
            var            personProvider = new PersonProvider(new DatabaseProvider());
            IList <Person> persons        = personProvider.Load();

            if (persons.Count == 0)
            {
                MessageBox.Show("База данных пациентов пуста!", "Error!");
                return;
            }

            Switcher.PageSwitcher.Navigate(new SelectUser());
        }