private void EliminarButton_Click(object sender, RoutedEventArgs e)
        {
            Marcas existe = MarcasBLL.Buscar(marcas.MarcaId);

            if (marcas.MarcaId == 1)
            {
                MessageBox.Show("No puede eliminar el Admin",
                                "Mensaje", MessageBoxButton.OK);
                return;
            }
            if (marcas == null)
            {
                MessageBox.Show("Primero seleccione un Usuario",
                                "Error", MessageBoxButton.OK);
                return;
            }
            else
            {
                MessageBoxResult opcion =
                    MessageBox.Show("Estas seguro de que desear eliminar a " + marcas.Nombres + "?",
                                    "Marcas", MessageBoxButton.YesNo);
                if (opcion.Equals(MessageBoxResult.Yes))
                {
                    if (MarcasBLL.Delete(marcas.MarcaId))
                    {
                        Limpiar();
                        MarcasBLL.Eliminar(marcas.MarcaId);
                        MessageBox.Show("Ha sido eliminado exitosamente", "Exito",
                                        MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
        }
Example #2
0
        private void Buscar()
        {
            var    listado  = new List <Object>();
            string criterio = CriterioTextBox.Text.Trim();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroCombobox.SelectedIndex)
                {
                case 0:
                    listado = MarcasBLL.GetList("", "");
                    break;

                case 1:
                    listado = MarcasBLL.GetList("MarcaId", criterio);
                    break;

                case 2:
                    listado = MarcasBLL.GetList("Nombres", criterio);
                    break;

                case 3:
                    listado = MarcasBLL.GetList("Usuario", criterio);
                    break;
                }
            }
            else
            {
                listado = MarcasBLL.GetList("", "");
            }
            DatosDataGrid.ItemsSource = null;
            DatosDataGrid.ItemsSource = listado;
        }
Example #3
0
        public void ExisteTest()
        {
            bool paso = false;

            paso = MarcasBLL.Existe(1);
            Assert.AreEqual(paso, true);
        }
Example #4
0
        public void EliminarTest()
        {
            bool paso = false;

            paso = MarcasBLL.Eliminar(3);

            Assert.AreEqual(paso, true);
        }
Example #5
0
        private MarcasBLL recuperarInformacionAgregarMarca()
        {
            MarcasBLL oMarca = new MarcasBLL();

            oMarca.Nombre = txtNombre.Text;

            return(oMarca);
        }
Example #6
0
        private MarcasBLL recuperarInformacionMarca()
        {
            MarcasBLL oMarca = new MarcasBLL();

            oMarca.Id     = Convert.ToInt32(lblIdMarca.Text);
            oMarca.Nombre = txtNombre.Text;

            return(oMarca);
        }
Example #7
0
        public rVehiculos()
        {
            InitializeComponent();
            this.DataContext = vehiculos;

            MarcaComboBox.ItemsSource       = MarcasBLL.GetMarcas();
            MarcaComboBox.SelectedValuePath = "MarcaId";
            MarcaComboBox.DisplayMemberPath = "Descripcion";

            CaracteristicasComboBox.ItemsSource       = CaracteristicasBLL.GetCaracteristicas();
            CaracteristicasComboBox.SelectedValuePath = "CaracteristicasId";
            CaracteristicasComboBox.DisplayMemberPath = "Descripcion";
        }
Example #8
0
        public void GetListTest()
        {
            bool paso = false;

            List <Marcas> lista = MarcasBLL.GetList(l => true);

            if (lista != null)
            {
                paso = true;
            }

            Assert.AreEqual(paso, true);
        }
Example #9
0
        public void ModificarTest()
        {
            Marcas marca = new Marcas();
            bool   paso  = false;

            marca.MarcaId     = 2;
            marca.Descripcion = "Titanium";
            marca.UsuarioId   = 1;

            paso = MarcasBLL.Modificar(marca);

            Assert.AreEqual(paso, true);
        }
        public rProductos()
        {
            InitializeComponent();
            this.DataContext = productos;

            //—————————————————————————————————————[ ComboBox MarcaId ]—————————————————————————————————————
            MarcaIdComboBox.ItemsSource       = MarcasBLL.GetMarcas();
            MarcaIdComboBox.SelectedValuePath = "MarcaId";
            MarcaIdComboBox.DisplayMemberPath = "NombreMarca";
            //—————————————————————————————————————[ ComboBox UsuarioId ]—————————————————————————————————————
            UsuarioIdComboBox.ItemsSource       = UsuariosBLL.GetUsuarios();
            UsuarioIdComboBox.SelectedValuePath = "UsuarioId";
            UsuarioIdComboBox.DisplayMemberPath = "NombreUsuario";
        }
 private void EliminarButton_Click(object sender, RoutedEventArgs e)
 {
     if (MarcasBLL.Eliminar(Utilidades.ToInt(MarcaIdTextBox.Text)))
     {
         Limpiar();
         MessageBox.Show("Registro eliminado!", "Exito",
                         MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         MessageBox.Show("No fue posible eliminar", "Fallo",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Example #12
0
        public void BuscarTest()
        {
            Marcas marca = new Marcas();
            bool   paso  = false;

            marca = MarcasBLL.Buscar(1);

            if (marca != null)
            {
                paso = true;
            }

            Assert.AreEqual(paso, true);
        }
Example #13
0
 public bool modificar(MarcasBLL oMarcasBLL)
 {
     if (oMarcasBLL.Nombre != "")
     {
         ModificacionDialogTrue oModificacionDialog = new ModificacionDialogTrue();
         oModificacionDialog.ShowDialog();
         return(conexion.ejecutarMetodoSinRetornoDatos("UPDATE Marcas SET NOMBRE = '" + oMarcasBLL.Nombre + "' where Id =" + oMarcasBLL.Id));
     }
     else
     {
         ModificacionDialogFalse oModificacionDialog = new ModificacionDialogFalse();
         oModificacionDialog.ShowDialog();
         return(false);
     }
 }
        private void BuscarButton_Click(object sender, RoutedEventArgs e)
        {
            var marcas = MarcasBLL.Buscar(Utilidades.ToInt(MarcaIdTextBox.Text));

            if (marcas != null)
            {
                this.Marcas = marcas;
            }
            else
            {
                this.Marcas = new Marcas();
            }

            this.DataContext = this.Marcas;
        }
Example #15
0
        private void BuscarButton_Click(object sender, RoutedEventArgs e)
        {
            Marcas encontrado = MarcasBLL.Buscar(marcas.MarcaId);

            edit = true;
            if (encontrado != null)
            {
                marcas           = encontrado;
                this.DataContext = marcas;
            }
            else
            {
                Limpiar();
                MessageBox.Show("No existe en la base de datos", "Mensaje",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #16
0
        private Marcas GetSelectedMarca()
        {
            object Marcas = DatosDataGrid.SelectedItem;

            if (Marcas != null)
            {
                return(MarcasBLL.Search(
                           Convert.ToInt32(
                               Marcas.GetType().
                               GetProperty("MarcaId").
                               GetValue(Marcas).
                               ToString())));
            }
            else
            {
                return(null);
            }
        }
Example #17
0
        private void btnGerar_Click(object sender, EventArgs e)
        {
            try
            {
                String dataI, dataF;
                dataI      = dtpDataInicial.Value.Year.ToString() + "/" + dtpDataInicial.Value.Day.ToString() + "/" + dtpDataInicial.Value.Month.ToString();
                dataF      = dtpDataFinal.Value.Year.ToString() + "/" + dtpDataFinal.Value.Day.ToString() + "/" + dtpDataFinal.Value.Month.ToString();
                dataInical = dtpDataInicial.Value.Date; //DateTime.Parse(dataI);
                dataFinal  = dtpDataFinal.Value.Date;   //DateTime.Parse(dataF);

                if (cbMarca.SelectedIndex > -1)
                {
                    marca = cbMarca.SelectedValue.ToString();
                    MarcasBLL objBLL = new MarcasBLL();
                    objBLL.localizarLeave(marca, "mar_codigo");
                    marca  = objBLL.mar_descricao;
                    objBLL = null;
                }
                else
                {
                    marca = "";
                }
                if (cbGrupo.SelectedIndex > -1)
                {
                    grupo = cbGrupo.SelectedValue.ToString();
                    GrupoBLL objBLL = new GrupoBLL();
                    objBLL.localizarLeave(marca, "gru_codigo");
                    grupo  = objBLL.gru_descricao;
                    objBLL = null;
                }
                else
                {
                    grupo = "";
                }

                controle = "Gerar";
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #18
0
        //public bool agregar(MarcasBLL oMarcasBLL)
        //{
        //    SqlCommand SQLComando = new SqlCommand("Insert into Marcas VALUES(@Nombre)");
        //    SQLComando.Parameters.Add("@Nombre", SqlDbType.VarChar).Value=oMarcasBLL.Nombre;
        //    return conexion.ejecutarMetodoSinRetornoDatos(SQLComando);
        //    //return conexion.ejecutarMetodoSinRetornoDatos("INSERT INTO [dbo].[Marcas]([Nombre])VALUES('" +oMarcasBLL.Nombre +"')");
        //}

        //public DataSet mostrarMarcas()
        //{
        //    SqlCommand sentencia = new SqlCommand("Select * from Marcas order by Nombre");
        //    return conexion.ejecutarSentencia(sentencia);
        //}

        //public int eliminar(MarcasBLL oMarcasBLL)
        //{
        //    conexion.ejecutarMetodoSinRetornoDatos("DELETE FROM Marcas where Id = " +oMarcasBLL.Id);

        //    return 1;
        //}

        //public bool modificar(MarcasBLL oMarcasBLL)
        //{
        //    return conexion.ejecutarMetodoSinRetornoDatos("UPDATE MARCAS SET NOMBRE = '" +oMarcasBLL.Nombre +"' where Id =" +oMarcasBLL.Id);
        //}

        //Implementacion con ACCES
        public bool agregar(MarcasBLL oMarcasBLL)
        {
            if (oMarcasBLL.Nombre != "")
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into Marcas (Nombre) values (@Nombre)");
                oleDbComando.Parameters.AddWithValue("@Nombre", SqlDbType.VarChar).Value = oMarcasBLL.Nombre;

                AgregadoDialogTrue oAgregadoDialog = new AgregadoDialogTrue();
                oAgregadoDialog.ShowDialog();

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
        private void GuardarButton_Click(object sender, RoutedEventArgs e)
        {
            if (!Validar())
            {
                return;
            }

            var paso = MarcasBLL.Guardar(Marcas);

            if (paso)
            {
                Limpiar();
                MessageBox.Show("Guardado correctamente!", "Exito",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Transaccion Fallida", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #20
0
        private void GuardarButton_Click(object sender, RoutedEventArgs e)
        {
            if (!Validar())
            {
                return;
            }
            marcas.UsuarioId = user;
            var paso = MarcasBLL.Save(marcas);

            if (paso)
            {
                Limpiar();
                MessageBox.Show("Guardado con Exito", "Exito",
                                MessageBoxButton.OK);
            }
            else
            {
                MessageBox.Show("Ha ocurrido un error", "Error",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #21
0
        private void EliminarBoton_Click(object sender, RoutedEventArgs e)
        {
            Marcas Marca = GetSelectedMarca();

            if (Marca == null)
            {
                MessageBox.Show("Primero seleccione una Marca", "Error",
                                MessageBoxButton.OK);
                return;
            }

            MessageBoxResult opcion = MessageBox.Show("Estas seguro de que desear eliminar a la marca " + Marca.Nombres + "?",
                                                      "Marcas", MessageBoxButton.YesNo);

            if (opcion.Equals(MessageBoxResult.Yes))
            {
                if (MarcasBLL.Delete(Marca.MarcaId))
                {
                    Inicializar();
                    MessageBox.Show("Marca eliminada", "Exito");
                }
            }
            Inicializar();
        }
Example #22
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (cbMarca.SelectedIndex > -1)
         {
             marca = cbMarca.SelectedValue.ToString();
             MarcasBLL objBLL = new MarcasBLL();
             objBLL.localizarLeave(marca, "mar_codigo");
             marca  = objBLL.mar_descricao;
             objBLL = null;
         }
         else
         {
             marca = "";
         }
         controle = "Gerar";
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #23
0
        private bool Validar()
        {
            bool esValido = true;

            if (NombresTextBox.Text.Length == 0)
            {
                esValido = false;
                MessageBox.Show("Ingrese los nombres", "Mensaje",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (MarcasBLL.Existe(NombresTextBox.Text) && edit == false)
            {
                esValido = false;
                MessageBox.Show("Ya existe esta marca", "Mensaje",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (NombresTextBox.Text.Length < 2)
            {
                esValido = false;
                MessageBox.Show("El nombre es muy corto", "Mensaje",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            return(esValido);
        }
Example #24
0
        public int eliminar(MarcasBLL oMarcasBLL)
        {
            conexion.ejecutarMetodoSinRetornoDatos("DELETE FROM Marcas where Id = " + oMarcasBLL.Id);

            return(1);
        }
Example #25
0
 private void InitializeComboBox()
 {
     MarcaComboBox.ItemsSource       = MarcasBLL.GetList(c => true);
     MarcaComboBox.SelectedValuePath = "MarcaId";
     MarcaComboBox.DisplayMemberPath = "Nombres";
 }
Example #26
0
        private void ReportBody()
        {
            fontStyle = FontFactory.GetFont("Calibri", 9f, 1);
            var _fontStyle = FontFactory.GetFont("Calibri", 9f, 0);

            #region Table Header
            pdfCell = new PdfPCell(new Phrase("ID", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Descripcion", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);


            pdfCell = new PdfPCell(new Phrase("Marca", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);


            pdfCell = new PdfPCell(new Phrase("Unidad", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Inventario", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Precio unitario", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Valor inventario", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfPTable.CompleteRow();
            #endregion

            #region Table Body
            int    num        = 0;
            double inventario = 0;
            foreach (var item in lista)
            {
                inventario += item.ValorInventario;
                num++;
                pdfCell = new PdfPCell(new Phrase(item.ProductoId.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.Descripción, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);


                pdfCell = new PdfPCell(new Phrase(MarcasBLL.Buscar(item.MarcaId).Descripcion.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);


                pdfCell = new PdfPCell(new Phrase(item.Unidad, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.Inventario.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.PrecioUnitario.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.ValorInventario.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfPTable.CompleteRow();
            }

            pdfCell = new PdfPCell(new Phrase(num++.ToString(), fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(" ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(" ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(" ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(" ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(" ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase(inventario.ToString(), fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;

            pdfPTable.AddCell(pdfCell);

            pdfPTable.CompleteRow();
            #endregion
        }
        private void ReportBody()
        {
            fontStyle = FontFactory.GetFont("Calibri", 9f, 1);
            var _fontStyle = FontFactory.GetFont("Calibri", 9f, 0);

            #region Table Header
            pdfCell = new PdfPCell(new Phrase("No.     ", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Descripcion", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);


            pdfCell = new PdfPCell(new Phrase("Marca", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);


            pdfCell = new PdfPCell(new Phrase("Cantidad", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Precio", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfCell = new PdfPCell(new Phrase("Importe", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfPTable.AddCell(pdfCell);

            pdfPTable.CompleteRow();
            #endregion

            #region Table Body
            int num = 0;

            foreach (var item in venta.VentasDetalle)
            {
                num++;
                pdfCell = new PdfPCell(new Phrase(num.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(ProductosBLL.Buscar(item.ProductoId).Descripción, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(MarcasBLL.Buscar(ProductosBLL.Buscar(item.ProductoId).MarcaId).Descripcion.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.Cantidad.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(item.Precio.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase((item.Precio * item.Cantidad).ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfPTable.AddCell(pdfCell);

                pdfPTable.CompleteRow();
            }
            TableRows("", "", fontStyle, "");
            TableRows("", "", fontStyle, "");
            TableRows("", "", fontStyle, "");
            TableRows("", "", fontStyle, "");
            Totales("Total: ", venta.Total.ToString(), "Total General: ", venta.TotalGeneral.ToString(), _fontStyle);
            Totales("ITBIS: ", venta.ITBIS.ToString(), "", "", _fontStyle);
            Totales("Descuentos: ", venta.Descuentos.ToString(), "", "", _fontStyle);

            TableRows("", "", fontStyle, "");
            TableRows("", "", fontStyle, "");

            if (UsuariosBLL.Buscar(venta.UsuarioId) != null)
            {
                Totales("Despachado por:", (UsuariosBLL.Buscar(venta.UsuarioId).Nombre + " " + UsuariosBLL.Buscar(venta.UsuarioId).Apellido), "Cliente: ", ClientesBLL.Buscar(venta.ClienteId).Nombre + " " + ClientesBLL.Buscar(venta.ClienteId).Apellido, _fontStyle);/*+ UsuariosBLL.Buscar(venta.UsuarioId).Nombre + " " + UsuariosBLL.Buscar(venta.UsuarioId).Apellido, fontStyle, ""*/
            }
            else
            {
                Totales("Despachado por:", (UsuariosBLL.Buscar(usuariologueadoId).Nombre + " " + UsuariosBLL.Buscar(usuariologueadoId).Apellido), "Cliente: ", ClientesBLL.Buscar(venta.ClienteId).Nombre + " " + ClientesBLL.Buscar(venta.ClienteId).Apellido, _fontStyle);
            }
            #endregion
        }