public void getDatos() { UI_InicioDeSesion man = new UI_InicioDeSesion(); staticSesionState = man.loginProcess(); if (staticSesionState == true) { nickname = man.getNickname(); userImg_path = man.getImg_Path(); cadenaPermisos = man.getPermisos(); } else { staticSesionState = false; } stateOfSesion(); if (cadenaPermisos != "" && firstIn == true) { CargarPermisos1(); firstIn = false; } }
public void stateOfSesion() { if (staticSesionState == false) { UI_InicioDeSesion man = new UI_InicioDeSesion(); cargarPanel(man); mostrarSubpaneles(panelSubMenuInventarios); panelSubMenuInventarios.Visible = false; panelMenu.Visible = false; panelUserProfile.Visible = false; //MessageBox.Show(man.Name); } else if (staticSesionState == true) { labelNickname.Text = nickname; if (userImg_path == "" || userImg_path == " ") { pictureBoxUserPhoto.BackgroundImage = pictureBoxUserPhoto.ErrorImage; } else { pictureBoxUserPhoto.BackgroundImage = Image.FromFile(userImg_path); } if (cadenaPermisos == "0000000") { panelMenu.Visible = false; panelSubMenuInventarios.Visible = false; panelUserProfile.Visible = true; mostrarSubpaneles(panelSubMenuInventarios); panelSubMenuInventarios.Visible = false; UI_SinPermisos man = new UI_SinPermisos(); cargarPanel(man); } else { panelMenu.Visible = true; panelUserProfile.Visible = true; } obtenerPermisos(); /*if (cadenaPermisos[0] == '1') * { * mostrarSubpaneles(panelSubMenuDashboard); * moverPanelSeguimiento(buttonHome); * moverPanelSeguimientoSubmenu(button10, panelSeguimientoDashboard); * UI_GeneralGraph man = new UI_GeneralGraph(); * cargarPanel(man); * } * else * if (cadenaPermisos[1] == '1') * { * mostrarSubpaneles(panelSubMenuInventarios); * moverPanelSeguimientoSubmenu(button1, panelSeguimientoSubmenuInv); * moverPanelSeguimiento(buttonInventarios); * string valorMenor = ConfigurationManager.AppSettings["ValorMenor"]; * string valorMayor = ConfigurationManager.AppSettings["ValorMayor"]; * MantenimientoProductos.UI_MantenimientoProductos man = new MantenimientoProductos.UI_MantenimientoProductos(panelContenedor, button3, panelSeguimientoSubmenuInv, valorMenor, valorMayor); * cargarPanel(man); * } * else * if (cadenaPermisos[2] == '1') * { * moverPanelSeguimientoSubmenu(button8, panelSeguimientoSubmenuCom); * mostrarSubpaneles(panelSubMenuCompras); * moverPanelSeguimiento(buttonCompras); * string valorMenor = ConfigurationManager.AppSettings["ValorMenor"]; * UI_ConsultaCompras man = new UI_ConsultaCompras(valorMenor, panelContenedor, button7, panelSeguimientoSubmenuCom); * cargarPanel(man); * } * else * if (cadenaPermisos[3] == '1') * { * moverPanelSeguimientoSubmenu(button12, panelSeguimientoSubmenuVen); * mostrarSubpaneles(panelSubMenuVentas); * moverPanelSeguimiento(buttonVentas); * string valorMenor = ConfigurationManager.AppSettings["ValorMenor"]; * UI_ConsultaVentas man = new UI_ConsultaVentas(valorMenor, panelContenedor, button11, panelSeguimientoSubmenuVen); * cargarPanel(man); * } * else * if (cadenaPermisos[4] == '1') * { * moverPanelSeguimientoSubmenu(button16, panelSeguimientoSubmenuDev); * mostrarSubpaneles(panelSubMenuDevoluciones); * moverPanelSeguimiento(buttonDevoluciones); * string valorMenor = ConfigurationManager.AppSettings["ValorMenor"]; * UI_ConsultaDevoluciones man = new UI_ConsultaDevoluciones(valorMenor, panelContenedor, button15, panelSeguimientoSubmenuDev); * cargarPanel(man); * } * else * if (cadenaPermisos[5] == '1') * { * mostrarSubpaneles(panelSubMenuClientes); * moverPanelSeguimientoSubmenu(button19, panelSeguimientoClientes); * moverPanelSeguimiento(buttonClientes); * UI_ConsultaClientes man = new UI_ConsultaClientes(panelContenedor, panelSeguimientoClientes, button18); * cargarPanel(man); * } * else * if (cadenaPermisos[6] == '1') * { * moverPanelSeguimientoSubmenu(buttonUsuarios, panelSeguimientoSeguridad); * mostrarSubpaneles(panelSubMenuUsuarios); * moverPanelSeguimiento(buttonSecurity); * ModuloDeSeguridad.UI_IngresoDeUsuarios man = new ModuloDeSeguridad.UI_IngresoDeUsuarios(0, "0"); * cargarPanel(man); * }*/ } isClosingSession = false; }