private void Form1_Load(object sender, EventArgs e) { #if SEGURIDAD_ try { this.Hide(); moduloLogin moduloSeguridad = new moduloLogin(); moduloSeguridad.frm = this; moduloSeguridad.ShowDialog(); sql.open(); this.Text = "Comercializadora y Distribuidora \"El Sol\" S.A. de C.V. - " + sql.getNombreUsuario(ID); desabilitarTodosBotones(); sql.CheckIn(ID); if (sql.getTipoUsuario(ID) == 1) { botonModuloEmpleados.Enabled = true; botonModuloCatalogo.Enabled = true; botonModuloVentas.Enabled = true; botonModuloCompras.Enabled = true; botonModuloReportes.Enabled = true; botonCerrarSesion.Enabled = true; } else { botonModuloCatalogo.Enabled = true; botonModuloVentas.Enabled = true; botonCerrarSesion.Enabled = true; } sql.close(); this.Show(); } catch (Exception ex) { MessageBox.Show("(" + ex.Source + "): " + ex.Message, "Error"); } #else botonModuloEmpleados.Enabled = true; botonModuloCatalogo.Enabled = true; botonModuloVentas.Enabled = true; botonModuloCompras.Enabled = true; botonModuloReportes.Enabled = true; botonCerrarSesion.Visible = false; this.Text += " - Modo Admin"; #endif }