Example #1
0
 private void ProductoIdmaskedTextBox_TextChanged(object sender, EventArgs e)
 {
     CantidadnumericUpDown.Text = "0";
     DescripcionProductotextBox.Clear();
     PreciotextBox.Clear();
     ProductoerrorProvider.Clear();
 }
Example #2
0
        /// <summary>
        /// El Botton Eliminar la cual llama la funcion Validar para ver si el ID esta vacio o contiene un numero
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            if (Validar(1))
            {
                MessageBox.Show("El TipoID esta vacio", "Llene Campo",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                int id = Convert.ToInt32(ArticuloIDnumericUpDown.Value);

                if (BLL.ArticulosBLL.Eliminar(id))
                {
                    MessageBox.Show("Eliminado", "Bien hecho", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ArticuloIDnumericUpDown.Value        = 0;
                    FechaVencimientodateTimePicker.Value = DateTime.Now;
                    DescripciontextBox.Clear();
                    PreciotextBox.Clear();
                    ExistencianumericUpDown.Value       = 0;
                    CantidadCotizadanumericUpDown.Value = 0;
                    errorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No se puede Eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Example #3
0
        private void BuscarProducto()
        {
            if (!string.IsNullOrEmpty(ProductoIdmaskedTextBox.Text))
            {
                int id = Utilidades.TOINT(ProductoIdmaskedTextBox.Text);

                Detalle.Producto = BLL.ProductosBLL.Buscar(p => p.ProductoId == id);

                if (Detalle.Producto != null)
                {
                    DescripcionProductotextBox.Text = Detalle.Producto.Descripcion;
                    PreciotextBox.Text            = Detalle.Producto.Precio.ToString();
                    CantidadnumericUpDown.Enabled = true;
                    CantidadnumericUpDown.Focus();
                }
                else
                {
                    ProductoIdmaskedTextBox.Clear();
                    ProductoerrorProvider.SetError(ProductoIdmaskedTextBox, "No existe un producto con ese id.");
                    DescripcionProductotextBox.Clear();
                    PreciotextBox.Clear();
                    CantidadnumericUpDown.Enabled = false;
                    ProductoIdmaskedTextBox.Focus();
                }
            }
            else
            {
                DescripcionProductotextBox.Clear();
                ProductoerrorProvider.SetError(ProductoIdmaskedTextBox, "Digite el id de un producto.");
                ProductoIdmaskedTextBox.Focus();
            }
        }
Example #4
0
 private void Limpiar()
 {
     IdnumericUpDown.Value = 0;
     PreciotextBox.Clear();
     DescripciontextBox.Clear();
     TipoPartidocomboBox.SelectedText = string.Empty;
 }
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     IdnumericUpDown.Value = 0;
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     CantCottextBox.Clear();
 }
Example #6
0
 public void LimpiarProducto()
 {
     ProductoIdtextBox.Clear();
     PreciotextBox.Clear();
     ITBIStextBox.Clear();
     NombretextBox.Clear();
     CantidadtextBox.Clear();
     DescuentostextBox.Clear();
 }
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     IdnumericUpDown.Value = 0;
     FechaVencimientodateTimePicker.Value = DateTime.Now;
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     ExistenciatextBox.Clear();
     CantidadCotizadatextBox.Clear();
 }
Example #8
0
 void limpiar()
 {
     RecepcionIdtextBox.Clear();
     CantPtextBox.Clear();
     ObservacionrichTextBox.Clear();
     RecibidoPortextBox.Clear();
     MontotextBox.Clear();
     PreciotextBox.Clear();
 }
 private void Limpiar()
 {
     ArticuloIdtextBox.Clear();
     NombreArticulotextBox.Clear();
     ServicioscomboBox.SelectedIndex = 0;
     PreciotextBox.Clear();
     sa = new List <ServiciosArticulos>();
     ArticulosdataGridView.DataSource = null;
 }
Example #10
0
 private void LimpiarProducto()
 {
     LimpiarProvider();
     CantidadnumericUpDown.Value = 0;
     DescripcionProductotextBox.Clear();
     ProductoIdcomboBox.Text = string.Empty;
     PreciotextBox.Clear();
     ImportetextBox.Clear();
     DetallecomboBox.Text = string.Empty;
 }
Example #11
0
        private void Nuevobutton_Click(object sender, EventArgs e)
        {
            ArticuloIdnumericUpDown.Value = 0;
            DescripciontextBox.Clear();
            PreciotextBox.Clear();
            CostotextBox.Clear();
            GananciatextBox.Clear();
            InventariotextBox.Clear();

            errorProvider.Clear();
        }
Example #12
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     VentaIdtextBox.Clear();
     CantidadtextBox.Clear();
     PreciotextBox.Clear();
     NFCtextBox.Clear();
     TipoNFCtextBox.Clear();
     DescuentostextBox.Clear();
     TotaltextBox.Clear();
     VentasdataGridView.Rows.Clear();
     BuscarVentabutton.Enabled = true;
 }
Example #13
0
        private void NuevoButton_Click(object sender, EventArgs e)
        {
            IdnumericUpDown.Value     = 0;
            fechaDateTimePicker.Value = DateTime.Now;
            ObservacionestextBox.Clear();
            CantidadtextBox.Clear();
            PreciotextBox.Clear();
            ImportetextBox.Clear();
            TotalnumericUpDown.Value = 0;

            DetalledataGridView.DataSource = null;
            MyerrorProvider.Clear();
        }
Example #14
0
        private void BtnNuevo_Click(object sender, EventArgs e)
        {
            CotizacionIdnumericUpDown.Value = 0;
            fechaDateTimePicker.Value       = DateTime.Now;
            ObservaciontextBox.Clear();
            CanttextBox.Clear();
            PreciotextBox.Clear();
            ImportetextBox.Clear();
            TotalnumericUpDown.Value = 0;

            CotizaciondataGridView.DataSource = null;
            GeneralerrorProvider.Clear();
        }
Example #15
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     CantidadnumericUpDown.Value = 0;
     ComentariotextBox.Clear();
     IDnumericUpDown.Value = 0;
     MontotextBox.Clear();
     DetalledataGridView.DataSource = null;
     FechadateTimePicker.Value      = DateTime.Now;
     cotisar = new Cotizaciones();
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     ArticuloIdnumericUpDown.Value = 0;
     ImportetextBox.Clear();
 }
        private void Limpiar()
        {
            productoIdMaskedTextBox.Clear();
            descripcionTextBox.Clear();
            cantidadNumericUpDown.Value = 0;
            CostotextBox.Clear();
            PreciotextBox.Clear();
            fechaIngresoDateTimePicker.Value = DateTime.Today;

            DescripcionerrorProvider.Clear();
            PrecioerrorProvider.Clear();
            CostoerrorProvider.Clear();
            CantidaderrorProvider.Clear();
        }
 private void Limpiar()
 {
     IdnumericUpDown.Value          = 0;
     FechadateTimePicker.Value      = DateTime.Now;
     ClientecomboBox.SelectedIndex  = 0;
     ArticulocomboBox.SelectedIndex = 0;
     CantidadtextBox.Clear();
     PreciotextBox.Clear();
     ImportetextBox.Clear();
     DetalledataGridView.DataSource = null;
     SubTotaltextBox.Clear();
     ItbistextBox.Clear();
     TotaltextBox.Clear();
     MyErrorProvider.Clear();
 }
