Example #1
0
        private void btnAgregarProducto_Click(object sender, EventArgs e)
        {
            if (ProductoSeleccionado.ProductoId != 0 && !string.IsNullOrEmpty(txtCant.Text))
            {
                ListGrid.Add(CrearNuevaLinea());

                RecargarDatagrid();

                LimpiarControles();
            }
            else
            {
                if (!string.IsNullOrEmpty(txtCodProd.Text) && !string.IsNullOrEmpty(txtCant.Text))
                {
                    ProductoSeleccionado = productoBLL.ObtenerProductoPorCodigo(txtCodProd.Text);

                    if (ProductoSeleccionado != null)
                    {
                        ListGrid.Add(CrearNuevaLinea());

                        RecargarDatagrid();

                        LimpiarControles();
                    }
                    else
                    {
                        Alert.ShowSimpleAlert("El codigo de producto no existe", "MSJ080");
                    }
                }
                else
                {
                    Alert.ShowSimpleAlert("Debe Seleccionar al menos un producto y la cantidad", "MSJ082");
                }
            }
        }