Example #1
0
        private void btnDNI_Click(object sender, EventArgs e)
        {
            this.lblDNI.Text = "";
            bool retorno = Validaciones.ValidarQueSeaDni(this.txtDNI.Text, out int dni);

            if (retorno == false)
            {
                this.lblDNI.Text = "DNI invalido";
            }
            else
            {
                if (TieneDeuda(dni))
                {
                    MiSesionIniciada mi = new MiSesionIniciada();

                    mi.Registro(dni);
                    mi.VerMiDeuda(dni);
                    mi.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Este DNI no presenta facturas pendientes");
                    //MOSTRA Q NO TIENE DEUDA
                }
            }
        }
Example #2
0
        private void btnDNI_Click(object sender, EventArgs e)
        {
            bool val = Validaciones.Licencia();

            if (val == true)
            {
                this.btnDNI.Enabled = false;

                //this.lblTitulo.Text = "Solicitar servicio Tecnico";
                Mantenimiento vm = new Mantenimiento();
                vm.ShowDialog();

                this.txtDNI.Enabled = false;
            }

            this.lblDNI.Text = "";
            bool retorno = Validaciones.ValidarQueSeaDni(this.txtDNI.Text, out string dni);

            if (retorno == false)
            {
                this.lblDNI.Location = new System.Drawing.Point(303, 188);
                this.lblDNI.Text     = "DNI invalido";
            }
            else
            {
                if (TieneDeuda(dni))
                {
                    MiSesionIniciada mi = new MiSesionIniciada();
                    mi.CargarDeuda(deuda);

                    mi.Registro(dni);
                    mi.VerMiDeuda(dni);
                    mi.ShowDialog();
                    this.txtDNI.Text = "";
                    //otra prueba con eneable
                    this.txtDNI.Focus();
                    //this.txtDNI.Click() += new System.EventHandler(sender, e);
                    //this.btnDNI.Click += new System.EventHandler(this.btnDNI_Click);
                    //sad
                    deuda = mi.ActualizarDeuda();
                }
                else
                {
                    this.lblDNI.Location = new System.Drawing.Point(183, 188);
                    this.lblDNI.Text     = "No presenta facturas pendientes";

                    /*
                     * FormMensaje mensaje = new FormMensaje("Este DNI no presenta facturas pendientes","Sin deuda");
                     * mensaje.ShowDialog();
                     * this.txtDNI.Text = "";
                     * mensaje.esperaYCierra();
                     */
                }
            }
        }
Example #3
0
        public void FuncionamientoClickOEnter()
        {
            bool val = Validaciones.Licencia();

            if (val == true)
            {
                this.btnDNI.Enabled = false;
                Mantenimiento vm = new Mantenimiento();
                vm.ShowDialog();

                this.txtDNI.Enabled = false;
            }

            this.lblDNI.Text = "";
            bool retorno = Validaciones.ValidarQueSeaMayoraSieteCaracteres(this.txtDNI.Text, out string ingreso);

            if (retorno == false)
            {
                this.lblDNI.Location = new System.Drawing.Point(258, 188);
                this.lblDNI.Text     = "Ingrese 8 caracteres";
            }
            else
            {
                if (TieneDeudaDNI(ingreso))
                {
                    MiSesionIniciada mi = new MiSesionIniciada();
                    mi.CargarDeuda(deuda);

                    mi.VerMiDeudaDNI(ingreso);
                    mi.Registro(ingreso);
                    mi.ShowDialog();
                    this.txtDNI.Text = "";

                    //otra prueba con eneable
                    this.txtDNI.Focus();
                    //this.txtDNI.Click() += new System.EventHandler(sender, e);
                    //this.btnDNI.Click += new System.EventHandler(this.btnDNI_Click);
                    //sad
                    deuda = mi.ActualizarDeuda();
                }
                else
                {
                    if (TieneDeudaNCliente(ingreso))
                    {
                        MiSesionIniciada mi = new MiSesionIniciada();
                        mi.CargarDeuda(deuda);

                        mi.Registro(ingreso);
                        mi.VerMiDeudaNCliente(ingreso);
                        mi.ShowDialog();
                        this.txtDNI.Text = "";
                        //otra prueba con eneable
                        this.txtDNI.Focus();
                        //this.txtDNI.Click() += new System.EventHandler(sender, e);
                        //this.btnDNI.Click += new System.EventHandler(this.btnDNI_Click);
                        //sad
                        deuda = mi.ActualizarDeuda();
                    }
                    else
                    {
                        this.lblDNI.Location = new System.Drawing.Point(183, 188);
                        this.lblDNI.Text     = "No presenta facturas pendientes";
                    }
                }
            }
        }