static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DataBaseManager dbm = new DataBaseManager(); string retval = dbm.initialize(); if (retval.Length == 0) { System.Console.Out.WriteLine("Connected OK!"); Login.Login loginPanel = new Login.Login(dbm); Application.Run(loginPanel); } else { Application.Run(new ErrorConexion(retval)); } }
public PantallaPrincipalUsuario(DataBaseManager dbm, String userId) { _dbm = dbm; _userId = userId; Dictionary <string, string> map = new Dictionary <string, string>(); map.Add("@USER_ID", userId); SqlDataReader resultSet = _dbm.executeSelect(GET_FUNC_QUERY, map); InitializeComponent(); button1.Hide(); button2.Hide(); button3.Hide(); button4.Hide(); button5.Hide(); button6.Hide(); button7.Hide(); button8.Hide(); button9.Hide(); while (resultSet.Read()) { String nombreFuncionalidad = (String)resultSet.GetValue(resultSet.GetOrdinal("NOMBRE")); switch (nombreFuncionalidad) { case "Seguridad": button9.Show(); break; case "Abm Rol": button1.Show(); break; case "Abm Cliente": button3.Show(); break; case "Abm Proveedor": button4.Show(); break; case "Carga Credito": button2.Show(); break; case "Ofertas": button5.Show(); break; case "Comprar Oferta": button6.Show(); break; case "Facturacion": button7.Show(); break; case "Listado Estadistico": button8.Show(); break; } } }