Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            APICommunicator communicator = new APICommunicator();
            int newNameID = communicator.InsertNewName(tbFirstName.Text, tbLastName.Text);
            MessageBox.Show("New Name inserted with ID: " + newNameID);

            tbFirstName.Text = "";
            tbLastName.Text = "";
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            APICommunicator communicator = new APICommunicator();
            List<Name> names = communicator.QueryForName(textBox1.Text);

            List<string> nameList = names.Select(n => n.FullName).ToList();

            listBox1.DataSource = nameList;
        }