protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Datos.Broker oTCDatos = new Datos.Broker();
         if (ddDepartamento.Items.Count == 0)
         {
             ddDepartamento.DataSource = oTCDatos.obtenerDepartamento(0);
             ddDepartamento.DataBind();
         }
         if (ddCargo.Items.Count == 0)
         {
             ddCargo.DataSource = oTCDatos.obtenerCargo(0);
             ddCargo.DataBind();
         }
         if (ddEvento.Items.Count == 0)
         {
             List <Evento> lstEvento = oTCDatos.ObtenerEvento(0, true);
             ddEvento.DataSource = lstEvento;
             ddEvento.DataBind();
         }
     }
     catch (Exception ex)
     {
         this.ManejarExcepcionPublico(ex);
     }
 }
        private void ConsultarOrganizacion(int idMunicipio, int idDepartamento)
        {
            Organizacion oOrganizacion = new Organizacion();

            oOrganizacion.IdMunicipio    = idMunicipio;
            oOrganizacion.IdDepartamento = idDepartamento;
            Datos.Broker oTC = new Datos.Broker();
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Datos.Broker oTCDatos = new Datos.Broker();
     if (ddDepartamento.Items.Count == 0)
     {
         ddDepartamento.DataSource = oTCDatos.obtenerDepartamento(0);
         ddDepartamento.DataBind();
     }
 }
    private void ConsultarOrganizacion(int idMunicipio, int idDepartamento)
    {
        Organizacion oOrganizacion = new Organizacion();

        oOrganizacion.IdMunicipio    = idMunicipio;
        oOrganizacion.IdDepartamento = idDepartamento;
        Datos.Broker oTC = new Datos.Broker();
        ddOrganizacion.DataSource = oTC.obtenerListaOrganizacion(oOrganizacion);
        ddOrganizacion.DataBind();
    }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidarCampos())
                {
                    CultureInfo cu = new CultureInfo("en-US");

                    Registro oRegistro = new Registro();
                    oRegistro.Nombres             = txtNombres.Text;
                    oRegistro.Apellidos           = txtApellidos.Text;
                    oRegistro.Celular             = txtCelular.Text;
                    oRegistro.Documento           = Convert.ToDouble(txtDocumento.Text);
                    oRegistro.Email               = txtEmail.Text;
                    oRegistro.RequiereHotel       = chkRequiereHotel.Checked;
                    oRegistro.FechaCkeckInHotel   = HdtpLlegadaHotel.Value.ToString() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(HdtpLlegadaHotel.Value.ToString(), cu);
                    oRegistro.FechaCheckOutHotel  = HdtpSalidaHotel.Value.ToString() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(HdtpSalidaHotel.Value.ToString(), cu);
                    oRegistro.RequierePasajes     = chkRequierePasajes.Checked;
                    oRegistro.FechaSalidaPasajes  = HdtpSalidaVuelo.Value.ToString() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(HdtpSalidaVuelo.Value.ToString(), cu);
                    oRegistro.FechaRegresoPasajes = HdtpRegresoVuelo.Value.ToString() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(HdtpRegresoVuelo.Value.ToString(), cu);
                    oRegistro.idMunicipio         = Convert.ToInt32(ddMunicipio.SelectedValue);
                    oRegistro.TipoAcomodacion     = Convert.ToString(ddAcomodacion.SelectedItem);
                    oRegistro.LugarSalida         = txtLugarSalidaVuelo.Text;
                    oRegistro.idEvento            = Convert.ToDouble(ddEvento.SelectedValue);
                    oRegistro.Observaciones       = txtOtro.Text;

                    Datos.Broker  oFTC         = new Datos.Broker();
                    List <string> lstResultado = new List <string>();
                    oFTC.insertarRegistro(oRegistro, ref lstResultado);

                    //1=Operación exitosa
                    if (lstResultado[1] == "1")
                    {
                        lblExito.Visible     = true;
                        lblResultado.Visible = false;
                    }
                    else
                    {
                        lblExito.Visible     = false;
                        lblResultado.Visible = true;
                        lblResultado.Text    = lstResultado[2];
                    }

                    this.LimpiarCampos();
                }
            }
            catch (Exception ex)
            {
                this.ManejarExcepcionPublico(ex);
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            CultureInfo     cu           = new CultureInfo("en-US");
            ClienteTO       oCliente     = new ClienteTO();
            Funcionario     oFuncionario = new Funcionario();
            Telefono        oTelefono;
            List <Telefono> lstTelefono   = new List <Telefono>();
            List <string>   lstResultados = new List <string>();

            oCliente.Nombres              = txtNombre.Text;
            oCliente.Apellidos            = txtApellidos.Text;
            oCliente.Documento            = txtDocumento.Text == string.Empty ? 0 : Convert.ToDouble(txtDocumento.Text);
            oCliente.LugarExpedicion      = txtExpedicion.Text;
            oCliente.Sexo                 = Convert.ToChar(ddSexo.SelectedValue);
            oCliente.FechaNacimiento      = HdtpNacimiento.Value.ToString() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(HdtpNacimiento.Value.ToString(), cu);
            oCliente.CiudadNacimiento     = txtNacimiento.Text;
            oCliente.TipoSangre           = txtGrupoSanguineo.Text;
            oCliente.CiudadResidencia     = txtCiudadResidencia.Text;
            oCliente.Direccion            = txtDireccion.Text;
            oCliente.TallaCamiseta        = ddTallaCamiseta.Text;
            oCliente.Email                = txtEmail1.Text;
            oCliente.Visas                = txtVisas.Text;
            oCliente.EstadoCivil          = ddEstadoCivil.Text;
            oCliente.Hijos                = Convert.ToInt32(ddHijos.SelectedValue);
            oCliente.Estudios             = ddNivelEducativo.Text;
            oCliente.Idiomas              = txtSegundaLengua.Text;
            oCliente.idUsuarioRegistroMod = (double)Contexto.idUsuario;

            oTelefono                  = new Telefono();
            oTelefono.Tipo             = "Fijo";
            oTelefono.NumeroTelefonico = txtTelefono.Text;
            lstTelefono.Add(oTelefono);
            oTelefono                  = new Telefono();
            oTelefono.Tipo             = "Celular";
            oTelefono.NumeroTelefonico = txtCelular.Text;
            lstTelefono.Add(oTelefono);



            Datos.Broker oTC = new Datos.Broker();

            oTC.insertarModificarCliente(oCliente, lstTelefono, oFuncionario, ref lstResultados);
            if (lstResultados[1] == "1")
            {
                MostrarMensaje(TipoMensaje.Success, lstResultados[2]);
            }
            else
            {
                MostrarMensaje(TipoMensaje.Error, lstResultados[2]);
            }
        }
        private void ConsultarMunicipios(int idDepartamento)
        {
            Municipio objMunicipio = new Municipio();

            Datos.Broker     oFTC         = new Datos.Broker();
            List <Municipio> lstMunicipio = oFTC.obtenerMunicipiosDepto(idDepartamento);

            ddMunicipio.DataSource = null;
            ddMunicipio.DataBind();
            ddMunicipio.DataSource     = lstMunicipio;
            ddMunicipio.DataValueField = "idMunicipio";
            ddMunicipio.DataTextField  = "Nombre";
            ddMunicipio.DataBind();
        }
 protected void ddDepartamentoCon_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddDepartamentoCon.SelectedIndex == 0)
     {
         ddMunicipioCon.Items.Clear();
         ddOrganizacion.Items.Clear();
     }
     else
     {
         ddMunicipioCon.Enabled = true;
         Datos.Broker     oFTC         = new Datos.Broker();
         List <Municipio> lstMunicipio = oFTC.obtenerMunicipiosDepto(Convert.ToInt32(ddDepartamentoCon.SelectedValue));
         ddMunicipioCon.DataSource = lstMunicipio;
         ddMunicipioCon.DataBind();
         ConsultarOrganizacion(0, Convert.ToInt32(ddDepartamentoCon.SelectedValue));
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Datos.Broker        oTCDatos        = new Datos.Broker();
            List <Cargo>        lstCargo        = oTCDatos.obtenerCargo(0);
            List <Departamento> lstDepartamento = oTCDatos.obtenerDepartamento(0);

            if (ddDepartamentoCon.Items.Count == 0)
            {
                ddDepartamentoCon.DataSource = lstDepartamento;
                ddDepartamentoCon.DataBind();
            }

            if (ddCargoCon.Items.Count == 0)
            {
                ddCargoCon.DataSource = lstCargo;
                ddCargoCon.DataBind();
            }
        }
    }