Example #1
0
        public void GetListTest()
        {
            List <Importadores> importadores = new List <Importadores>();

            importadores = ImportadoresBLL.GetList(i => true);
            Assert.IsNotNull(importadores);
        }
Example #2
0
        public void EliminarTest()
        {
            bool paso = false;

            paso = ImportadoresBLL.Eliminar(1);
            Assert.IsNotNull(paso);
        }
Example #3
0
        public void ModificarTest()
        {
            Importadores importadores = new Importadores(1, 1, "NissanRD", DateTime.Now, "8096637896", "*****@*****.**");
            bool         paso         = false;

            paso = ImportadoresBLL.Modificar(importadores);
            Assert.AreEqual(paso, true);
        }
Example #4
0
        public void GuardarTest()
        {
            Importadores importadores = new Importadores(0, 1, "NissanRD", DateTime.Now, "8096637896", "*****@*****.**");
            bool         paso         = false;

            paso = ImportadoresBLL.Guardar(importadores);
            Assert.AreEqual(paso, true);
        }
Example #5
0
        public void ExisteTest()
        {
            var paso = ImportadoresBLL.Existe(1);

            Assert.IsNotNull(paso);
        }
Example #6
0
        public void BuscarTest()
        {
            var paso = ImportadoresBLL.Buscar(1);

            Assert.AreEqual(paso, true);
        }
Example #7
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;
            pdfTable.AddCell(pdfCell);

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

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

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

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

            pdfCell = new PdfPCell(new Phrase("Año", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfTable.AddCell(pdfCell);

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

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

            pdfTable.CompleteRow();
            #endregion

            #region Table Body
            int num = 0;

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

                pdfCell = new PdfPCell(new Phrase(item.Fecha.ToString("dd/MM/yyyy"), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

                pdfCell = new PdfPCell(new Phrase(UsuarioBLL.Buscar(item.UsuarioId).Nombre, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

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

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

                pdfCell = new PdfPCell(new Phrase(item.Año.ToString(), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

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

                pdfCell = new PdfPCell(new Phrase(ImportadoresBLL.Buscar(item.ImportadorId).Nombre, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

                pdfTable.CompleteRow();
            }

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

            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;
            pdfTable.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;
            pdfTable.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;
            pdfTable.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;
            pdfTable.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;
            pdfTable.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;
            pdfTable.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;
            pdfTable.AddCell(pdfCell);

            pdfTable.CompleteRow();

            #endregion
        }