コード例 #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 EmpresaRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     if (((RadioButton)sender).Checked)
     {
         this.DatosPanel.Controls.Clear();
         this.SuspendLayout();
         altaEmpresaForm = new AltaEmpresaForm();
         mostrarEnPanel(altaEmpresaForm);
         tipoUsuario = TIPO_EMPRESA;
         this.ResumeLayout();
     }
 }
コード例 #3
0
        private void nuevaEmpresaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AltaEmpresaForm newEmpresaForm = new AltaEmpresaForm(new Empresa());

            newEmpresaForm.ShowDialog();
        }