Ejemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (createContactForm.ShowDialog() == DialogResult.OK)
     {
         CreateContactCommand command = new CreateContactCommand();
         command.Name  = createContactForm.nameTxtBx.Text;
         command.Phone = createContactForm.phoneTxtBx.Text;
         command.Addr  = createContactForm.addressTxtBx.Text;
         bll.CreateContact(command);
         bindingSource1.DataSource = bll.GetContacts();
     }
 }
Ejemplo n.º 2
0
        private void AddContact(object sender, EventArgs e)
        {
            CreateContactForm createContactForm = new CreateContactForm();

            if (createContactForm.ShowDialog() == DialogResult.OK)
            {
                CreateContactCommand command = new CreateContactCommand();
                command.Name    = createContactForm.nameTxtBx.Text;
                command.Phone   = createContactForm.phoneTxtBx.Text;
                command.Address = createContactForm.addressTxtBx.Text;
                bll.CreateContact(command);
                UpdateView();
            }
        }