Exemple #1
0
    private void SetearControlesDenunciante(Denunciante denunciante)
    {
        try
        {
            this.txtApellido.Text         = denunciante.apellido;
            this.txtNombres.Text          = denunciante.nombre;
            this.txtCalle.Text            = denunciante.domicilio;
            this.txtDpto.Text             = denunciante.dpto;
            this.txtNro.Text              = denunciante.numero.ToString();
            this.txtPiso.Text             = denunciante.piso.ToString();
            this.txtNroDNI.Text           = denunciante.nroDocumento.ToString();
            this.cboTipoDni.SelectedValue = denunciante.idTipoDocumento.ToString();
            bool flag = false;
            foreach (ListItem item in cboLocalidad.Items)
            {
                if (item.Value == denunciante.idLocalidad.ToString())
                {
                    flag = true;
                }
            }
            if (flag)
            {
                cboLocalidad.SelectedValue = denunciante.idLocalidad.ToString();
            }
            else
            {
                Localidad localidad = NegocioMantenimiento.TraerLocalidadPorId(denunciante.idLocalidad);

                cboLocalidad.SelectedValue = "0";
                this.cboLocalidad.Enabled  = false;
                this.txtOtraLoc.Text       = localidad.descLocalidad;
                hOtraLoc.Value             = denunciante.idLocalidad + "|" + localidad.descLocalidad;
            }

            this.txtTelefono.Text = NegocioContactos.TraerTelefonoActivo(denunciante.idDenunciante);
            this.txtCelular.Text  = NegocioContactos.TraerCelularActivo(denunciante.idDenunciante);
            this.txtEmail.Text    = NegocioContactos.TraerMailActivo(denunciante.idDenunciante);



            //foreach (Contacto contacto in denunciante.contactos)
            //{
            //    switch (contacto.tipoContacto)
            //    {
            //        case "T":
            //            this.txtTelefono.Text = contacto.contacto;
            //            break;
            //        case "C":
            //            this.txtCelular.Text = contacto.contacto;
            //            break;
            //        case "E":
            //            this.txtEmail.Text = contacto.contacto;
            //            break;
            //    }
            //}
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Exemple #2
0
    protected void imgBuscarDen_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (this.txtNroDNI.Text.Trim() != "") //&& TraerDenuncianteSession() == null)
            {
                int         nroDoc      = int.Parse(this.txtNroDNI.Text);
                Denunciante denunciante = NegocioExpedientes.TraerDenunciantePorNroDoc(nroDoc);
                if (denunciante != null)
                {
                    this.txtApellido.Text = denunciante.apellido;
                    this.txtNombres.Text  = denunciante.nombre;
                    this.txtCalle.Text    = denunciante.domicilio;
                    this.txtDpto.Text     = denunciante.dpto;
                    this.txtNro.Text      = denunciante.numero.ToString();
                    this.txtNroDNI.Text   = denunciante.nroDocumento.ToString();
                    this.txtOtraLoc.Text  = "";
                    this.txtPiso.Text     = denunciante.piso.ToString();


                    this.txtTelefono.Text = NegocioContactos.TraerTelefonoActivo(denunciante.idDenunciante);
                    this.txtCelular.Text  = NegocioContactos.TraerCelularActivo(denunciante.idDenunciante);
                    this.txtEmail.Text    = NegocioContactos.TraerMailActivo(denunciante.idDenunciante);



                    //foreach (Contacto contacto in denunciante.contactos)
                    //{
                    //    switch (contacto.tipoContacto)
                    //    {
                    //        case "T":
                    //            this.txtTelefono.Text = contacto.contacto;
                    //            break;
                    //        case "C":
                    //            this.txtCelular.Text = contacto.contacto;
                    //            break;
                    //        case "E":
                    //            this.txtEmail.Text = contacto.contacto;
                    //            break;
                    //    }

                    //}

                    this.lblApellido.Text = denunciante.apellido;
                    this.lblNombres.Text  = denunciante.nombre;
                    this.lblTelefono.Text = this.txtTelefono.Text;

                    GuardarDenuncianteSession(denunciante);

                    //HabilitarDesHabilitarControlesDenunciante(false);
                    //this.imgBuscarDen.Enabled = true;
                }
                else
                {
                    string str = "<script type=\"text/javascript\">";
                    str = str + "mostrarDeseaHacer();</script>";
                    Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "mostrarConfirmacion", str);
                }
            }
            else
            {
                Session.Add("EsPopup", 1);
                AbrirPopupDenunciantes();
            }
        }
        catch (System.Threading.ThreadAbortException) { }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Exemple #3