Example #18
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     IdnumericUpDown.Value     = 0;
     FechadateTimePicker.Value = DateTime.Now;
     ArticulocomboBox.Text     = string.Empty;
     SuplidorcomboBox.Text     = string.Empty;
     UsuariocomboBox.Text      = string.Empty;
     CantidadtextBox.Clear();
     PreciotextBox.Clear();
     ImportetextBox.Clear();
     SubTotaltextBox.Clear();
     TotaltextBox.Clear();
     ItbistextBox.Clear();
     EfectivonumericUpDown.Value   = 0;
     DevueltanumericUpDown.Value   = 0;
     CompradataGridView.DataSource = null;
     errorProvider.Clear();
 }
 private void NuevobuttonC_Click(object sender, EventArgs e)
 {
     CotizaciontextBox.Clear();
     FechadateTimePicker.Value = DateTime.Now;
     ComentariotextBox.Clear();
     ArticuloIDnumericUpDown.Value = 0;
     CantidadnumericUpDown.Value   = 0;
     MontotextBox.Clear();
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     DetalledataGridView.ClearSelection();
     Cotisar.CotizacionDetalle      = new List <CotizacionesDetalle>();
     DetalledataGridView.DataSource = null;
     DetallenumericUpDown.Value     = 0;
     DetallenumericUpDown.Enabled   = false;
     BuscarDetalllebutton.Enabled   = false;
     LimpiarProvider();
     Cotisar.Monto = 0;
 }
Example #20
0
        /// <summary>
        /// Aqui tenemos el Button Guardar la cual guardamos lo que esta en los campos y llamamos la funcion validar para validar
        /// nuestros campos
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            if (Validar(2))
            {
                MessageBox.Show("Llenar campos", "Llene los campos",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                Articulo articulo = LlenaClase();

                bool paso = false;


                if (ArticuloIDnumericUpDown.Value == 0)
                {
                    paso = BLL.ArticulosBLL.Guardar(articulo);
                }
                else
                {
                    paso = BLL.ArticulosBLL.Modificar(LlenaClase());
                }
                if (paso)
                {
                    MessageBox.Show("Guardado!!", "Se Guardo Correctamente",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ArticuloIDnumericUpDown.Value        = 0;
                    FechaVencimientodateTimePicker.Value = DateTime.Now;
                    DescripciontextBox.Clear();
                    PreciotextBox.Clear();
                    ExistencianumericUpDown.Value       = 0;
                    CantidadCotizadanumericUpDown.Value = 0;
                    errorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No se guardo!!", "Intente Guardar de nuevo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Example #21
0
        private void Limpiar()
        {
            Detalle = new Entidades.FacturasProductos();
            Factura = new Entidades.Facturas();

            FacturaIdmaskedTextBox.Clear();
            ClienteIdmaskedTextBox.Clear();
            NombreClientetextBox.Clear();
            MontotextBox.Clear();
            FechadateTimePicker.Value = DateTime.Now;
            ProductoIdmaskedTextBox.Clear();
            DescripcionProductotextBox.Clear();
            ProductodataGridView.DataSource = null;
            CantidadnumericUpDown.Value     = 0;
            PreciotextBox.Clear();
            DevueltatextBox.Clear();
            RecibidomaskedTextBox.Clear();
            ComentariotextBox.Clear();
            NombreClienteerrorProvider.Clear();
            CantidaderrorProvider.Clear();
            ProductoerrorProvider.Clear();
            RecibidoerrorProvider.Clear();
            GriderrorProvider.Clear();
            ClienteIderrorProvider.Clear();
            FacturaIderrorProvider.Clear();
            DevueltaerrorProvider.Clear();
            FormaPagoComboBox.Text = null;

            ClienteIdmaskedTextBox.Enabled  = true;
            ProductoIdmaskedTextBox.Enabled = true;
            FechadateTimePicker.Enabled     = true;
            ComentariotextBox.Enabled       = true;
            FormaPagoComboBox.Enabled       = true;
            ProductodataGridView.Enabled    = true;
            RecibidomaskedTextBox.Enabled   = false;
            FacturaIdmaskedTextBox.Enabled  = true;
            CantidadnumericUpDown.Enabled   = false;
        }
Example #22
0
        private void AgregarProducto()
        {
            if (!string.IsNullOrEmpty(DescripcionProductotextBox.Text))
            {
                if (CantidadnumericUpDown.Value != 0)
                {
                    if (Detalle.Producto.Cantidad >= CantidadnumericUpDown.Value)
                    {
                        bool productoAgregado = false;
                        foreach (var producto in Factura.Relacion)
                        {
                            if (Detalle.Producto.ProductoId == producto.ProductoId)
                            {
                                productoAgregado = true;
                                break;
                            }
                        }
                        if (!productoAgregado)
                        {
                            Factura.Relacion.Add(new Entidades.FacturasProductos(Factura.FacturaId, Detalle.Producto.ProductoId, Detalle.Producto.Descripcion, Detalle.Producto.Precio, CantidadnumericUpDown.Value));
                            LlenarDataGrid(Factura);

                            CantidadnumericUpDown.Enabled = false;
                            CalculoMonto();
                            ProductoIdmaskedTextBox.Clear();
                        }
                        else
                        {
                            MessageBox.Show("Este producto ya esta agregado en la factura.");
                            DescripcionProductotextBox.Clear();
                            PreciotextBox.Clear();
                            CantidadnumericUpDown.Text    = "0";
                            CantidadnumericUpDown.Enabled = false;
                            ProductoIdmaskedTextBox.Focus();
                        }
                    }
                    else
                    {
                        if (Detalle.Producto.Cantidad <= 0)
                        {
                            MessageBox.Show("No queda producto de ese tipo");
                            ProductoIdmaskedTextBox.Clear();
                            DescripcionProductotextBox.Clear();
                            CantidadnumericUpDown.Text = "0";

                            ProductoIdmaskedTextBox.Focus();
                        }
                        else
                        {
                            MessageBox.Show("La cantidad excede la existencia, se cuenta con (" + Detalle.Producto.Cantidad + ") " + Detalle.Producto.Descripcion + ".");
                            CantidadnumericUpDown.Focus();
                        }
                    }
                }
                else
                {
                    CantidaderrorProvider.SetError(CantidadnumericUpDown, "Digite una cantidad diferente de (0).");
                    CantidadnumericUpDown.Focus();
                }
            }
            else
            {
                ProductoerrorProvider.SetError(ProductoIdmaskedTextBox, "Busque un producto para poder agregar.");
            }

            ClienteIdmaskedTextBox.Clear();
        }