Esempio n. 1
0
        private void btnClientAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (partnerController.CheckPartner(txbPartnerDNI.Text) == null)
                {
                    Partner partner = new Partner(partnerID, lastName, firstName, DNI, address, phone);
                    partner.LastName  = txbPartnerLastName.Text;
                    partner.FirstName = txbPartnerFirstName.Text;
                    partner.DNI       = txbPartnerDNI.Text;
                    partner.Address   = txbClientAddress.Text;
                    partner.Phone     = txbClientPhone.Text;

                    if (partnerController.AddPartner(partner) != null)
                    {
                        MessageBox.Show("Se agregó un cliente con éxito.");
                    }
                }
                else
                {
                    MessageBox.Show("Ya existe una persona con ese DNI.");
                }

                updateAll();
            }
            catch (Exception ex)
            {
                error = ex.Message;
                MessageBox.Show(error);
            }
        }