Ejemplo n.º 1
0
        public void cargarFormulario(Object sender, EventArgs e)
        {
            try
            {
                var            menuItem             = (ToolStripMenuItem)sender;
                var            NombreNuevaInstancia = Assembly.GetExecutingAssembly().GetName().Name;
                InformacionTag info = new InformacionTag();
                info = (InformacionTag)menuItem.Tag;
                Type vTipo = null;
                var  a     = Assembly.GetExecutingAssembly().GetTypes();
                foreach (var item in a)
                {
                    if (item.Name.Equals(info.NombreForm))
                    {
                        vTipo = Assembly.GetExecutingAssembly().GetType(item.FullName);
                        break;
                    }
                }

                if (vTipo != null)
                {
                    var vFormulario = (Form)Activator.CreateInstance(vTipo);
                    vFormulario.Tag = info.IdMenu;
                    GeneralC.cargarForm(vFormulario, this);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public MenuStrip cargarMenu()
        {
            MenuStrip     menu       = new MenuStrip();
            List <string> parametros = new List <string>();

            parametros.Add(Sesion.IdRol.ToString());
            Sesion.dtmenu     = GeneralC.cargarResultadosSQL(Sentencias.SEG_ARMAR_MENU, parametros);
            Sesion.dtPermisos = GeneralC.cargarResultadosSQL(Sentencias.SEG_LLENAR_PERMISOS, parametros);
            return(colocarPadres(menu));
        }
Ejemplo n.º 3
0
 public static void llenarComboDependiente(ComboBox comboPadre, ComboBox comboHijo, string query)
 {
     if (comboPadre.SelectedIndex > 0)
     {
         string filtro = (comboPadre.SelectedIndex == 0) ? Util.Constantes.ConstanteGeneral.PREDETERMINADA : comboPadre.SelectedValue.ToString();
         GeneralC.llenarCombo(query + " " + filtro + "",
                              Util.Constantes.ConstanteGeneral.VALUEMEMBER,
                              Util.Constantes.ConstanteGeneral.DISPLAYMEMBER,
                              comboHijo);
         GeneralC.validarComboUbicacion(comboPadre, comboHijo);
     }
 }
Ejemplo n.º 4
0
        public bool iniciarSesion(List <string> listaParametros)
        {
            DataRow filaResultado = null;

            filaResultado = GeneralC.devuelveUnaFila(Sentencias.SEG_AUTENTICACION, listaParametros);
            if (filaResultado != null)
            {
                Sesion.IdRol     = (int)filaResultado.ItemArray[0];
                Sesion.IdUsuario = (int)filaResultado.ItemArray[1];
                Sesion.nombre    = filaResultado.Field <string>("Nombre");
                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
 public static void listarDocumentosGenerales(string query,
                                              List <string> parametros,
                                              GeneralC.cargarInfoFila metodo,
                                              string titulo)
 {
     try
     {
         GeneralC.buscarDevuelveFila(Sentencias.PARAMETROS_LISTAR_DOCUMENTOS,
                                     parametros,
                                     new GeneralC.cargarInfoFila(metodo),
                                     titulo,
                                     true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Mensajes.NOMBRE_SOFT, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }