Ejemplo n.º 1
0
        private void lstBUsuarios_SelectedIndexChanged(object sender, EventArgs e)
        {
            int idUsuario = (int)lstBUsuarios.SelectedValue;
            UsuariosImplement oUsuariosImplement = new UsuariosImplement();
            usuario           oUsuario           = new usuario();

            oUsuario         = oUsuariosImplement.Get(idUsuario);
            txtID.Text       = lstBUsuarios.SelectedValue.ToString();
            txtNombre.Text   = oUsuario.nombre;
            txtLogin.Text    = oUsuario.login;
            txtPassword.Text = oUsuario.password;

            chkUsuarioHabilitado.Checked        = (oUsuario.activo == null) ? false : (bool)oUsuario.activo;
            chkAdministracionSeguridad.Checked  = (bool)oUsuario.administracion;
            chkAutorizarCobroSI.Checked         = (bool)oUsuario.autorizarCobroSI;
            chkAutorizarConvenios.Checked       = (bool)oUsuario.autorizarConvenios;
            chkAvisosDeudaListadosCorte.Checked = (bool)oUsuario.avisosDeuda_listadosCortes;
            chkCobranzas.Checked                = (bool)oUsuario.cobranza_cierreCaja;
            chkConfigurar.Checked               = (bool)oUsuario.configurar;
            chkFacturacionAnulacion.Checked     = (bool)oUsuario.facturacion_anulacion;
            chkImpresion.Checked                = (bool)oUsuario.impresion_reimpresion;
            chkJudicialCodene.Checked           = (bool)oUsuario.judicial_codene;
            chkListadosPadrones.Checked         = (bool)oUsuario.listados_padrones;
            chkListadosReportesCobranza.Checked = (bool)oUsuario.listados_reportes;
            chkOpcionesMantenimiento.Checked    = (bool)oUsuario.mantenimiento;
            chkRepararOptimizar.Checked         = (bool)oUsuario.reparar_optimizar_respaldo;
            chkModificarDatos.Checked           = (bool)oUsuario.modificarDatos;
        }
Ejemplo n.º 2
0
        private void btnGuardarCambios_Click(object sender, EventArgs e)
        {
            UsuariosImplement oUsuariosImplement = new UsuariosImplement();

            if (!oUsuariosImplement.ExisteUsuario(txtLogin.Text) & txtLogin.Text.Length > 0 & txtNombre.Text.Length > 0 & txtPassword.Text.Length > 0)
            {
                usuario oUsuario = new usuario();
                oUsuario.nombre                     = txtNombre.Text;
                oUsuario.login                      = txtLogin.Text;
                oUsuario.password                   = txtPassword.Text;
                oUsuario.activo                     = chkUsuarioHabilitado.Checked;
                oUsuario.administracion             = chkAdministracionSeguridad.Checked;
                oUsuario.autorizarCobroSI           = chkAutorizarCobroSI.Checked;
                oUsuario.autorizarConvenios         = chkAutorizarConvenios.Checked;
                oUsuario.avisosDeuda_listadosCortes = chkAvisosDeudaListadosCorte.Checked;
                oUsuario.cobranza_cierreCaja        = chkCobranzas.Checked;
                oUsuario.configurar                 = chkConfigurar.Checked;
                oUsuario.facturacion_anulacion      = chkFacturacionAnulacion.Checked;
                oUsuario.impresion_reimpresion      = chkImpresion.Checked;
                oUsuario.judicial_codene            = chkJudicialCodene.Checked;
                oUsuario.listados_padrones          = chkListadosPadrones.Checked;
                oUsuario.listados_reportes          = chkListadosReportesCobranza.Checked;
                oUsuario.mantenimiento              = chkOpcionesMantenimiento.Checked;
                oUsuario.reparar_optimizar_respaldo = chkRepararOptimizar.Checked;
                oUsuario.modificarDatos             = chkModificarDatos.Checked;

                oUsuariosImplement.Save(oUsuario);

                CargarUsuarios();
            }
            else
            {
                if (txtID.Text.Length > 0 & txtLogin.Text.Length > 0 & txtNombre.Text.Length > 0 & txtPassword.Text.Length > 0)
                {
                    usuario oUsuario = new usuario();
                    oUsuario                            = oUsuariosImplement.Get(int.Parse(txtID.Text));
                    oUsuario.nombre                     = txtNombre.Text;
                    oUsuario.password                   = txtPassword.Text;
                    oUsuario.activo                     = chkUsuarioHabilitado.Checked;
                    oUsuario.administracion             = chkAdministracionSeguridad.Checked;
                    oUsuario.autorizarCobroSI           = chkAutorizarCobroSI.Checked;
                    oUsuario.autorizarConvenios         = chkAutorizarConvenios.Checked;
                    oUsuario.avisosDeuda_listadosCortes = chkAvisosDeudaListadosCorte.Checked;
                    oUsuario.cobranza_cierreCaja        = chkCobranzas.Checked;
                    oUsuario.configurar                 = chkConfigurar.Checked;
                    oUsuario.facturacion_anulacion      = chkFacturacionAnulacion.Checked;
                    oUsuario.impresion_reimpresion      = chkImpresion.Checked;
                    oUsuario.judicial_codene            = chkJudicialCodene.Checked;
                    oUsuario.listados_padrones          = chkListadosPadrones.Checked;
                    oUsuario.listados_reportes          = chkListadosReportesCobranza.Checked;
                    oUsuario.mantenimiento              = chkOpcionesMantenimiento.Checked;
                    oUsuario.reparar_optimizar_respaldo = chkRepararOptimizar.Checked;
                    oUsuario.modificarDatos             = chkModificarDatos.Checked;

                    oUsuariosImplement.Update(oUsuario);
                }
            }
            deshabilitar();
            lstBUsuarios.Enabled = true;
        }
Ejemplo n.º 3
0
        private void Menu_Load(object sender, EventArgs e)
        {
            UsuariosImplement oUsuariosImplement = new UsuariosImplement();

            _USUARIO = oUsuariosImplement.Get(_frmLoginParam.getIDUSUARIO());

            //frmLogin f = new frmLogin();
            //f.MdiParent = this;
            //f.Text = "Login";
            //f.MdiParent = this;
            //f.Show();
        }
Ejemplo n.º 4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            _Intentos = _Intentos + 1;
            if (txtNombreUsuario.Text.Length > 0 & txtPassword.Text.Length > 0)
            {
                UsuariosImplement oUsuariosImplement = new UsuariosImplement();
                if (oUsuariosImplement.ExisteUsuario(txtNombreUsuario.Text))
                {
                    _ID_USUARIO = oUsuariosImplement.GetByUserName(txtNombreUsuario.Text).id_usuario;

                    if (oUsuariosImplement.EsValido(txtNombreUsuario.Text, txtPassword.Text))
                    {
                        //Obtengo terminal por el txt; verifico si esta habilitada
                        //si esta bloqueada miro si tiene fecha de bloqueo, si hace mas de un dia
                        //la habilito y limpio la fecha de bloqueo
                        //si no, aviso q esta momentaneamente bloqueado
                        frmMenu f = new frmMenu(this);
                        Hide();
                        f.Show();
                    }
                    else
                    {
                        if (_Intentos >= 3)
                        {
                            MessageBox.Show("Se ha excedido el número máximo de intentos para registrarse en \n" +
                                            "el sistema, esta terminal ha sido bloqueada por lo cuál deberá \n" +
                                            "solicitar al administrador del sistema que la habilite.\n" +
                                            "Terminal bloqueada");

                            //Bloquear terminal por id identificado por configuracion?
                        }
                        else
                        {
                            MessageBox.Show("Usuario Invalido.");
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void CargarUsuarios()
        {
            UsuariosImplement oUsuariosImplement = new UsuariosImplement();

            oUsuariosImplement.CargarLista(lstBUsuarios);
        }