Inheritance: IPersonsProvider
Exemplo n.º 1
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());
        }
Exemplo 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);
        }
Exemplo n.º 3
0
 private void Search(string lastName, string firstName)
 {
     var personProvider = new PersonProvider(new DatabaseProvider());
     IList<Person> persons = personProvider.Search(firstName, lastName);
     AddToDictionary(persons);
 }
Exemplo n.º 4
0
 private void LoadAllPerson()
 {
     var personProvider = new PersonProvider(new DatabaseProvider());
     IList<Person> persons = personProvider.Load();
     AddToDictionary(persons);
 }
Exemplo n.º 5
0
 private void SavePerson(Person person)
 {
     var personProvider = new PersonProvider(new DatabaseProvider());
     personProvider.Save(ref person);
 }