Пример #1
0
        public Object GetGolfJornadas(int eventoDeportivoId)
        {
            Datos data = new Datos();

            data.data = GolfJornada.GetGolfJornadas(eventoDeportivoId);
            return(data);
        }
Пример #2
0
        public Object GetGolfJornada(int jornadaId)
        {
            Datos data = new Datos();

            data.data = GolfJornada.GetGolfJornada(jornadaId);
            return(data);
        }
Пример #3
0
        public HttpResponseMessage GetRptListadoGolf(int eventoId, int jornadaId, int categoriaId, string jornada, string categoria)
        {
            DataTable dtLista       = GolfJornada.GetLista(Convert.ToInt32(jornadaId), Convert.ToInt32(categoriaId));
            DataTable dtHoyos       = GolfHoyoPar.GetGolfHoyoPar((int)HoyoPar.Hoyo);
            string    pathResources = WebApiApplication.ApplicationResources;
            string    ruta          = RptListadoGolf.ReporteListado(dtLista, dtHoyos, jornada, categoria, eventoId, pathResources);

            return(getReportePDF(ruta));
        }
Пример #4
0
        private static void SetHead(string categoria, string descEvento, string lugarEvento, int eventoid)
        {
            float legalMarginWidth  = ItextUtils.CentimetersToPoints(33.02F);
            float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F);
            float marginLeft        = ItextUtils.CentimetersToPoints(1);
            float marginRight       = ItextUtils.CentimetersToPoints(1);
            float marginTop         = ItextUtils.CentimetersToPoints(1);
            float marginBottom      = ItextUtils.CentimetersToPoints(4);


            documentPdf = new Document();
            documentPdf.SetPageSize(PageSize.LETTER);
            documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom);

            PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create));

            HeaderGolf header = new HeaderGolf();

            header.Titulo       = lugarEvento;
            header.TituloIdioma = "Casa de campo COCHABAMBA";
            header.SubTitulo    = descEvento;
            header.Deporte      = "golf";
            header.HasLeyenda   = true;

            header.Jornada            = "todas";
            header.Categoria          = categoria;
            header.User               = "";// user.Username;
            header.NombreReporte      = "Resultados Finales.";
            header.LogoDerecha        = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "golf.png"));
            header.LogoIzquierda      = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "Federacion.png"));
            header.LogoAbajoDerecha   = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "marcaDoble.png"));
            header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "hammerLogoH.png"));
            header.Fecha              = GolfJornada.GetFechasJornadas(eventoid);

            PdfPTable leyen = new PdfPTable(new float[] { 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1 });

            leyen.AddCell(DrawTable.DrawCell("Leyenda", 6, CellBorder.NONE, CellAlignment.Left, 14, CellFontStyle.Bold));
            leyen.AddCell(DrawTable.DrawCellHeader("Hoyo en Uno", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.YELLOW));
            leyen.AddCell(DrawTable.DrawCellHeader("Albatros", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(192, 119, 160)));
            leyen.AddCell(DrawTable.DrawCellHeader("Eagle", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(248, 177, 17)));
            leyen.AddCell(DrawTable.DrawCellHeader("Birdie", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(35, 190, 82)));
            leyen.AddCell(DrawTable.DrawCellHeader("PAR", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader("Bogey", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(92, 119, 229)));
            leyen.AddCell(DrawTable.DrawCellHeader("Doble Bogey o más", 5, CellBorder.UNDEFINED, CellAlignment.Center, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Buttom, CellFontStyle.Normal, new BaseColor(237, 62, 48)));
            header.leyendas = leyen;

            writer.PageEvent = header;
            documentPdf.Open();
        }
