private void btnCargar_Click(object sender, EventArgs e) { Form v = new AltaProveedor(menu); v.Show(); this.Hide(); }
// Alta private void btn_alta_Click(object sender, EventArgs e) { var altaProv = new AltaProveedor(); altaProv.Show(); gridProveedores.DataSource = null; }
private void button1_Click(object sender, EventArgs e) { AltaProveedor alta = new AltaProveedor(); alta.Show(); this.Hide(); }
private void btnLimpiar_Click(object sender, EventArgs e) { AltaProveedor newForm = new AltaProveedor(previousForm); newForm.Show(); this.Dispose(false); }
private void button1_Click(object sender, EventArgs e) { int indice = ComboBox_Rol.SelectedIndex; if (indice == -1 || Usuario.Text == "" || Password.Text == "") { MessageBox.Show("Faltan completar campos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (this.verificar_estado_rol()) { return; } SqlCommand verificacion_usuario = new SqlCommand("ZTS_DB.verificar_existencia_de_usuario", conexion_sql); verificacion_usuario.CommandType = CommandType.StoredProcedure; verificacion_usuario.Parameters.AddWithValue("@username", SqlDbType.Char).Value = Usuario.Text; conexion_sql.Open(); try { verificacion_usuario.ExecuteNonQuery(); switch (ComboBox_Rol.SelectedItem.ToString()) { case "Cliente": Form registroCliente = new AbmCliente.AltaCliente(Usuario.Text, Password.Text, ComboBox_Rol.SelectedItem.ToString(), this, bit_Accion); this.Hide(); registroCliente.Show(); break; case "Proveedor": Form registroProveedor = new AbmProveedor.AltaProveedor(Usuario.Text, Password.Text, ComboBox_Rol.SelectedItem.ToString(), this, bit_Accion); this.Hide(); registroProveedor.Show(); break; } } catch (Exception) { MessageBox.Show("Nombre de Usuario ya existente.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } conexion_sql.Close(); }