示例#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 ClienteRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     if (((RadioButton)sender).Checked)
     {
         this.DatosPanel.Controls.Clear();
         this.SuspendLayout();
         altaClieForm = new AltaClienteForm();
         mostrarEnPanel(altaClieForm);
         tipoUsuario = TIPO_CLIENTE;
         this.ResumeLayout();
     }
 }
示例#3
0
        private void nuevoClienteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AltaClienteForm newClienteForm = new AltaClienteForm(new Cliente());

            newClienteForm.ShowDialog();
        }