Пример #5
0
        public HttpResponseMessage GetDetallePersonaCompetidor(int personaId, int eventoId, string categoriaName)
        {
            List <GolfJornada> list = GolfJornada.GetGolfJornadas(Convert.ToInt32(eventoId));
            string             ids  = string.Empty;

            foreach (GolfJornada item in list)
            {
                if (string.IsNullOrEmpty(ids))
                {
                    ids = item.JornadaId.ToString();
                }
                else
                {
                    ids = string.Format("{0},{1}", ids, item.JornadaId);
                }
            }
            DataTable dtDatosPersonales = GolfCompetidor.GetGolfCompetidorByPersonaId(personaId);
            string    pathResources     = WebApiApplication.ApplicationResources;
            string    path = GolfCompetidorReport.ReporteResultadosCompetidor(dtDatosPersonales, eventoId, categoriaName, ids, personaId, pathResources);

            return(getReportePDF(path));
        }
        private static void SetHead(string categoria, string descEvento, string lugarEvento, int eventoid)
        {
            float legalMarginWidth  = ItextUtils.CentimetersToPoints(33.02F);
            float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F);
            float marginLeft        = ItextUtils.CentimetersToPoints(1);
            float marginRight       = ItextUtils.CentimetersToPoints(1);
            float marginTop         = ItextUtils.CentimetersToPoints(1);
            float marginBottom      = ItextUtils.CentimetersToPoints(4);


            documentPdf = new Document();
            documentPdf.SetPageSize(PageSize.LETTER.Rotate());
            documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom);

            PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create));

            HeaderGolf header = new HeaderGolf();

            header.Titulo       = lugarEvento;
            header.TituloIdioma = "Casa de campo COCHABAMBA";
            header.SubTitulo    = descEvento;
            header.Deporte      = "golf";
            header.HasLeyenda   = false;

            header.Jornada            = "todas";
            header.Categoria          = categoria;
            header.User               = "";// user.Username;
            header.NombreReporte      = "Resultados Finales.";
            header.LogoDerecha        = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "golf.png"));
            header.LogoIzquierda      = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "Federacion.png"));
            header.LogoAbajoDerecha   = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "marcaDoble.png"));
            header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "hammerLogoH.png"));
            header.Fecha              = GolfJornada.GetFechasJornadas(eventoid);

            writer.PageEvent = header;
            documentPdf.Open();
        }
