示例#1
0
        private void LoadOperadoresTuristicos()
        {
            List <OperadorTuristicoDTO> operadoresTuristicos = OperadorTuristicoManager.GetOperadorTuristico();

            gvOperadoresTuristicos.DataSource = operadoresTuristicos;
            gvOperadoresTuristicos.DataBind();
        }
示例#2
0
 private void CargarCombos()
 {
     ddlOperadorTuristico.DataSource     = OperadorTuristicoManager.GetOperadorTuristico();
     ddlOperadorTuristico.DataValueField = "IdOperadorTuristico";
     ddlOperadorTuristico.DataTextField  = "Descripcion";
     ddlOperadorTuristico.DataBind();
 }
示例#3
0
        protected void btnModificarSeleccionado_Click(object sender, EventArgs e)
        {
            OcultarMensajes();
            int id = 0;
            int cantidadSeleccionados = 0;

            foreach (GridViewRow row in gvOperadoresTuristicos.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chkRow = (row.Cells[0].FindControl("chkElemento") as CheckBox);
                    if (chkRow.Checked)
                    {
                        cantidadSeleccionados++;
                        if (cantidadSeleccionados > 1)
                        {
                            DangerMessage.Visible = true;
                            LblDanger.Text        = "No es posible modificar mas de un operador turistico al mismo tiempo.";
                            return;
                        }
                        id = Convert.ToInt32(gvOperadoresTuristicos.DataKeys[row.RowIndex].Value.ToString());
                    }
                }
            }
            if (cantidadSeleccionados == 0)
            {
                DangerMessage.Visible = true;
                LblDanger.Text        = "Seleccione un operador turistico para modificar sus datos.";
                return;
            }
            CargarDatos(OperadorTuristicoManager.GetOperadorTuristico(id));
            HabilitarModificacion();
        }
示例#4
0
        protected void btnModificar_Click(object sender, EventArgs e)
        {
            DateTime fechaAlta;

            if (!DateTime.TryParseExact(txtFechaAlta.Text, "dd/MM/yyyy", new CultureInfo("es-AR"), DateTimeStyles.None, out fechaAlta))
            {
                DangerMessage.Visible = true;
                LblDanger.Text        = "El formato de la fecha de alta debe ser dd/MM/yyyy.";
                return;
            }

            OperadorTuristicoDTO operadorTuristico = new OperadorTuristicoDTO();

            operadorTuristico.Activo       = chkActivo.Checked;
            operadorTuristico.Calificacion = Convert.ToInt32(txtCalificacion.Text);
            operadorTuristico.Descripcion  = txtNombreOperadorTuristico.Text;
            operadorTuristico.Direccion    = txtDomicilioOperador.Text;
            operadorTuristico.Email        = TextMailContacto.Text;
            operadorTuristico.FechaAlta    = fechaAlta;
            if (ddlTipoDestino.SelectedValue != "")
            {
                operadorTuristico.IdTipoDestino = Convert.ToInt32(ddlTipoDestino.SelectedValue);
            }
            operadorTuristico.IsNew               = false;
            operadorTuristico.Nombre              = txtNombreContacto.Text;
            operadorTuristico.PaginaWeb           = eMail.Text;
            operadorTuristico.Telefono            = txtTelefono.Text;
            operadorTuristico.IdOperadorTuristico = Convert.ToInt32(hdId.Value);

            OperadorTuristicoManager.UpdateOperadorTuristico(operadorTuristico);
            InicializarPantalla();
            LoadData();
            OcultarMensajes();
        }
示例#5
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            OcultarMensajes();

            bool seleccionados = false;

            foreach (GridViewRow row in gvOperadoresTuristicos.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chkRow = (row.Cells[0].FindControl("chkElemento") as CheckBox);
                    if (chkRow.Checked)
                    {
                        int id = Convert.ToInt32(gvOperadoresTuristicos.DataKeys[row.RowIndex].Value.ToString());
                        OperadorTuristicoManager.DeleteOperadorTuristico(id);
                        seleccionados = true;
                    }
                }
            }

            if (!seleccionados)
            {
                DangerMessage.Visible = true;
                LblDanger.Text        = "Seleccione un operador turistico para eliminarlo.";
                return;
            }
            else
            {
                SuccessMessage.Visible = true;
                LblSuccess.Text        = "Datos Eliminados Correctamente.";
            }
            InicializarPantalla();
            LoadOperadoresTuristicos();
        }
示例#6
0
 private void ReloadData()
 {
     if (termino != txtBuscar.Text)
     {
         termino = txtBuscar.Text;
         List <OperadorTuristicoDTO> operadorTuristico = OperadorTuristicoManager.GetOperadorTuristico(termino);
         gvOperadoresTuristicos.DataSource = operadorTuristico;
         gvOperadoresTuristicos.DataBind();
     }
 }
示例#7
0
        private void CargarCombos()
        {
            List <OperadorTuristicoDTO> operadores             = new List <OperadorTuristicoDTO>();
            OperadorTuristicoDTO        operadorNoEspecificado = new OperadorTuristicoDTO();

            operadorNoEspecificado.Descripcion         = "SELECCIONE";
            operadorNoEspecificado.IdOperadorTuristico = 0;
            operadores.Add(operadorNoEspecificado);
            operadores.AddRange(OperadorTuristicoManager.GetOperadorTuristico());
            ddlOperadorTuristico.DataSource     = operadores;
            ddlOperadorTuristico.DataValueField = "idOperadorTuristico";
            ddlOperadorTuristico.DataTextField  = "descripcion";
            ddlOperadorTuristico.DataBind();
        }