예제 #1
0
        private void newUserBtn_Click(object sender, EventArgs e)
        {
            try
            {
                this.verificarCamposObligatorios();
                if (tipoComboBox.SelectedItem.Equals("Cliente"))
                {
                    var nuevaEntidadForm = new AltaClienteForm(userBox.Text, passBox.Text);

                    if (nuevaEntidadForm.ShowDialog(this) != DialogResult.OK)

                    {
                        throw new Exception("Operacion cancelada");
                    }
                }
                else
                {
                    var nuevaEntidadForm = new AltaEmpresaForm(userBox.Text, passBox.Text);
                    if (nuevaEntidadForm.ShowDialog(this) != DialogResult.OK)
                    {
                        throw new Exception("Operacion cancelada");
                    }
                }

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
예제 #2
0
        private void nuevoClienteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AltaClienteForm newClienteForm = new AltaClienteForm(new Cliente());

            newClienteForm.ShowDialog();
        }