private void button_Aceptar_Click(object sender, EventArgs e)
 {
     if (comboBox_funcionalidades.SelectedIndex == 0)
     {
         this.Hide();
         ABM_Rol.Form_Base form_base = new ABM_Rol.Form_Base();
         form_base.Show();
     }
     if (comboBox_funcionalidades.SelectedIndex == 1)
     {
         this.Hide();
         Abm_Cliente.Form_Base form_base = new Abm_Cliente.Form_Base();
         form_base.Show();
     }
     if (comboBox_funcionalidades.SelectedIndex == 2)
     {
         this.Hide();
         Abm_Empresa.Form_Base form_base = new Abm_Empresa.Form_Base();
         form_base.Show();
     }
     if (comboBox_funcionalidades.SelectedIndex == 3)
     {
     }
     if (comboBox_funcionalidades.SelectedIndex == 4)
     {
         this.Hide();
         Abm_Visibilidad.Form_Base form_base = new Abm_Visibilidad.Form_Base();
         form_base.Show();
     }
     if (comboBox_funcionalidades.SelectedIndex == 5)
     {
         this.Hide();
         Listado_Estadistico.ListadoEstadistico listado = new Listado_Estadistico.ListadoEstadistico();
         listado.Show();
     }
     if (comboBox_funcionalidades.SelectedIndex == 6)
     {
         this.Hide();
         FrbaCommerce.ModificarContraseña mod = new FrbaCommerce.ModificarContraseña();
         mod.Show();
     }
 }
        private void cbFuncionalidades_SelectedIndexChanged(object sender, EventArgs e)
        {
            int idFuncionalidadElegida = Convert.ToInt32(cbFuncionalidades.SelectedValue);

            if (idFuncionalidadElegida == -1)
            {
                // Interfaz.Interfaz.emitirAviso("Por favor elija una funcionalidad de la lista");
                limpiarPanel();
                return;
            }

            lblElegido.Text = cbFuncionalidades.Text;

            Form formularioElegido = null;

            /*
             * Referencias de la BBDD
             *  1	Administrar Usuarios
             *  2	Administrar Roles
             *  3	Administrar Rubros
             *  4	Administrar Visibilidades
             *  5	Administrar Publicaciones
             *  6	Comprar / Ofertar
             *  7	Calificar
             *  8	Historial Cliente
             *  9	Consultar Facturas
             *  10	Listado Estadístico
             */

            switch (idFuncionalidadElegida)
            {
            case 1:
                formularioElegido = new ABMUsuario.RolNuevo("", "");
                break;

            case 2:
                formularioElegido = new RolAbm.ABMRol();
                break;

            case 3:
                Interfaz.Interfaz.emitirAviso("Esta funcionalidad no se debe realizar según enunciado.");
                break;

            case 4:
                formularioElegido = new ABM_Visibilidad.ABMVisibilidad();
                break;

            case 5:
                formularioElegido = new Generar_Publicación.GenerarPublicacion();
                break;

            case 6:
                formularioElegido = new ComprarOfertar.ComprarOfertar();
                break;

            case 7:
                formularioElegido = new Calificar.CalificarVendedor();
                break;

            case 8:
                formularioElegido = new Historial_Cliente.HistorialCliente();
                break;

            case 9:
                formularioElegido = new Facturas.Facturas();
                break;

            case 10:
                formularioElegido = new Listado_Estadistico.ListadoEstadistico();
                break;

            case 11:
                formularioElegido = new Loggin.CambiarPassword(false);
                break;
            }

            if (formularioElegido != null)
            {
                mostrarEnPanel(formularioElegido, this.panelContenido);
            }
            else
            {
                limpiarPanel();
            }
        }
Exemplo n.º 3
0
 private void estadistica_Click(object sender, EventArgs e)
 {
     FrbaCrucero.Listado_Estadistico.ListadoEstadistico estadistica = new Listado_Estadistico.ListadoEstadistico();
     estadistica.Show();
 }
 private void HandlerFuncionalidad(string funcionalidad)
 {
     switch (funcionalidad)
     {
         case "ABM ROL":
             this.Hide();
             ABM_de_Rol.HomeRol rol = new ABM_de_Rol.HomeRol();
             rol.Show();
             break;
         case "ABM USUARIO":
             this.Hide();
             ABM_de_Usuario.HomeUsuario usuario = new ABM_de_Usuario.HomeUsuario();
             usuario.Show();
             break;
         case "ABM CLIENTE":
             this.Hide();
             ABM_de_Cliente.HomeCliente cliente = new ABM_de_Cliente.HomeCliente();
             cliente.Show();
             break;
         case "ABM HOTEL":
             this.Hide();
             ABM_de_Hotel.HomeHotel hotel = new FrbaHotel.ABM_de_Hotel.HomeHotel();
             hotel.Show();
             break;
         case "ABM HABITACION":
             this.Hide();
             ABM_de_Habitacion.HomeHabitacion habitacion = new ABM_de_Habitacion.HomeHabitacion();
             habitacion.Show();
             break;
         case "ABM REGIMEN":
             this.Hide();
             Regimen.HomeRegimen regimen = new Regimen.HomeRegimen();
             regimen.Show();
             break;
         case "GENERAR/MODIFICAR RESERVA":
             this.Hide();
             Generar_Modificar_Reserva.HomeReserva reserva = new Generar_Modificar_Reserva.HomeReserva();
             reserva.Show();
             break;
         case "BAJA RESERVA":
             this.Hide();
             Cancelar_Reserva.Cancelacion cance = new Cancelar_Reserva.Cancelacion();
             cance.Show();
             break;
         case "REGISTRAR ESTADIA":
             this.Hide();
             Registrar_Estadia.HomeEstadia estadia = new Registrar_Estadia.HomeEstadia();
             estadia.Show();
             break;
         case "REGISTRAR CONSUMIBLES":
             this.Hide();
             Registrar_Consumible.RegistrarConsumibles consu = new Registrar_Consumible.RegistrarConsumibles();
             consu.Show();
             break;
         case "LISTADO ESTADISTICO":
             this.Hide();
             Listado_Estadistico.ListadoEstadistico listado = new Listado_Estadistico.ListadoEstadistico();
             listado.Show();
             break;
         default:
             MessageBox.Show("error inesperado");
             Application.Exit();
             break;
     }
 }
 private void continuar_Click(object sender, EventArgs e)
 {
     if (cbFuncionalidades.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar una funcionalidad.", "Error");
     }
     else
     {
         itemComboBox seleccion = cbFuncionalidades.SelectedItem as itemComboBox;
         switch (seleccion.ID_Funcionalidad)
         {
             case -2:
                 CambiarPassword formPass = new CambiarPassword();
                 formPass.Show();
                 break;
             case 1:
                 Abm_Cliente.ABMClientes form1 = new Abm_Cliente.ABMClientes();
                 this.Hide();
                 form1.Show();
                 break;
             case 2:
                 Abm_Empresa.ABMEmpresas form2 = new Abm_Empresa.ABMEmpresas();
                 this.Hide();
                 form2.Show();
                 break;
             case 3:
                 ABM_Rol.AbmRolForm form3 = new ABM_Rol.AbmRolForm();
                 this.Hide();
                 form3.Show();
                 break;
             case 4:
                 Abm_Rubro.ABMRubro form4 = new Abm_Rubro.ABMRubro();
                 this.Hide();
                 form4.Show();
                 break;
             case 5:
                 Abm_Visibilidad.ABMVisibilidad form5 = new Abm_Visibilidad.ABMVisibilidad();
                 this.Hide();
                 form5.Show();
                 break;
             case 6:
                 Generar_Publicacion.GenerarPubliForm form6 = new Generar_Publicacion.GenerarPubliForm();
                 this.Hide();
                 form6.Show();
                 break;
             case 7:
                 Editar_Publicacion.EditarPubliForm form7 = new Editar_Publicacion.EditarPubliForm();
                 this.Hide();
                 form7.Show();
                 break;
             case 8:
                 Gestion_de_Preguntas.GestionPreguntas form8 = new Gestion_de_Preguntas.GestionPreguntas();
                 this.Hide();
                 form8.Show();
                 break;
             case 9:
                 Comprar_Ofertar.ComprarOfertar form9 = new Comprar_Ofertar.ComprarOfertar();
                 this.Hide();
                 form9.Show();
                 break;
             case 10:
                 Calificar_Vendedor.CalificarVendedor form10 = new Calificar_Vendedor.CalificarVendedor();
                 this.Hide();
                 form10.Show();
                 break;
             case 11:
                 Historial_Cliente.Historial form11 = new Historial_Cliente.Historial();
                 this.Hide();
                 form11.Show();
                 break;
             case 12:
                 Facturar_Publicaciones.Facturar form12 = new Facturar_Publicaciones.Facturar();
                 this.Hide();
                 form12.Show();
                 break;
             case 13:
                 Listado_Estadistico.ListadoEstadistico form13 = new Listado_Estadistico.ListadoEstadistico();
                 this.Hide();
                 form13.Show();
                 break;
         }
     }
 }
        private void btnSig_Click(object sender, EventArgs e)
        {
            switch (Convert.ToString(comboFunc.SelectedItem))
            {
                case "Generar Publicacion":
                    {

                        Generar_Publicacion.Form2 GenerarPub = new Generar_Publicacion.Form2(usuario);
                        GenerarPub.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Editar Publicacion":
                    {
                        Editar_Publicacion.FormModificarPub EditarPub = new Editar_Publicacion.FormModificarPub(usuario.Cod_usuario);
                        EditarPub.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Gestion de preguntas":
                    {
                        Gestion_de_Preguntas.GestionDePreguntas GestionDePreg = new Gestion_de_Preguntas.GestionDePreguntas(usuario);
                        GestionDePreg.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Comprar/Ofertar":
                    {
                        Comprar_Ofertar.ComprarOfertar ComprarOfertar = new Comprar_Ofertar.ComprarOfertar(usuario);
                        ComprarOfertar.ShowDialog();
                        this.Hide();
                        break;
                    }

                case "ABM de cliente":
                    {
                        Abm_Cliente.MenuABMCliente AbmCliente = new Abm_Cliente.MenuABMCliente();
                        AbmCliente.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "ABM de empresa":
                    {
                        Abm_Empresa.MenuABMEmpresa AbmEmpresa = new Abm_Empresa.MenuABMEmpresa();
                        AbmEmpresa.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "ABM de rol":
                    {
                        ABM_Rol.Form1 AbmRol = new ABM_Rol.Form1();
                        AbmRol.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Registro usuario":
                    {
                        Registro_de_Usuario.Form1 RegistroDeUsuario = new Registro_de_Usuario.Form1();
                        RegistroDeUsuario.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "ABM de rubro":
                    {
                        Abm_Rubro.Form1 AbmRubro = new Abm_Rubro.Form1();
                        AbmRubro.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "ABM de visibilidad de publicacion":
                    {
                        Abm_Visibilidad.VentanaMenuVisibilidad AbmVis = new Abm_Visibilidad.VentanaMenuVisibilidad();
                        AbmVis.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Historial del cliente":
                    {
                        Historial_Cliente.HistorialCliente HistorialCliente = new Historial_Cliente.HistorialCliente(usuario);
                        HistorialCliente.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Calificar vendedor":
                    {
                        Calificar_Vendedor.CalificarVendedor CalifVendedor = new Calificar_Vendedor.CalificarVendedor(usuario);
                        CalifVendedor.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Facturar Publicaciones":
                    {
                        Facturar_Publicaciones.FacturarPublicaciones FacturarPub = new Facturar_Publicaciones.FacturarPublicaciones(usuario);
                        FacturarPub.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Listado estadístico":
                    {
                        Listado_Estadistico.ListadoEstadistico ListEstadistico = new Listado_Estadistico.ListadoEstadistico();
                        ListEstadistico.ShowDialog();
                        this.Hide();
                        break;
                    }
                case "Modificar mis Datos":
                    {
                        try
                        {
                        using (connection = new SqlConnection())
                        {
                            connection.ConnectionString = DAL.LoginDAL.Conectar();
                            connection.Open();
                            SqlCommand cmd;
                            if (Rol == "Cliente")
                            {
                                cmd = new SqlCommand("SELECT nombre, apellido, mail,dni,tipo_dni FROM EBAY.cliente WHERE cod_usuario=@cod_usuario", connection);

                            }
                            else
                            {
                                cmd = new SqlCommand("SELECT razon_social, cuit, mail FROM EBAY.empresa WHERE cod_usuario=@cod_usuario", connection);

                            }

                            cmd.Parameters.AddWithValue("@cod_usuario", usuario.Cod_usuario);

                            cmd.CommandType = CommandType.Text;

                            cmd.ExecuteNonQuery();
                            connection.Close();

                            DataTable dt = new DataTable();
                            SqlDataAdapter da = new SqlDataAdapter(cmd);

                            da.Fill(dt);

                            if (Rol == "Cliente")
                            {
                                Abm_Cliente.FormModif FormModCliente = new Abm_Cliente.FormModif(dt.Rows[0], "Cliente");
                                FormModCliente.ShowDialog();
                                this.Hide();
                            }
                            else
                            {
                                Abm_Empresa.FormMod FormModEmp = new Abm_Empresa.FormMod(dt.Rows[0], "Empresa");
                                FormModEmp.ShowDialog();
                                this.Hide();
                            }
                        }
                        }
                        catch (Exception ex)
                        {
                            throw new Exception("Error: " + ex.Message);
                        }
                        break;

                    }
            }
        }
        private void HandlerFuncionalidad(string funcionalidad)
        {
            switch (funcionalidad)
            {
            case "ABM ROL":
                this.Hide();
                ABM_de_Rol.HomeRol rol = new ABM_de_Rol.HomeRol();
                rol.Show();
                break;

            case "ABM USUARIO":
                this.Hide();
                ABM_de_Usuario.HomeUsuario usuario = new ABM_de_Usuario.HomeUsuario();
                usuario.Show();
                break;

            case "ABM CLIENTE":
                this.Hide();
                ABM_de_Cliente.HomeCliente cliente = new ABM_de_Cliente.HomeCliente();
                cliente.Show();
                break;

            case "ABM HOTEL":
                this.Hide();
                ABM_de_Hotel.HomeHotel hotel = new FrbaHotel.ABM_de_Hotel.HomeHotel();
                hotel.Show();
                break;

            case "ABM HABITACION":
                this.Hide();
                ABM_de_Habitacion.HomeHabitacion habitacion = new ABM_de_Habitacion.HomeHabitacion();
                habitacion.Show();
                break;

            case "ABM REGIMEN":
                this.Hide();
                Regimen.HomeRegimen regimen = new Regimen.HomeRegimen();
                regimen.Show();
                break;

            case "GENERAR/MODIFICAR RESERVA":
                this.Hide();
                Generar_Modificar_Reserva.HomeReserva reserva = new Generar_Modificar_Reserva.HomeReserva();
                reserva.Show();
                break;

            case "BAJA RESERVA":
                this.Hide();
                Cancelar_Reserva.Cancelacion cance = new Cancelar_Reserva.Cancelacion();
                cance.Show();
                break;

            case "REGISTRAR ESTADIA":
                this.Hide();
                Registrar_Estadia.HomeEstadia estadia = new Registrar_Estadia.HomeEstadia();
                estadia.Show();
                break;

            case "REGISTRAR CONSUMIBLES":
                this.Hide();
                Registrar_Consumible.RegistrarConsumibles consu = new Registrar_Consumible.RegistrarConsumibles();
                consu.Show();
                break;

            case "LISTADO ESTADISTICO":
                this.Hide();
                Listado_Estadistico.ListadoEstadistico listado = new Listado_Estadistico.ListadoEstadistico();
                listado.Show();
                break;

            default:
                MessageBox.Show("error inesperado");
                Application.Exit();
                break;
            }
        }