0
    private void SetearControlesExpediente(Expediente expediente)
    {
        try
        {
            //Datos Expediente.

            TraerIniciadorExpediente(expediente);

            this.lblNroExpediente.Text    = expediente.idExpediente.ToString();
            this.cboAtendio.SelectedValue = expediente.atendio.idPersona.ToString();
            if (expediente.informante != null)
            {
                this.cboInformante.SelectedValue = expediente.informante.idPersona.ToString();
            }
            this.lblEstado.Text = TraerEstado(expediente.movimientos);
            if (expediente.fechaArchivo != DateTime.MinValue)
            {
                this.lblFechaArchivo.Text = expediente.fechaArchivo.ToShortDateString();
            }
            else
            {
                this.lblFechaArchivo.Text = "";
            }

            this.lblFechaIngreso.Text = expediente.fechaIngreso.ToShortDateString();


            //Datos Denunciante.
            this.txtApellido.Text         = expediente.denunciante.apellido;
            this.txtNombres.Text          = expediente.denunciante.nombre;
            this.txtCalle.Text            = expediente.denunciante.domicilio;
            this.txtDpto.Text             = expediente.denunciante.dpto;
            this.txtNro.Text              = expediente.denunciante.numero.ToString();
            this.txtPiso.Text             = expediente.denunciante.piso.ToString();
            this.txtNroDNI.Text           = expediente.denunciante.nroDocumento.ToString();
            this.cboTipoDni.SelectedValue = expediente.denunciante.idTipoDocumento.ToString();
            bool flag = false;
            foreach (ListItem item in cboLocalidad.Items)
            {
                if (item.Value == expediente.denunciante.idLocalidad.ToString())
                {
                    flag = true;
                }
            }
            if (flag)
            {
                cboLocalidad.SelectedValue = expediente.denunciante.idLocalidad.ToString();
            }
            else
            {
                Localidad localidad = NegocioMantenimiento.TraerLocalidadPorId(expediente.denunciante.idLocalidad);

                cboLocalidad.SelectedValue = "0";
                this.txtOtraLoc.Text       = localidad.descLocalidad;
                hOtraLoc.Value             = expediente.denunciante.idLocalidad.ToString() + "|" + localidad.descLocalidad;
            }


            this.txtTelefono.Text = NegocioContactos.TraerTelefonoActivo(expediente.denunciante.idDenunciante);
            this.txtCelular.Text  = NegocioContactos.TraerCelularActivo(expediente.denunciante.idDenunciante);
            this.txtEmail.Text    = NegocioContactos.TraerMailActivo(expediente.denunciante.idDenunciante);



            //expediente.denunciante.contactos = NegocioExpedientes.TraerContactoDenunciante(expediente.denunciante.idDenunciante);
            //foreach (Contacto contacto in expediente.denunciante.contactos)
            //{
            //    switch (contacto.tipoContacto)
            //    {
            //        case "T":
            //            this.txtTelefono.Text = contacto.contacto;
            //            break;
            //        case "C":
            //            this.txtCelular.Text = contacto.contacto;
            //            break;
            //        case "E":
            //            this.txtEmail.Text = contacto.contacto;
            //            break;
            //    }
            //}

            //Datos Denuncia.
            this.lblApellido.Text = expediente.denunciante.apellido;
            this.lblNombres.Text  = expediente.denunciante.nombre;
            this.lblTelefono.Text = this.txtTelefono.Text;
            if (expediente.movimientos.Count != 0)
            {
                this.btnMovimientos.Enabled  = true;
                this.btnMovimientos.CssClass = "ButtonBlue11px";
            }
            this.cboArea.SelectedValue          = expediente.area.idArea.ToString();
            this.cboEntDenunciada.SelectedValue = expediente.denunciado.idDenunciado.ToString();
            this.cboTipoDenuncia.SelectedValue  = expediente.idTipoDenuncia.ToString();
            this.chkDocumentacion.Checked       = expediente.traeDocumentacion == 1 ? true : false;
            this.txtDetalleDocumentacion.Text   = expediente.descDocumentacion;
            this.txtDetalleDenuncia.Text        = expediente.descDenuncia;
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.lblDenuncia.Attributes.Add("onclick", "seleccionarTabDenuncia();");
            this.lblDenunciante.Attributes.Add("onclick", "seleccionarTabDenunciante();");
            this.btnNuevo.Attributes.Add("onclick", "limpiarCampos();return habilitarCampos(true);");
            this.btnCancelar.Attributes.Add("onclick", "return habilitarCampos(false)");
            //this.imgBuscarLoc.Attributes.Add("onclick", "return AbrirPopupLocalidades();");
            this.chkDocumentacion.Attributes.Add("onClick", "chkTraeDoc_OnClick()");
            // this.imgPopupContactos.Attributes.Add("onclick", "AbrirPopupContactos();");
            this.cboLocalidad.Attributes.Add("onChange", "return cboLocalidad_SelectedIndexChange();");
            this.btnGuardar.Attributes.Add("onClick", "return validarIngresos();");
            this.cboEntDenunciada.Attributes.Add("onChange", "cboEntDenunciada_SelectedIndexChange();");



            if (!this.IsPostBack)
            {
                this.CargarCombosInformante();
                this.CargarComboTiposDocumento();
                this.CargarComboLocalidades();
                this.CargarComboEntidades();
                this.CargarComboAreas();
                this.CargarComboTiposDenuncia();


                Expediente expediente = TraerExpedienteSession();

                if (expediente == null)
                {
                    expediente = NegocioExpedientes.TraerExpedienteCompletoPorIdExpediente(1);
                    GuardarExpedienteSession(expediente);
                }
                if (expediente != null)
                {
                    SetearControlesExpediente(expediente);
                    this.btnModificar.Enabled  = true;
                    this.btnModificar.CssClass = "ButtonBlue11px";
                }
            }
            else
            {
                //evaluo respuesta de usuario..
                if (hNavegarBusqDenunciantes.Value == "true")
                {
                    Session.Add("EsPopup", 1);
                    AbrirPopupDenunciantes();
                    hNavegarBusqDenunciantes.Value = "";
                }
                else if (hNavegarBusqDenunciantes.Value == "false")
                {
                    ReestablecerEstado();
                    hNavegarBusqDenunciantes.Value = "";
                }

                Denunciante denunciante = TraerDenuncianteSession();

                int esPopup = Session["EsPopup"] != null?int.Parse(Session["EsPopup"].ToString()) : 0;

                if (denunciante != null && esPopup == 1)
                {
                    SetearControlesDenunciante(denunciante);
                    //HabilitarDesHabilitarControlesDenunciante(false);
                    this.imgBuscarDen.Enabled = true;
                    Session["EsPopup"]        = 0;
                }

                if (hOtraLoc.Value != "")
                {
                    this.txtOtraLoc.Text            = hOtraLoc.Value.Split('|')[1].ToString();
                    this.cboLocalidad.SelectedValue = "0";
                }
                else
                {
                    this.txtOtraLoc.Text = "";
                }

                int PopupContactos = Session["PopupContactos"] != null?int.Parse(Session["PopupContactos"].ToString()) : 0;

                if (PopupContactos == 1 && denunciante != null)
                {
                    txtTelefono.Text = NegocioContactos.TraerTelefonoActivo(denunciante.idDenunciante);
                    lblTelefono.Text = txtTelefono.Text;
                    txtCelular.Text  = NegocioContactos.TraerCelularActivo(denunciante.idDenunciante);
                    txtEmail.Text    = NegocioContactos.TraerMailActivo(denunciante.idDenunciante);
                    Session.Add("PopupContactos", 0);
                }
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message.ToString());
        }
    }