Exemplo n.º 1
0
int main()
{
    EMovie E_peli;

    FILE *pFile;

    int opcion=0;

    if((pFile = fopen("Pelicula.bin", "rb+"))== NULL)

        if((pFile = fopen("pelicula.bin", "wb+"))==NULL)
        {
            printf("ERROR. No se puede abrir el archivo binario...\n");
            exit(1);
        }
    while (opcion !=5)
    {
        Menu();

        scanf("%d", &opcion);

        switch (opcion)
        {
            case 1: system("cls");
                    Agregar(&E_peli, pFile);
                    break;

            case 2: system("cls");
                    Borrar(&E_peli, pFile);
                    break;

            case 3: system("cls");
                    Modificar(&E_peli, pFile);
                    break;

            case 4: system("cls");
                    Generar_PWeb(&E_peli, pFile);
                    break;

            case 5: system("cls");
                    printf("Salir del programa....\n");
                    break;

          default : system("cls");
                    Val_Menu(&opcion,"Error opcion invalida. Vuelva al menu\n","");
                    break;
        }
    }

    fclose(pFile);

    return 0;
}
Exemplo n.º 2
0
void Paciente::ModificarP(String ci)
{
        Modificar(ci);
        for(int i=1;i<Form4->Historia->RowCount;i++)
        {
                if(ci==Form4->Historia->Cells[0][i])
                {
                        Form4->Historia->Cells[1][i]=Form7->Edit5->Text;
                        Form4->Historia->Cells[2][i]=Form7->Edit6->Text;

                }
        }
}
Exemplo n.º 3
0
void Representante::ModificarR(String ci)
{
        Modificar(ci);
        for(int i=1;i<Form4->Reprecentante->RowCount;i++)
        {
                if(ci==Form4->Reprecentante->Cells[0][i])
                {
                        Form4->Reprecentante->Cells[1][i]=Form7->Edit7->Text;
                        Form4->Reprecentante->Cells[2][i]=Form7->MaskEdit4->Text;
                        Form4->Reprecentante->Cells[3][i]=Form7->Memo1->Text;
                        Form4->Reprecentante->Cells[4][i]=Form7->ComboBox1->Text;

                }
        }
}
Exemplo n.º 4
0
void Empleado::ModificarE(String ci)
{
        Modificar(ci);
        for(int i=1;i<Form4->Empleado->RowCount;i++)
        {
                if(ci==Form4->Empleado->Cells[0][i])
                {
                        Form4->Empleado->Cells[1][i]=Form3->ComboBox1->Text;
                        Form4->Empleado->Cells[2][i]=Form3->Edit1->Text;
                        Form4->Empleado->Cells[3][i]=Form3->Edit2->Text;
                        Form4->Empleado->Cells[4][i]=Form3->Memo1->Text;
                        Form4->Empleado->Cells[5][i]=Form3->Memo2->Text;
                        Form4->Empleado->Cells[6][i]=Form3->DateTimePicker1->Date.DateString();
                        Form4->Empleado->Cells[7][i]=Form3->Edit3->Text;
                }
        }
}
Exemplo n.º 5
0
void FormArticulo::on_ButtonGuardar_clicked()
{
    if(Estados==INSERTAR)
    {
    if(Guardar())
    Limpiar();
    emit ActualizarRepisa((ObjetoMaestro*)new Articulo());
    }
    if(Estados==MODIFICAR)
    {
    if(Modificar())
        Deshabilitar();
        /*Volver a su estado los botones*/
        ui->ButtonGuardar->setEnabled(false);
        ui->ButtonModificar->setEnabled(true);
        ui->ButtonEliminar->setEnabled(true);
     emit ActualizarRepisa((ObjetoMaestro*)new Articulo());
    }
}
Exemplo n.º 6
0
void GNC::GCS::Widgets::WRectangulo::OnMouseEvents(GNC::GCS::Events::EventoRaton& evento)
{
        if(m_Oculto) {
                return;
        }
        //------------------------------------------------------
        // Leaving
        if (evento.Leaving() ) {
                Iluminar(false);
        }
        //------------------------------------------------------
        // Entering
        else if (evento.Entering() ) {
                if (m_MouseDown) {
                        Iluminar(true);
                }
        }
        //------------------------------------------------------
        // Dragging
        else if (evento.Dragging() && m_MouseDown) {
                Vector delta = evento.iP - m_PosCursor;
                m_PosCursor = evento.iP;

                if (EstaSeleccionado())  {
                        m_Vertices[0] += delta;
                        m_Vertices[1] += delta;
                        m_Vertices[2] += delta;
                        m_Vertices[3] += delta;
                } else if (m_Vertices[0].m_Seleccionado) {
                        m_Vertices[3].x += delta.x;
                        m_Vertices[0] += delta;
                        m_Vertices[1].y += delta.y;
                } else if (m_Vertices[1].m_Seleccionado) {
                        m_Vertices[2].x += delta.x;
                        m_Vertices[1] += delta;
                        m_Vertices[0].y += delta.y;
                } else if (m_Vertices[2].m_Seleccionado) {
                        m_Vertices[1].x += delta.x;
                        m_Vertices[2] += delta;
                        m_Vertices[3].y += delta.y;
                } else if (m_Vertices[3].m_Seleccionado) {
                        m_Vertices[0].x += delta.x;
                        m_Vertices[3] += delta;
                        m_Vertices[2].y += delta.y;
                }
                LanzarEventoModificacion();
                Modificar(true);
                ConsumirEvento();
                return;
        }
        //------------------------------------------------------
        // LeftDown
        else if (evento.LeftDown()) {

                if (EventoConsumido() && !evento.m_controlDown) {
                        SeleccionarNodo(m_Vertices[0], false);
                        SeleccionarNodo(m_Vertices[1], false);
                        SeleccionarNodo(m_Vertices[2], false);
                        SeleccionarNodo(m_Vertices[3], false);
                        Seleccionar(false);
                        return;
                }

                bool dentro = false;

                m_PosCursor= evento.iP;

                const GNC::GCS::Vector& factor = evento.c->RelacionImagenPantalla();

                for (int i = 0; i < 4 && !dentro; ++i) {
                        if (m_Vertices[i].Hits(evento.iP, factor)) {
                                SeleccionarNodo(m_Vertices[i], true);
                                IluminarNodo(m_Vertices[i], true);
                                for (int j = 0; j < 4; ++j) {
                                        if (i != j) {
                                                SeleccionarNodo(m_Vertices[i], false);
                                        }
                                }
                                Seleccionar(false);
                                dentro = true;
                        } else {
                                SeleccionarNodo(m_Vertices[i], false);
                                IluminarNodo(m_Vertices[i], false);
                        }
                }

                if (!dentro) {
                        if (evento.iP.DentroDePoligono2(m_Vertices, 4)) {
                                if (evento.m_controlDown) { // Inversion de seleccion
                                        InvertirSeleccion();
                                } else {
                                        Seleccionar(true);
                                }
                                dentro = true;
                        } else { // Click fuera del nodo
                                if (!evento.m_controlDown) {
                                        Seleccionar(false);
                                } else {
                                        ConsumirEvento();
                                        if (EstaSeleccionado()) {
                                                m_MouseDown = true;
                                                m_PosCursor= evento.iP;
                                        }
                                }
                        }
                }

                if (dentro) {
                        m_MouseDown = true;
                        m_PosCursor= evento.iP;
                        ConsumirEvento();
                }

                return;
        }
        //------------------------------------------------------
        // LeftUP
        else if (evento.LeftUp()) {
                if (m_MouseDown) {
                        m_MouseDown = false;
                        ConsumirEvento();
                }
        }
        //------------------------------------------------------
        // Moving
        else if (evento.Moving()) {
                if (EventoConsumido()) {
                        IluminarNodo(m_Vertices[0], false);
                        IluminarNodo(m_Vertices[1], false);
                        IluminarNodo(m_Vertices[2], false);
                        IluminarNodo(m_Vertices[3], false);
                        Iluminar(false);
                        return;
                }

                bool dentro = false;

                m_PosCursor= evento.iP;

                const GNC::GCS::Vector& factor = evento.c->RelacionImagenPantalla();

                for (int i = 0; i < 4 && !dentro; ++i) {
                        if (m_Vertices[i].Hits(evento.iP, factor)) {
                                IluminarNodo(m_Vertices[i], true);
                                for (int j = 0; j < 4; ++j) {
                                        if (j != i) {
                                                IluminarNodo(m_Vertices[j], false);
                                        }
                                }
                                Iluminar(false);
                                dentro = true;
                        } else {
                                IluminarNodo(m_Vertices[i], false);
                        }
                }

                if (!dentro) {

                        if (evento.iP.DentroDePoligono2(m_Vertices, 4)) {
                                Iluminar(true);
                                dentro = true;
                        } else {
                                Iluminar(false);
                        }
                }

                if (dentro) {
                        ConsumirEvento();
                }

                return;
        }
}
Exemplo n.º 7
0
void GNC::GCS::Widgets::WChromaComplejo::SetNumeroPuntos(int numeroPuntos)
{
        m_numeroPuntos = numeroPuntos;
        Modificar(true);
        m_pManager->NotificarModificacion(this);
}