예제 #1
0
        public void historialEntrenamiento(string UsernameUsuario)
        {
            ListaEntrenamiento = new List <Entrenamiento>();

            //Base de Datos
            string          connectionString = "Server=127.0.0.1;Port=3306;Database=DB_Gran_Escape;Uid=root;password=root;";
            MySqlConnection conexion         = new MySqlConnection(connectionString);

            conexion.Open();

            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = conexion;
            cmd.CommandText = "SELECT * FROM Entrenamiento WHERE Usuario_id = @id;";
            cmd.Parameters.Add("@id", MySqlDbType.VarChar).Value = UsernameUsuario;

            Entrenamiento en1 = new Entrenamiento();

            ListaEntrenamiento = new List <Entrenamiento>();
            int pos = 0;

            //Agarra información de Base de Datos y se lo pone a las variables
            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    en1         = new Entrenamiento();
                    en1.numero  = ++pos;
                    en1.puntaje = Convert.ToInt32(reader["Puntaje"]);
                    en1.racha   = Convert.ToInt32(reader["StreakMax"]);
                    en1.fecha   = DateTime.Parse(reader["Fecha"].ToString()).ToShortDateString();
                    ListaEntrenamiento.Add(en1);
                }
            }
            conexion.Dispose();
        }
예제 #2
0
        public Inscripcion obtenerInscripcionPorId(int id)
        {
            Inscripcion i = new Inscripcion();

            bd.consultarBD("select * from vw_listaInscripcion where id = " + id);
            while (bd.Lector.Read())
            {
                if (!bd.Lector.IsDBNull(0))
                {
                    i.Id = bd.Lector.GetInt32(0);
                }

                Socio socio = new Socio();
                if (!bd.Lector.IsDBNull(1))
                {
                    socio.Id = bd.Lector.GetInt32(1);
                }
                if (!bd.Lector.IsDBNull(2))
                {
                    socio.Nombre = bd.Lector.GetString(2);
                }
                if (!bd.Lector.IsDBNull(3))
                {
                    socio.Apellido = bd.Lector.GetString(3);
                }
                if (!bd.Lector.IsDBNull(4))
                {
                    socio.IdSexo = bd.Lector.GetInt32(4);
                }
                if (!bd.Lector.IsDBNull(5))
                {
                    socio.Sexo = bd.Lector.GetString(5);
                }
                if (!bd.Lector.IsDBNull(6))
                {
                    socio.Dni = bd.Lector.GetString(6);
                }
                if (!bd.Lector.IsDBNull(7))
                {
                    socio.Domicilio = bd.Lector.GetString(7);
                }
                if (!bd.Lector.IsDBNull(8))
                {
                    socio.Localidad = new Localidad(bd.Lector.GetInt32(8), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11)));
                }
                if (!bd.Lector.IsDBNull(12))
                {
                    socio.Telefono = bd.Lector.GetString(12);
                }
                if (!bd.Lector.IsDBNull(13))
                {
                    socio.Email = bd.Lector.GetString(13);
                }
                if (!bd.Lector.IsDBNull(14))
                {
                    socio.FechaNacimiento = bd.Lector.GetDateTime(14);
                }
                if (!bd.Lector.IsDBNull(15))
                {
                    socio.Nacionalidad = new Pais(bd.Lector.GetInt32(15), bd.Lector.GetString(16));
                }
                if (!bd.Lector.IsDBNull(17))
                {
                    socio.Tutor = new Tutor(bd.Lector.GetInt32(17), bd.Lector.GetString(18), bd.Lector.GetString(19), bd.Lector.GetInt32(20), bd.Lector.GetString(21), bd.Lector.GetString(22), bd.Lector.GetString(23), new Localidad(bd.Lector.GetInt32(24), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11))), bd.Lector.GetString(25), bd.Lector.GetString(26), bd.Lector.GetDateTime(27), new Pais(bd.Lector.GetInt32(28), bd.Lector.GetString(16)));
                }
                else
                {
                    socio.Tutor = null;
                }

                i.Socio = socio;

                Entrenamiento entrenamiento = new Entrenamiento();
                if (!bd.Lector.IsDBNull(29))
                {
                    entrenamiento.Id = bd.Lector.GetInt32(29);
                }

                Deporte deporte = new Deporte();
                if (!bd.Lector.IsDBNull(30))
                {
                    deporte.Id = bd.Lector.GetInt32(30);
                }
                if (!bd.Lector.IsDBNull(31))
                {
                    deporte.Nombre = bd.Lector.GetString(31);
                }
                if (!bd.Lector.IsDBNull(32))
                {
                    deporte.Clasificacion = new ClasificacionDeporte(bd.Lector.GetInt32(32), bd.Lector.GetString(33));
                }

                Predio predio = new Predio();
                if (!bd.Lector.IsDBNull(34))
                {
                    predio.Id = bd.Lector.GetInt32(34);
                }
                if (!bd.Lector.IsDBNull(35))
                {
                    predio.Descripcion = bd.Lector.GetString(35);
                }

                entrenamiento.Deporte = deporte;
                entrenamiento.Predio  = predio;

                if (!bd.Lector.IsDBNull(36))
                {
                    entrenamiento.PrecioMensual = bd.Lector.GetDouble(36);
                }
                if (!bd.Lector.IsDBNull(37))
                {
                    entrenamiento.PrecioMatricula = bd.Lector.GetDouble(37);
                }
                if (!bd.Lector.IsDBNull(38))
                {
                    entrenamiento.CantidadCuotas = bd.Lector.GetInt32(38);
                }

                i.Entrenamiento = entrenamiento;

                if (!bd.Lector.IsDBNull(39))
                {
                    i.Fecha = bd.Lector.GetDateTime(39);
                }
                if (!bd.Lector.IsDBNull(40))
                {
                    i.EstaSaldado = bd.Lector.GetBoolean(40);
                }
            }
            bd.Lector.Close();
            bd.desconectar();
            return(i);
        }
예제 #3
0
        public Inscripcion obtenerInscripcionPorIdRecibo(int id)
        {
            Inscripcion i = new Inscripcion();

            bd.consultarBD("select idInscripcion, idSocio, nombreSocio, apellidoSocio, idSexoSocio, sexoSocio, dniSocio, domicilioSocio, idLocalidad, nombreLocalidad, idProvincia, nombreProvincia, telefonoSocio, emailSocio, fechaNacimientoSocio, idNacionalidad, nacionalidadSocio, idTutor, nombreTutor, apellidoTutor, idSexoTutor, sexoTutor, dniTutor, domicilioTutor, idLocalidadTutor, telefonoTutor, emailTutor, fechaNacimientoTutor, idNacionalidadTutor, idEntrenamiento, idDeporte, nombreDeporte, id_clasificacion, tipoDeporte, idPredio, li.descripcion, precioMensual, precioMatricula, cantidadCuotas, li.fecha fechaInscripcion, li.estaSaldado from vw_listaInscripcion li join Pago p on li.idInscripcion = p.inscripcion join Detalle_Recibo dr on dr.pago = p.id join Recibo r on r.id = dr.recibo where r.id = " + id + " group by idInscripcion, idSocio, nombreSocio, apellidoSocio, idSexoSocio, sexoSocio, dniSocio, domicilioSocio, idLocalidad, nombreLocalidad, idProvincia, nombreProvincia, telefonoSocio, emailSocio, fechaNacimientoSocio, idNacionalidad, nacionalidadSocio, idTutor, nombreTutor, apellidoTutor, idSexoTutor,sexoTutor, dniTutor, domicilioTutor, idLocalidadTutor, telefonoTutor, emailTutor, fechaNacimientoTutor, idNacionalidadTutor, idEntrenamiento, idDeporte, nombreDeporte, id_clasificacion, tipoDeporte, idPredio, li.descripcion, precioMensual, precioMatricula, cantidadCuotas, li.fecha, li.estaSaldado");
            while (bd.Lector.Read())
            {
                if (!bd.Lector.IsDBNull(0))
                {
                    i.Id = bd.Lector.GetInt32(0);
                }

                Socio socio = new Socio();
                if (!bd.Lector.IsDBNull(1))
                {
                    socio.Id = bd.Lector.GetInt32(1);
                }
                if (!bd.Lector.IsDBNull(2))
                {
                    socio.Nombre = bd.Lector.GetString(2);
                }
                if (!bd.Lector.IsDBNull(3))
                {
                    socio.Apellido = bd.Lector.GetString(3);
                }
                if (!bd.Lector.IsDBNull(4))
                {
                    socio.IdSexo = bd.Lector.GetInt32(4);
                }
                if (!bd.Lector.IsDBNull(5))
                {
                    socio.Sexo = bd.Lector.GetString(5);
                }
                if (!bd.Lector.IsDBNull(6))
                {
                    socio.Dni = bd.Lector.GetString(6);
                }
                if (!bd.Lector.IsDBNull(7))
                {
                    socio.Domicilio = bd.Lector.GetString(7);
                }
                if (!bd.Lector.IsDBNull(8))
                {
                    socio.Localidad = new Localidad(bd.Lector.GetInt32(8), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11)));
                }
                if (!bd.Lector.IsDBNull(12))
                {
                    socio.Telefono = bd.Lector.GetString(12);
                }
                if (!bd.Lector.IsDBNull(13))
                {
                    socio.Email = bd.Lector.GetString(13);
                }
                if (!bd.Lector.IsDBNull(14))
                {
                    socio.FechaNacimiento = bd.Lector.GetDateTime(14);
                }
                if (!bd.Lector.IsDBNull(15))
                {
                    socio.Nacionalidad = new Pais(bd.Lector.GetInt32(15), bd.Lector.GetString(16));
                }
                if (!bd.Lector.IsDBNull(17))
                {
                    socio.Tutor = new Tutor(bd.Lector.GetInt32(17), bd.Lector.GetString(18), bd.Lector.GetString(19), bd.Lector.GetInt32(20), bd.Lector.GetString(21), bd.Lector.GetString(22), bd.Lector.GetString(23), new Localidad(bd.Lector.GetInt32(24), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11))), bd.Lector.GetString(25), bd.Lector.GetString(26), bd.Lector.GetDateTime(27), new Pais(bd.Lector.GetInt32(28), bd.Lector.GetString(16)));
                }
                else
                {
                    socio.Tutor = null;
                }

                i.Socio = socio;

                Entrenamiento entrenamiento = new Entrenamiento();
                if (!bd.Lector.IsDBNull(29))
                {
                    entrenamiento.Id = bd.Lector.GetInt32(29);
                }

                Deporte deporte = new Deporte();
                if (!bd.Lector.IsDBNull(30))
                {
                    deporte.Id = bd.Lector.GetInt32(30);
                }
                if (!bd.Lector.IsDBNull(31))
                {
                    deporte.Nombre = bd.Lector.GetString(31);
                }
                if (!bd.Lector.IsDBNull(32))
                {
                    deporte.Clasificacion = new ClasificacionDeporte(bd.Lector.GetInt32(32), bd.Lector.GetString(33));
                }

                Predio predio = new Predio();
                if (!bd.Lector.IsDBNull(34))
                {
                    predio.Id = bd.Lector.GetInt32(34);
                }
                if (!bd.Lector.IsDBNull(35))
                {
                    predio.Descripcion = bd.Lector.GetString(35);
                }

                entrenamiento.Deporte = deporte;
                entrenamiento.Predio  = predio;

                if (!bd.Lector.IsDBNull(36))
                {
                    entrenamiento.PrecioMensual = bd.Lector.GetDouble(36);
                }
                if (!bd.Lector.IsDBNull(37))
                {
                    entrenamiento.PrecioMatricula = bd.Lector.GetDouble(37);
                }
                if (!bd.Lector.IsDBNull(38))
                {
                    entrenamiento.CantidadCuotas = bd.Lector.GetInt32(38);
                }

                i.Entrenamiento = entrenamiento;

                if (!bd.Lector.IsDBNull(39))
                {
                    i.Fecha = bd.Lector.GetDateTime(39);
                }
                if (!bd.Lector.IsDBNull(40))
                {
                    i.EstaSaldado = bd.Lector.GetBoolean(40);
                }
            }
            bd.Lector.Close();
            bd.desconectar();
            return(i);
        }
예제 #4
0
        private void generarPDF(Entrenamiento e)
        {
            try
            {
                // Cuadro de dialogo del sistema para guardar el PDF donde elija el usuario
                SaveFileDialog save = new SaveFileDialog();
                save.Filter           = "Archivo PDF|*.pdf";
                save.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                save.FileName         = "Lista de inscriptos del entrenamiento N° " + e.Id;

                if (save.ShowDialog() == DialogResult.OK)
                {
                    Document   doc = new Document(PageSize.A4);
                    FileStream fl  = new FileStream(save.FileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
                    PdfWriter.GetInstance(doc, fl);

                    // Metadata (titulo y autor del archivo pdf)
                    doc.AddAuthor("Club Deportivo Vecinos Unidos");
                    doc.AddTitle("Lista de inscriptos");
                    doc.Open();

                    // Imagen logo
                    iTextSharp.text.Image imagen = iTextSharp.text.Image.GetInstance(@"C:\Users\pepa_\Documents\Visual Studio 2019\Projects\CDVU\CDVU\Resources\vecinos-unidos1.png");
                    imagen.BorderWidth = 0;
                    imagen.ScalePercent(20f);
                    imagen.Alignment = Element.ALIGN_RIGHT;

                    // Titulo
                    Paragraph titulo = new Paragraph("Lista de inscriptos", FontFactory.GetFont("Calibri", 30));
                    titulo.Alignment = Element.ALIGN_CENTER;

                    // Tabla cabecera
                    PdfPTable tablaCabecera = new PdfPTable(2);
                    tablaCabecera.WidthPercentage = 100;

                    PdfPCell celda1 = new PdfPCell(titulo);
                    celda1.Border = 0;
                    celda1.HorizontalAlignment = 0;
                    celda1.VerticalAlignment   = 1;
                    tablaCabecera.AddCell(celda1);

                    PdfPCell celda2 = new PdfPCell(imagen);
                    celda2.Border = 0;
                    celda2.HorizontalAlignment = 2;
                    celda2.VerticalAlignment   = 1;
                    tablaCabecera.AddCell(celda2);

                    tablaCabecera.SpacingAfter = 15;
                    doc.Add(tablaCabecera);

                    PdfPTable tablaRecibo = new PdfPTable(1);
                    tablaRecibo.WidthPercentage = 100;



                    Phrase datosRecibo = new Phrase("DATOS DEL ENTRENAMIENTO");
                    datosRecibo.Font.Size = 12;
                    datosRecibo.Font.SetStyle("italic");
                    tablaRecibo.AddCell(datosRecibo);

                    // Deporte
                    Phrase deporte = new Phrase("Deporte: " + e.Deporte.ToString());
                    deporte.Font.Size = 10;
                    deporte.Font.SetStyle("bold");

                    PdfPCell renglon9 = new PdfPCell(deporte);
                    renglon9.Border = 0;
                    renglon9.HorizontalAlignment = 0;
                    renglon9.VerticalAlignment   = 1;
                    renglon9.Padding             = 5;
                    tablaRecibo.AddCell(renglon9);

                    // Predio
                    Phrase predio = new Phrase("Predio: " + e.Predio.ToString());
                    predio.Font.Size = 10;
                    predio.Font.SetStyle("bold");

                    PdfPCell renglon10 = new PdfPCell(predio);
                    renglon10.Border = 0;
                    renglon10.HorizontalAlignment = 0;
                    renglon10.VerticalAlignment   = 1;
                    renglon10.Padding             = 5;
                    tablaRecibo.AddCell(renglon10);

                    // Profesores
                    List <Profesor> listaProfe = new GestorProfesor().listaProfesorSegunIdDeporte(e.Deporte.Id);
                    string          nombres    = "";
                    foreach (Profesor x in listaProfe)
                    {
                        nombres += "\t• " + x.Nombre + " " + x.Apellido + "\n";
                    }
                    Phrase profesor = new Phrase("Profesores:\n" + nombres);
                    profesor.Font.Size = 10;
                    profesor.Font.SetStyle("bold");

                    PdfPCell renglon1 = new PdfPCell(profesor);
                    renglon1.Border = 0;
                    renglon1.HorizontalAlignment = 0;
                    renglon1.VerticalAlignment   = 1;
                    renglon1.Padding             = 5;
                    tablaRecibo.AddCell(renglon1);

                    // Horario
                    List <Turno> turnos = ge.listaTurnoSegunIdEntrenamiento(e.Id);

                    string dia          = "";
                    string horaEntrada  = "";
                    string horaSalida   = "";
                    string textoHorario = "";
                    foreach (Turno x in turnos)
                    {
                        dia           = x.Dia;
                        horaEntrada   = x.HoraEntrada.TimeOfDay.ToString();
                        horaSalida    = x.HoraSalida.TimeOfDay.ToString();
                        textoHorario += "\t• " + dia + " de " + horaEntrada + " a " + horaSalida + "\n";
                    }
                    Phrase horario = new Phrase("Horario:\n" + textoHorario);
                    horario.Font.Size = 10;
                    horario.Font.SetStyle("bold");

                    PdfPCell renglon2 = new PdfPCell(horario);
                    renglon2.Border = 0;
                    renglon2.HorizontalAlignment = 0;
                    renglon2.VerticalAlignment   = 1;
                    renglon2.Padding             = 5;
                    tablaRecibo.AddCell(renglon2);

                    tablaRecibo.SpacingBefore = 5;
                    tablaRecibo.SpacingAfter  = 15;

                    doc.Add(tablaRecibo);


                    // Tabla y cabecera que contendra los datos de los socios
                    PdfPTable tablaLista = new PdfPTable(3);
                    tablaLista.WidthPercentage = 100;

                    Phrase fraseColumna1 = new Phrase("Nombre y apellido");
                    fraseColumna1.Font.Color = BaseColor.WHITE;
                    fraseColumna1.Font.Size  = 11;
                    fraseColumna1.Font.SetStyle("bold");

                    Phrase fraseColumna2 = new Phrase("DNI");
                    fraseColumna2.Font.Color = BaseColor.WHITE;
                    fraseColumna2.Font.Size  = 11;
                    fraseColumna2.Font.SetStyle("bold");

                    Phrase fraseColumna3 = new Phrase("Teléfono");
                    fraseColumna3.Font.Color = BaseColor.WHITE;
                    fraseColumna3.Font.Size  = 11;
                    fraseColumna3.Font.SetStyle("bold");

                    PdfPCell columnaCabecera1 = new PdfPCell(fraseColumna1);
                    PdfPCell columnaCabecera2 = new PdfPCell(fraseColumna2);
                    PdfPCell columnaCabecera3 = new PdfPCell(fraseColumna3);

                    columnaCabecera1.BackgroundColor     = BaseColor.BLACK;
                    columnaCabecera1.Border              = 0;
                    columnaCabecera1.HorizontalAlignment = 1;
                    columnaCabecera1.VerticalAlignment   = 1;
                    columnaCabecera1.Padding             = 4;

                    columnaCabecera2.BackgroundColor     = BaseColor.BLACK;
                    columnaCabecera2.Border              = 0;
                    columnaCabecera2.HorizontalAlignment = 1;
                    columnaCabecera2.VerticalAlignment   = 1;
                    columnaCabecera2.Padding             = 4;

                    columnaCabecera3.BackgroundColor     = BaseColor.BLACK;
                    columnaCabecera3.Border              = 0;
                    columnaCabecera3.HorizontalAlignment = 1;
                    columnaCabecera3.VerticalAlignment   = 1;
                    columnaCabecera3.Padding             = 4;

                    tablaLista.AddCell(columnaCabecera1);
                    tablaLista.AddCell(columnaCabecera2);
                    tablaLista.AddCell(columnaCabecera3);

                    foreach (Socio socio in gs.listaSociosInscriptos(e.Id))
                    {
                        // Agrego los socios a la tabla

                        Phrase nombre = new Phrase(socio.Nombre + " " + socio.Apellido);
                        nombre.Font.Color = BaseColor.BLACK;
                        nombre.Font.Size  = 10;
                        nombre.Font.SetStyle("bold");

                        Phrase dni = new Phrase(socio.Dni);
                        dni.Font.Color = BaseColor.BLACK;
                        dni.Font.Size  = 10;
                        dni.Font.SetStyle("bold");

                        Phrase telefono = new Phrase(socio.Telefono);
                        telefono.Font.Color = BaseColor.BLACK;
                        telefono.Font.Size  = 10;
                        telefono.Font.SetStyle("bold");

                        PdfPCell filaNombre   = new PdfPCell(nombre);
                        PdfPCell filaDni      = new PdfPCell(dni);
                        PdfPCell filaTelefono = new PdfPCell(telefono);

                        filaNombre.BackgroundColor     = BaseColor.LIGHT_GRAY;
                        filaNombre.Border              = 0;
                        filaNombre.HorizontalAlignment = 1;
                        filaNombre.Padding             = 4;

                        filaDni.BackgroundColor     = BaseColor.LIGHT_GRAY;
                        filaDni.Border              = 0;
                        filaDni.HorizontalAlignment = 1;
                        filaDni.Padding             = 4;

                        filaTelefono.BackgroundColor     = BaseColor.LIGHT_GRAY;
                        filaTelefono.Border              = 0;
                        filaTelefono.HorizontalAlignment = 1;
                        filaTelefono.Padding             = 4;

                        tablaLista.AddCell(filaNombre);
                        tablaLista.AddCell(filaDni);
                        tablaLista.AddCell(filaTelefono);
                    }
                    tablaLista.SpacingAfter = 5;
                    doc.Add(tablaLista);

                    // Tabla para el total
                    PdfPTable tablaTotal = new PdfPTable(1);
                    tablaTotal.WidthPercentage = 100;
                    tablaTotal.SpacingAfter    = 15;

                    Phrase generado = new Phrase("Archivo generado el día " + DateTime.Today.ToString("dd/MM/yyyy"));
                    generado.Font.Color = BaseColor.BLACK;
                    generado.Font.Size  = 7;
                    generado.Font.SetStyle("italic");
                    doc.Add(generado);

                    // Cierro el documento
                    doc.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se pudo generar el pdf. \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        private void setHorarioAlForm(Entrenamiento entrenamiento)
        {
            foreach (Turno x in ge.listaTurnoSegunIdEntrenamiento(entrenamiento.Id))
            {
                if (x.IdDia == 1)
                {
                    chkLunes.Checked          = true;
                    dtpHoraEntradaLunes.Value = x.HoraEntrada;
                    dtpHoraSalidaLunes.Value  = x.HoraSalida;
                }
                if (x.IdDia == 2)
                {
                    chkMartes.Checked          = true;
                    dtpHoraEntradaMartes.Value = x.HoraEntrada;
                    dtpHoraSalidaMartes.Value  = x.HoraSalida;
                }
                if (x.IdDia == 3)
                {
                    chkMiercoles.Checked          = true;
                    dtpHoraEntradaMiercoles.Value = x.HoraEntrada;
                    dtpHoraSalidaMiercoles.Value  = x.HoraSalida;
                }
                if (x.IdDia == 4)
                {
                    chkJueves.Checked          = true;
                    dtpHoraEntradaJueves.Value = x.HoraEntrada;
                    dtpHoraSalidaJueves.Value  = x.HoraSalida;
                }
                if (x.IdDia == 5)
                {
                    chkViernes.Checked          = true;
                    dtpHoraEntradaViernes.Value = x.HoraEntrada;
                    dtpHoraSalidaViernes.Value  = x.HoraSalida;
                }
                if (x.IdDia == 6)
                {
                    chkSabado.Checked          = true;
                    dtpHoraEntradaSabado.Value = x.HoraEntrada;
                    dtpHoraSalidaSabado.Value  = x.HoraSalida;
                }
                if (x.IdDia == 7)
                {
                    chkDomingo.Checked          = true;
                    dtpHoraEntradaDomingo.Value = x.HoraEntrada;
                    dtpHoraSalidaDomingo.Value  = x.HoraSalida;
                }

                if (chkLunes.Checked)
                {
                    lblLunes.Text = " de " + dtpHoraEntradaLunes.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaLunes.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkMartes.Checked)
                {
                    lblMartes.Text = " de " + dtpHoraEntradaMartes.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaMartes.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkMiercoles.Checked)
                {
                    lblMiercoles.Text = " de " + dtpHoraEntradaMiercoles.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaMiercoles.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkJueves.Checked)
                {
                    lblJueves.Text = " de " + dtpHoraEntradaJueves.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaJueves.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkViernes.Checked)
                {
                    lblViernes.Text = " de " + dtpHoraEntradaViernes.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaViernes.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkSabado.Checked)
                {
                    lblSabado.Text = " de " + dtpHoraEntradaSabado.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaSabado.Value.TimeOfDay.ToString() + " hs.";
                }
                if (chkDomingo.Checked)
                {
                    lblDomingo.Text = " de " + dtpHoraEntradaDomingo.Value.TimeOfDay.ToString() + " hs. a " + dtpHoraSalidaDomingo.Value.TimeOfDay.ToString() + " hs.";
                }
            }
        }
예제 #6
0
 private void setInformacion(Entrenamiento e)
 {
     lblId.Text = Convert.ToString(e.Id);
     lblDeporteSeleccionado.Text = e.Deporte.ToString();
 }
예제 #7
0
 public override void Learn(Entrenamiento trainingSample, int currentIteration, int trainingEpochs)
 {
     meanSquaredError = 0d;
     isValidMSE       = true;
     base.Learn(trainingSample, currentIteration, trainingEpochs);
 }
예제 #8
0
        public List <Pago> listaCuotaSinPagarPorIdInscripcion(int idInscripcion)
        {
            List <Pago> lista = new List <Pago>();

            bd.consultarBD("select idInscripcion, idSocio, nombreSocio, apellidoSocio, idSexoSocio, sexoSocio, dniSocio, domicilioSocio, idLocalidad, nombreLocalidad, idProvincia, nombreProvincia, telefonoSocio, emailSocio, fechaNacimientoSocio, idNacionalidad, nacionalidadSocio, idTutor, nombreTutor, apellidoTutor, idSexoTutor, sexoTutor, dniTutor, domicilioTutor, idLocalidadTutor, telefonoTutor, emailTutor, fechaNacimientoTutor, idNacionalidadTutor, idEntrenamiento, idDeporte, nombreDeporte, id_clasificacion, tipoDeporte, idPredio, li.descripcion, precioMensual, precioMatricula, cantidadCuotas, li.fecha, li.estaSaldado, li.cantidadCuotas - COUNT(p.id) 'cantidad de cuotas sin pagar', COUNT(p.id) 'cantidad de cuotas pagas' from vw_listaInscripcion li left join Pago p on li.idInscripcion = p.inscripcion where li.idInscripcion = " + idInscripcion + " group by idInscripcion, idSocio, nombreSocio, apellidoSocio, idSexoSocio, sexoSocio, dniSocio, domicilioSocio, idLocalidad, nombreLocalidad, idProvincia, nombreProvincia, telefonoSocio, emailSocio, fechaNacimientoSocio, idNacionalidad, nacionalidadSocio, idTutor, nombreTutor, apellidoTutor, idSexoTutor, sexoTutor, dniTutor, domicilioTutor, idLocalidadTutor, telefonoTutor, emailTutor, fechaNacimientoTutor, idNacionalidadTutor, idEntrenamiento, idDeporte, nombreDeporte, id_clasificacion, tipoDeporte, idPredio, li.descripcion, precioMensual, precioMatricula, cantidadCuotas, li.fecha, li.cantidadCuotas, li.estaSaldado");
            int cantCuotaSinPagar = 0;
            int cantCuotaPagadas  = 0;

            while (bd.Lector.Read())
            {
                Inscripcion i = new Inscripcion();
                if (!bd.Lector.IsDBNull(0))
                {
                    i.Id = bd.Lector.GetInt32(0);
                }

                Socio socio = new Socio();
                if (!bd.Lector.IsDBNull(1))
                {
                    socio.Id = bd.Lector.GetInt32(1);
                }
                if (!bd.Lector.IsDBNull(2))
                {
                    socio.Nombre = bd.Lector.GetString(2);
                }
                if (!bd.Lector.IsDBNull(3))
                {
                    socio.Apellido = bd.Lector.GetString(3);
                }
                if (!bd.Lector.IsDBNull(4))
                {
                    socio.IdSexo = bd.Lector.GetInt32(4);
                }
                if (!bd.Lector.IsDBNull(5))
                {
                    socio.Sexo = bd.Lector.GetString(5);
                }
                if (!bd.Lector.IsDBNull(6))
                {
                    socio.Dni = bd.Lector.GetString(6);
                }
                if (!bd.Lector.IsDBNull(7))
                {
                    socio.Domicilio = bd.Lector.GetString(7);
                }
                if (!bd.Lector.IsDBNull(8))
                {
                    socio.Localidad = new Localidad(bd.Lector.GetInt32(8), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11)));
                }
                if (!bd.Lector.IsDBNull(12))
                {
                    socio.Telefono = bd.Lector.GetString(12);
                }
                if (!bd.Lector.IsDBNull(13))
                {
                    socio.Email = bd.Lector.GetString(13);
                }
                if (!bd.Lector.IsDBNull(14))
                {
                    socio.FechaNacimiento = bd.Lector.GetDateTime(14);
                }
                if (!bd.Lector.IsDBNull(15))
                {
                    socio.Nacionalidad = new Pais(bd.Lector.GetInt32(15), bd.Lector.GetString(16));
                }
                if (!bd.Lector.IsDBNull(17))
                {
                    socio.Tutor = new Tutor(bd.Lector.GetInt32(17), bd.Lector.GetString(18), bd.Lector.GetString(19), bd.Lector.GetInt32(20), bd.Lector.GetString(21), bd.Lector.GetString(22), bd.Lector.GetString(23), new Localidad(bd.Lector.GetInt32(24), bd.Lector.GetString(9), new Provincia(bd.Lector.GetInt32(10), bd.Lector.GetString(11))), bd.Lector.GetString(25), bd.Lector.GetString(26), bd.Lector.GetDateTime(27), new Pais(bd.Lector.GetInt32(28), bd.Lector.GetString(16)));
                }
                else
                {
                    socio.Tutor = null;
                }

                i.Socio = socio;

                Entrenamiento entrenamiento = new Entrenamiento();
                if (!bd.Lector.IsDBNull(29))
                {
                    entrenamiento.Id = bd.Lector.GetInt32(29);
                }

                Deporte deporte = new Deporte();
                if (!bd.Lector.IsDBNull(30))
                {
                    deporte.Id = bd.Lector.GetInt32(30);
                }
                if (!bd.Lector.IsDBNull(31))
                {
                    deporte.Nombre = bd.Lector.GetString(31);
                }
                if (!bd.Lector.IsDBNull(32))
                {
                    deporte.Clasificacion = new ClasificacionDeporte(bd.Lector.GetInt32(32), bd.Lector.GetString(33));
                }

                Predio predio = new Predio();
                if (!bd.Lector.IsDBNull(34))
                {
                    predio.Id = bd.Lector.GetInt32(34);
                }
                if (!bd.Lector.IsDBNull(35))
                {
                    predio.Descripcion = bd.Lector.GetString(35);
                }

                entrenamiento.Deporte = deporte;
                entrenamiento.Predio  = predio;

                if (!bd.Lector.IsDBNull(36))
                {
                    entrenamiento.PrecioMensual = bd.Lector.GetDouble(36);
                }
                if (!bd.Lector.IsDBNull(37))
                {
                    entrenamiento.PrecioMatricula = bd.Lector.GetDouble(37);
                }
                if (!bd.Lector.IsDBNull(38))
                {
                    entrenamiento.CantidadCuotas = bd.Lector.GetInt32(38);
                }

                i.Entrenamiento = entrenamiento;

                if (!bd.Lector.IsDBNull(39))
                {
                    i.Fecha = bd.Lector.GetDateTime(39);
                }
                if (!bd.Lector.IsDBNull(40))
                {
                    i.EstaSaldado = bd.Lector.GetBoolean(40);
                }

                if (!bd.Lector.IsDBNull(41))
                {
                    cantCuotaSinPagar = bd.Lector.GetInt32(41);
                }
                if (!bd.Lector.IsDBNull(42))
                {
                    cantCuotaPagadas = bd.Lector.GetInt32(42);
                }


                if (entrenamiento.PrecioMatricula > 0)
                {
                    cantCuotaSinPagar++;
                }

                for (int j = 0; j < cantCuotaSinPagar; j++)
                {
                    Pago p = new Pago();
                    p.Inscripcion = i;
                    if (j == 0 && cantCuotaPagadas == 0 && entrenamiento.PrecioMatricula > 0)
                    {
                        p.NumeroCuota = 0;
                        p.Descripcion = "Pago de cuota N° 0 - Matrícula";
                        p.Monto       = entrenamiento.PrecioMatricula;
                    }
                    else
                    {
                        if (j == 0 && entrenamiento.PrecioMatricula > 0)
                        {
                            p.NumeroCuota = cantCuotaPagadas;
                            p.Descripcion = "Pago de cuota N° " + p.NumeroCuota;
                            p.Monto       = entrenamiento.PrecioMensual;
                        }
                        else
                        {
                            cantCuotaPagadas++;
                            p.NumeroCuota = cantCuotaPagadas;
                            p.Descripcion = "Pago de cuota N° " + p.NumeroCuota;
                            p.Monto       = entrenamiento.PrecioMensual;
                        }
                    }
                    lista.Add(p);
                }
            }
            bd.Lector.Close();
            bd.desconectar();
            return(lista);
        }
예제 #9
0
 public static int BorrarEjercicio(Entrenamiento param)
 {
     SqlParameter[] parametros = new SqlParameter[1];
     parametros[0] = new SqlParameter("@id_entrenamiento", param.Id);
     return(SqlHelper.getInstance().escribir(Tabla2 + "_baja", parametros));
 }
예제 #10
0
 public void crearEntrenamiento(Entrenamiento en)
 {
     //...
 }