private Boolean validar()
        {
            Boolean errorCampos = true;

            if (TxtNombreCliente.Text == string.Empty)
            {
                MensajeError.SetError(TxtNombreCliente, "Debe ingresar el nombre del empleado");
                TxtNombreCliente.Focus();
                errorCampos = false;
            }
            else
            {
                MensajeError.SetError(TxtNombreCliente, "");
            }

            return(errorCampos);
        }
Esempio n. 2
0
        private void Limpiar()
        {
            TxtBuscar.Clear();
            TxtId.Clear();
            TxtCodigo.Clear();
            TxtIdCliente.Clear();
            TxtNombreCliente.Clear();
            TxtSerieComprobante.Clear();
            TxtNumComprobante.Clear();
            DtDetalle.Clear();
            TxtSubtotalI.Text     = "0.00";
            TxtTotalImpuesto.Text = "0.00";
            TxtTotal.Text         = "0.00";

            DgvListado.Columns[0].Visible = false;
            BtnAnular.Visible             = false;
            ChkSeleccionar.Checked        = false;
        }
Esempio n. 3
0
 //METODO PARA LIMPPIAR TODOS LOS TEXTBOX QUE SE ENCUENTRAN EN EL
 public void MET_LimpiarTextBox()
 {
     MtbCedula.Clear();
     TxtNombreCliente.Clear();
     TxtApellidoCliente.Clear();
     MtbTelefono.Clear();
     TxtDireccionCliente.Clear();
     TxtDeuda.Clear();
     TxtPago.Clear();
     TxtDeudaRestante.Clear();
     LblErrorCedula.Visible          = false;
     LblErrorNombre.Visible          = false;
     LblErrorApellido.Visible        = false;
     LblErrorTelefono.Visible        = false;
     LblErrorDireccion.Visible       = false;
     LblErrorPago.Visible            = false;
     LblErrorFechaNacimiento.Visible = false;
 }
Esempio n. 4
0
        private void BtnNuevo_Click(object sender, EventArgs e)
        {
            TxtSerie.Enabled  = true;
            TxtNumero.Enabled = true;

            //*********PROVEEDOR************
            GbProveedor.Enabled = true;
            TxtRUCProveedor.Clear();
            TxtNombreProveedor.Clear();
            TxtNombreProveedor.Enabled = false;

            //*********EMPLEADO*************
            GbEmpleado.Enabled        = true;
            TxtNombreEmpleado.Text    = FrmLogin.NombreEmpleado;
            TxtCodigoEmpleado.Text    = FrmLogin.CodigoEmpleado;
            TxtNombreEmpleado.Enabled = false;
            TxtCodigoEmpleado.Enabled = false;

            //**********CLIENTE*************
            GbCliente.Enabled = true;
            TxtNombreCliente.Clear();

            //**********PRODUCTO************
            GbProducto.Enabled = true;
            TxtCantidadProducto.Clear();
            TxtCantidadProducto.Clear();
            TxtCodigoProducto.Clear();
            TxtPrecioProducto.Clear();
            TxtNombreProducto.Clear();
            TxtCantidadCompra.Clear();
            TxtImporteCompra.Clear();
            TxtCantidadProducto.Enabled = false;
            TxtPrecioProducto.Enabled   = false;
            TxtNombreProducto.Enabled   = false;
            TxtImporteCompra.Enabled    = false;

            //**********PRODUCTO************
            TxtSubTotal.Enabled   = false;
            TxtIGV.Enabled        = false;
            TxtTotalPagar.Enabled = false;
            BtnAgregar.Enabled    = false;
        }
Esempio n. 5
0
        private void BtnGuardarCliente_Click(object sender, EventArgs e)
        {
            if (V_Editar == false)
            {
                try
                {
                    if (MtbCedula.MaskFull != true)
                    {
                        LblErrorCedula.Visible          = true;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Visible = false;
                        MtbCedula.Focus();
                        return;
                    }
                    else if (TxtNombreCliente.Text == "")
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = true;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Visible = false;
                        TxtNombreCliente.Focus();
                        return;
                    }
                    else if (TxtApellidoCliente.Text == "")
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = true;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Visible = false;
                        TxtApellidoCliente.Focus();
                        return;
                    }
                    else if (TxtDireccionCliente.Text == "")
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = true;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Visible = false;
                        TxtDireccionCliente.Focus();
                        return;
                    }
                    else if (MtbTelefono.MaskFull != true)
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = true;
                        LblErrorFechaNacimiento.Visible = false;
                        MtbTelefono.Focus();
                        return;
                    }
                    else if (V_Edad < 18)
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Visible = true;
                        LblErrorFechaNacimiento.Text    = "EL CLIENTE NO DE DEBE SER MENOR DE 18 AÑOS";
                        return;
                    }
                    else
                    {
                        CN_Acciones InsertarCliente = new CN_Acciones();
                        InsertarCliente.InsertarDatosCliente(MtbCedula.Text,
                                                             TxtNombreCliente.Text, TxtApellidoCliente.Text,
                                                             TxtDireccionCliente.Text, MtbTelefono.Text,
                                                             DtpFechaNacimiento.Text);

                        MessageBox.Show("SE INSERTO CORRECTAMENTE");

                        MET_LimpiarTextBox();
                        //MET_LblInvisibles();
                        DtvClientes.Visible         = true;
                        BtnGuardarCliente.Visible   = false;
                        BtnEditarCliente.Visible    = true;
                        BtnBorrarCliente.Visible    = true;
                        BtnCancelarGuardado.Visible = false;
                        BtnAgregarCliente.Visible   = true;
                        MET_MostrarClientes();
                    }
                }
                catch (Exception)
                {
                    //MessageBox.Show("Hay Un error en los datos introducidos. Revise y vuelva a intentarlo " + Error + " LLAME A SOPORTE TECNICO");
                    MessageBox.Show("Hay Un error en los datos introducidos. Verifique que todo este correcto", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            if (V_Editar == true)
            {
                try
                {
                    if (MtbCedula.MaskFull != true)
                    {
                        LblErrorCedula.Visible    = true;
                        LblErrorNombre.Visible    = false;
                        LblErrorApellido.Visible  = false;
                        LblErrorDireccion.Visible = false;
                        LblErrorTelefono.Visible  = false;
                        MtbCedula.Focus();
                        return;
                    }
                    else if (TxtNombreCliente.Text == "")
                    {
                        LblErrorCedula.Visible    = false;
                        LblErrorNombre.Visible    = true;
                        LblErrorApellido.Visible  = false;
                        LblErrorDireccion.Visible = false;
                        LblErrorTelefono.Visible  = false;
                        TxtNombreCliente.Focus();
                        return;
                    }
                    else if (TxtApellidoCliente.Text == "")
                    {
                        LblErrorCedula.Visible    = false;
                        LblErrorNombre.Visible    = false;
                        LblErrorApellido.Visible  = true;
                        LblErrorDireccion.Visible = false;
                        LblErrorTelefono.Visible  = false;
                        TxtApellidoCliente.Focus();
                        return;
                    }
                    else if (TxtDireccionCliente.Text == "")
                    {
                        LblErrorCedula.Visible    = false;
                        LblErrorNombre.Visible    = false;
                        LblErrorApellido.Visible  = false;
                        LblErrorDireccion.Visible = true;
                        LblErrorTelefono.Visible  = false;
                        TxtDireccionCliente.Focus();
                        return;
                    }
                    else if (MtbTelefono.MaskFull != true)
                    {
                        LblErrorCedula.Visible    = false;
                        LblErrorNombre.Visible    = false;
                        LblErrorApellido.Visible  = false;
                        LblErrorDireccion.Visible = false;
                        LblErrorTelefono.Visible  = true;
                        MtbTelefono.Focus();
                        return;
                    }
                    else if (V_Edad < 18)
                    {
                        LblErrorCedula.Visible          = false;
                        LblErrorNombre.Visible          = false;
                        LblErrorApellido.Visible        = false;
                        LblErrorDireccion.Visible       = false;
                        LblErrorTelefono.Visible        = false;
                        LblErrorFechaNacimiento.Text    = "EL CLIENTE DE DEBE SER MENOR DE 18 AÑOS";
                        LblErrorFechaNacimiento.Visible = true;
                        return;
                    }
                    else
                    {
                        CN_Acciones EditarCliente = new CN_Acciones();
                        if (DtvClientes.SelectedRows.Count > 0)
                        {
                            EditarCliente.EditarDatosClientes(MtbCedula.Text,
                                                              TxtNombreCliente.Text, TxtApellidoCliente.Text,
                                                              TxtDireccionCliente.Text, MtbTelefono.Text,
                                                              DtpFechaNacimiento.Text, V_IDCliente);

                            MessageBox.Show("SE EDITO CORRECTAMENTE");

                            MET_LimpiarTextBox();
                            //MET_LblInvisibles();
                            DtvClientes.Visible         = true;
                            BtnGuardarCliente.Visible   = false;
                            BtnEditarCliente.Visible    = true;
                            BtnBorrarCliente.Visible    = true;
                            BtnCancelarGuardado.Visible = false;
                            BtnCancelarEditado.Visible  = false;
                            BtnAgregarCliente.Visible   = true;
                            V_Editar = false;
                            MET_MostrarClientes();
                        }
                    }
                }
                catch (Exception)
                {
                    //MessageBox.Show("Hay Un error en los datos introducidos. Revise y vuelva a intentarlo " + Error + " LLAME A SOPORTE TECNICO");
                    MessageBox.Show("Hay Un error en los datos introducidos. Verifique que todo este correcto", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
        }
Esempio n. 6
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (TxtSerie.Text != "" && TxtNumero.Text != "" && TxtRUCProveedor.Text != "" && TxtCodigoEmpleado.Text != "" && TxtNombreCliente.Text != "" && TxtSubTotal.Text != "" && TxtIGV.Text != "" && TxtTotalPagar.Text != "")
            {
                if (MessageBox.Show("Enserio quieres imprimir la boleta", "Mensaje", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    MessageBox.Show("Boleta Impresa", "Mensaje");

                    ClsEBoleta Eobj1 = new ClsEBoleta();
                    ClsNBoleta Nobj1 = new ClsNBoleta();
                    Eobj1.serie    = TxtSerie.Text;
                    Eobj1.numero   = TxtNumero.Text;
                    Eobj1.subtotal = subtotal;
                    Eobj1.igv      = igv;
                    Eobj1.total    = Convert.ToDouble(TxtTotalPagar.Text);
                    Nobj1.MtdActualizarBoleta(Eobj1);

                    TxtSerie.Enabled  = true;
                    TxtNumero.Enabled = true;

                    TxtSerie.Clear();
                    TxtNumero.Clear();

                    //*********PROVEEDOR************
                    GbProveedor.Enabled = true;
                    TxtRUCProveedor.Clear();
                    TxtNombreProveedor.Clear();
                    TxtNombreProveedor.Enabled = false;

                    //*********EMPLEADO*************
                    GbEmpleado.Enabled        = true;
                    TxtNombreEmpleado.Text    = FrmLogin.NombreEmpleado;
                    TxtCodigoEmpleado.Text    = FrmLogin.CodigoEmpleado;
                    TxtNombreEmpleado.Enabled = false;
                    TxtCodigoEmpleado.Enabled = false;

                    //**********CLIENTE*************
                    GbCliente.Enabled = true;
                    TxtNombreCliente.Clear();

                    //**********PRODUCTO************
                    GbProducto.Enabled = true;
                    TxtCantidadProducto.Clear();
                    TxtCantidadProducto.Clear();
                    TxtCodigoProducto.Clear();
                    TxtPrecioProducto.Clear();
                    TxtNombreProducto.Clear();
                    TxtCantidadCompra.Clear();
                    TxtImporteCompra.Clear();
                    TxtCantidadProducto.Enabled = false;
                    TxtPrecioProducto.Enabled   = false;
                    TxtNombreProducto.Enabled   = false;
                    TxtImporteCompra.Enabled    = false;

                    //**********PRODUCTO************
                    TxtSubTotal.Enabled   = false;
                    TxtIGV.Enabled        = false;
                    TxtTotalPagar.Enabled = false;
                    BtnAgregar.Enabled    = false;

                    TxtSubTotal.Text   = 0.ToString();
                    TxtIGV.Text        = 0.ToString();
                    TxtTotalPagar.Text = 0.ToString();

                    ClsEDetalleBoleta Eobj = new ClsEDetalleBoleta();
                    ClsNDetalleBoleta Nobj = new ClsNDetalleBoleta();
                    Eobj.serie  = "";
                    Eobj.numero = "";
                    DgvDetalleBoleta.DataSource = Nobj.MtdBuscarDetalleBoleta(Eobj);
                }
            }
            else
            {
                MessageBox.Show("Boleta Vacia", "Mensaje");
            }
        }