Exemplo n.º 1
0
        private void ListAllButton_Click(object sender, RoutedEventArgs e)
        {
            DataAcces db = new DataAcces();

            people = db.ListAll();
            UpdateBinding();
        }
Exemplo n.º 2
0
        private void UpdateButon_Click(object sender, RoutedEventArgs e)
        {
            DataAcces db = new DataAcces();

            db.Insert(FirstNameContent.Text, LastNameContent.Text, JobContent.Text, PhoneContent.Text, EmailContent.Text);
            FirstNameContent.Text = "";
            LastNameContent.Text  = "";
            JobContent.Text       = "";
            PhoneContent.Text     = "";
            EmailContent.Text     = "";
        }
Exemplo n.º 3
0
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataAcces db = new DataAcces();
                if (FirstNameContent.Text != "")
                {
                    people = db.GetPeople(FirstNameContent.Text);
                }
                else if (LastNameContent.Text != "")
                {
                    people = db.GetPeople(LastNameContent.Text);
                }
                else if (JobContent.Text != "")
                {
                    people = db.GetPeople(JobContent.Text);
                }
                else if (PhoneContent.Text != "")
                {
                    people = db.GetPeople(PhoneContent.Text);
                }
                else if (EmailContent.Text != "")
                {
                    people = db.GetPeople(EmailContent.Text);
                }
                else if ((FirstNameContent.Text != "") && (LastNameContent.Text != "") && (JobContent.Text != "") && (PhoneContent.Text != "") && (EmailContent.Text != ""))
                {
                    people = db.GetALLPeople(FirstNameContent.Text, LastNameContent.Text, JobContent.Text, PhoneContent.Text, EmailContent.Text);
                }


                UpdateBinding();

                FirstNameContent.Text = "";
                LastNameContent.Text  = "";
                JobContent.Text       = "";
                PhoneContent.Text     = "";
                EmailContent.Text     = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }