public void EliminarTest()
        {
            bool paso = false;

            paso = SegurosBLL.Eliminar(2);

            Assert.AreEqual(paso, true);
        }
        public void ExisteTest()
        {
            bool paso = false;

            paso = SegurosBLL.Existe(2);

            Assert.AreEqual(paso, true);
        }
        public void GuardarTest()
        {
            Seguros seguro = new Seguros();
            bool    paso   = false;

            seguro.SeguroId = 0;
            seguro.Nombre   = "Senasa";

            paso = SegurosBLL.Guardar(seguro);

            Assert.AreEqual(paso, true);
        }
        public void GetListTest()
        {
            bool paso = false;

            List <Seguros> lista = SegurosBLL.GetList(s => true);

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

            Assert.AreEqual(paso, true);
        }
        public void ModificarTest()
        {
            Seguros seguro = new Seguros();
            bool    paso   = false;


            seguro.SeguroId = 2;
            seguro.Nombre   = "ARS Palic";

            paso = SegurosBLL.Insertar(seguro);

            Assert.AreEqual(paso, true);
        }
        public void BuscarTest()
        {
            bool    paso = false;
            Seguros seguro;

            seguro = SegurosBLL.Buscar(2);

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

            Assert.AreEqual(paso, true);
        }
Beispiel #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("Nombres", fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.LightGray;
            pdfTable.AddCell(pdfCell);

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

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


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

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

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

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

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

            pdfCell = new PdfPCell(new Phrase("Balance", 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 listaPacientes)
            {
                num++;
                pdfCell = new PdfPCell(new Phrase(item.PacienteId.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.Nombres, _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

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

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

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

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

                var edad = ((DateTime.Now - item.FechaNacimiento).TotalDays) / 365;
                pdfCell = new PdfPCell(new Phrase(edad.ToString("N1"), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_CENTER;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

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

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


                pdfCell = new PdfPCell(new Phrase(item.Balance.ToString("N2"), _fontStyle));
                pdfCell.HorizontalAlignment = Element.ALIGN_RIGHT;
                pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
                pdfCell.BackgroundColor     = BaseColor.White;
                pdfTable.AddCell(pdfCell);

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

            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);


            decimal total;
            total = listaPacientes.Sum(c => c.Balance);

            pdfCell = new PdfPCell(new Phrase(total.ToString("N2"), fontStyle));
            pdfCell.HorizontalAlignment = Element.ALIGN_RIGHT;
            pdfCell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            pdfCell.BackgroundColor     = BaseColor.White;
            pdfCell.Border = 0;
            pdfTable.AddCell(pdfCell);

            pdfTable.CompleteRow();
            #endregion
        }