Пример #7
0
        public static string ReporteJornadaInscritos(DataTable dtInscritos, string pathSendet, int eventoid, int categoriaId, int jornadaId)
        {
            try
            {
                pathResource = pathSendet;
                fileName     = string.Format("Jornadas=){0:yyMMdd_HHmmss}.pdf", DateTime.Now);
                path         = string.Format(@"{0}\Reportes\{1}", pathResource, fileName);
                pathImage    = string.Format(@"{0}\Images\", pathResource);
                DataTable dt = EventoDeportivo.GetEventoName(eventoid);



                HeaderGolf header = new HeaderGolf();
                header.Titulo       = dt.Rows.Count > 0 ? dt.Rows[0]["Nombre"].ToString().ToUpper() : "";
                header.TituloIdioma = "";
                header.SubTitulo    = dt.Rows.Count > 0 ? dt.Rows[0]["Ubicacion"].ToString().ToUpper() : "";
                header.Categoria    = categoriaId == 0 ? "Todos" : GolfCategoria.GetGolCategoria(categoriaId).Descripcion;
                header.Fecha        = GolfJornada.GetFechasJornadas(eventoid);
                var jornada = GolfJornada.GetGolfJornada(jornadaId);
                header.Jornada = jornadaId == 0? "Todos" : jornada.Descripcion;

                SetHead(header);
                //dtInscritos.Columns.Remove("PersonaId");

                SetBody(dtInscritos, header.Titulo, jornada.Descripcion, jornada.Fecha?.ToString("dd MMM yyyy"));
                dt.Dispose();
                return(path);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                SetFooter();
            }
        }
Пример #8
0
 public DataTable GetGolfNroJornadas(int eventoId)
 {
     return(GolfJornada.GetNroJornadas(eventoId));
 }
Пример #9
0
 public DataTable GetGolfListaSHCP(int jornadaId, int categoriaId)
 {
     return(GolfJornada.GetListaSHCP(jornadaId, categoriaId));
 }
Пример #10
0
 public DataTable GetEquiposJornada(int EventoId, int PruebaEventoId, int par)
 {
     return(GolfJornada.getEquiposResultados(EventoId, PruebaEventoId, par));
 }
Пример #11
0
        public string GetGolfJornadasFechas(int eventoDeportivoId)
        {
            List <DateTime> ls = GolfJornada.GetGolfJornadasFechas(eventoDeportivoId);

            return(string.Format("Del {0:dd MMMM} al {1:dd MMMM} {1:yyyy}", ls[0], ls[ls.Count - 1]));
        }
Пример #12
0
 public bool SaveGolfJornada([FromBody] GolfJornada jornada)
 {
     return(jornada.Save());
 }
Пример #13
0
        public bool DeleteGolfJornada(int jornadaId)
        {
            GolfJornada gj = new GolfJornada();

            return(gj.Delete(jornadaId));
        }
Пример #14
0
        private static void SetHead(string jornada, string categoria, string descEvento, string lugarEvento, int eventoId)
        {
            float legalMarginWidth  = ItextUtils.CentimetersToPoints(33.02F);
            float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F);
            float marginLeft        = ItextUtils.CentimetersToPoints(1);
            float marginRight       = ItextUtils.CentimetersToPoints(1);
            float marginTop         = ItextUtils.CentimetersToPoints(1);
            float marginBottom      = ItextUtils.CentimetersToPoints(4);


            documentPdf = new Document();
            documentPdf.SetPageSize(PageSize.LETTER.Rotate());
            documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom);
            //Segir buscando como cambiarl la funte de las letras de todo el doc
            //documentPdf

            PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create));

            HeaderGolf header = new HeaderGolf();

            header.Titulo       = lugarEvento;
            header.TituloIdioma = "Casa de Campo Cochabamba";
            header.SubTitulo    = descEvento;
            header.Deporte      = "golf";
            header.HasLeyenda   = true;

            header.Jornada            = jornada;
            header.Categoria          = categoria;
            header.User               = "******";
            header.NombreReporte      = "ListadoEquipos";
            header.LogoDerecha        = Image.GetInstance(string.Format(@"{0}\Golf\golf.png", pathImage));
            header.LogoIzquierda      = Image.GetInstance(string.Format(@"{0}\Golf\Federacion.png", pathImage));
            header.LogoAbajoDerecha   = Image.GetInstance(string.Format(@"{0}\Hammer\marcaDoble.png", pathImage));
            header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\hammerLogoH.png", pathImage));

            string fechas = string.Empty;

            foreach (DateTime item in GolfJornada.GetGolfJornadasFechas(eventoId))
            {
                if (string.IsNullOrEmpty(fechas))
                {
                    fechas = string.Format(DBGlobalization.GetCultureInfo(), "{0:dd}", item);
                }
                else
                {
                    fechas = string.Format(DBGlobalization.GetCultureInfo(), "{0},{1:dd}", fechas, item);
                }
            }
            header.Fecha = fechas;

            PdfPTable leyen = new PdfPTable(new float[] { 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1 });

            leyen.AddCell(DrawTable.DrawCell("Leyenda", 6, CellBorder.NONE, CellAlignment.Left, 14, CellFontStyle.Bold));
            leyen.AddCell(DrawTable.DrawCellHeader("Hoyo en Uno", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.YELLOW));
            leyen.AddCell(DrawTable.DrawCellHeader("Albatros", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(192, 119, 160)));
            leyen.AddCell(DrawTable.DrawCellHeader("Eagle", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(248, 177, 17)));
            leyen.AddCell(DrawTable.DrawCellHeader("Birdie", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(35, 190, 82)));
            leyen.AddCell(DrawTable.DrawCellHeader("PAR", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader("Bogey", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(92, 119, 229)));
            leyen.AddCell(DrawTable.DrawCellHeader("Doble Bogey o más", 5, CellBorder.UNDEFINED, CellAlignment.Center, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE));
            leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Buttom, CellFontStyle.Normal, new BaseColor(237, 62, 48)));
            header.leyendas = leyen;

            writer.PageEvent = header;
            documentPdf.Open();
        }