Beispiel #1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            NegocioMantenimiento.consultarMantenimientoTabla(int.Parse(this.txtCodigoMantenimiento.Text));
            if (this.tablaMantenimiento.Rows.Count != 0)
            {
                this.lblClienteMostrar.Text                  = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["IDCLIENTE"].Value);
                this.lblCIMostrar.Text                       = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["CICLIENTE"].Value);
                this.lblNombreMostrar.Text                   = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["NOMBRECLIENTE"].Value);
                this.lblDireccionMostrar.Text                = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["DIRECCIONCLIENTE"].Value);
                this.lblTelefonoFijoMostrar.Text             = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["TELEFONOFIJOCLIENTE"].Value);
                this.lblCelularMostrar.Text                  = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["TELEFONOMOVILCLIENTE"].Value);
                this.lblFechaMantenimientoMostrar.Text       = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["FECHAMANTENIMIENTO"].Value);
                this.lblHoraMantenimientoMostrar.Text        = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["HORAMANTENIMIENTO"].Value);
                this.lblEstadoMantenimientoMostrar.Text      = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["ESTADOMANTENIMIENTO"].Value);
                this.lblObservacionMantenimientoMostrar.Text = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["OBSERVACIONMANTENIMIENTO"].Value);
                this.lblPrecioMantenimientoMostrar.Text      = Convert.ToString(this.tablaMantenimiento.CurrentRow.Cells["PRECIOMANTENIMIENTO"].Value);
            }

            else
            {
                this.limpiarCampos();
                this.mostrarMantenimientos();
                MessageBox.Show("Mantenimiento no registrado", "Consultar Mantenimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
    protected void btnaceptar_Click1(object sender, EventArgs e)
    {
        try
        {
            Localidad localidad = new Localidad();
            localidad.idLocalidad   = NegocioMantenimiento.TraerProxIDLoc();
            localidad.codigoPostal  = int.Parse(this.txtCP.Text);
            localidad.descLocalidad = this.txtLoc.Text;
            localidad.idPartido     = byte.Parse(this.cboPartidos.SelectedValue);

            if (hAccion.Value == "agregar")
            {
                NegocioMantenimiento.AgregarLocalidad(localidad);
            }
            else
            {
                localidad.idLocalidad = int.Parse(gvLocalidades.SelectedRow.Cells[1].Text);
                NegocioMantenimiento.ModificarLocalidad(localidad);
            }


            CargarGrillaLocalidades();
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #3
0
    private void CargarCombosInformante()
    {
        try
        {
            DataSet ListPersonas = NegocioMantenimiento.TraerPersonas();
            this.cboAtendio.DataSource     = ListPersonas;
            this.cboAtendio.DataValueField = "idPersona";
            this.cboAtendio.DataTextField  = "nombre";

            this.cboAtendio.DataBind();
            this.cboAtendio.Items.Insert(0, "Sin Seleccionar");
            this.cboAtendio.Items[0].Value = "0";

            this.cboInformante.DataSource     = ListPersonas;
            this.cboInformante.DataValueField = "idPersona";
            this.cboInformante.DataTextField  = "nombre";


            this.cboInformante.DataBind();
            this.cboInformante.Items.Insert(0, "Sin Seleccionar");
            this.cboInformante.Items[0].Value = "0";
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #4
0
    protected void btneliminar_Click(object sender, EventArgs e)
    {
        try
        {
            if (GvTipoExpedientes.SelectedIndex != -1 && GvTipoExpedientes.Rows.Count > 0)
            {
                int    id   = int.Parse(GvTipoExpedientes.SelectedRow.Cells[1].Text);
                string mens = NegocioMantenimiento.EliminarTipoExpediente(id);
                if (mens != "")
                {
                    MostrarMensaje(mens);
                }


                else
                {
                    CargarGrillaTipoExpedientes();
                }

                this.txttipoexpediente.Text          = "";
                this.txtdescripcion.Text             = "";
                this.cboestado.SelectedIndex         = 0;
                this.GvTipoExpedientes.SelectedIndex = -1;
            }
            else
            {
                MostrarMensaje("Por favor, antes de realizar esta operación seleccione el campo que desea Eliminar");
            }
        }

        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #5
0
 protected void BtnAgregar_Click(object sender, EventArgs e)
 {
     this.txtidpersona.Enabled = true;
     this.txtnombre.Enabled    = true;
     this.cboestado.Enabled    = true;
     habilitarBotones(false);
     PonerFoco("txtnombre");
     this.txtidpersona.Text = (NegocioMantenimiento.TraerIdPersona()).ToString();
 }
Beispiel #6
0
    // ACCESO AL MENU PPAL PROVISORIO

    protected void btnagregar_Click(object sender, EventArgs e)
    {
        this.txttipoexpediente.Enabled = true;
        this.txtdescripcion.Enabled    = true;
        this.cboestado.Enabled         = true;
        this.txtdescripcion.Text       = "";
        PonerFoco("txtdescripcion");
        this.txttipoexpediente.Text = (NegocioMantenimiento.TraerIdTipoExpediente()).ToString();
        habilitarBotones(false);
    }
Beispiel #7
0
 protected void btnAgregar_Click(object sender, EventArgs e)
 {
     // this.txtidDenunciado.Enabled = true;
     this.txtEntidad.Enabled      = true;
     this.cboEstado.Enabled       = true;
     this.txtEntidad.Text         = "";
     this.cboEstado.SelectedIndex = 0;
     habilitarBotones(false);
     PonerFoco("txtEntidad");
     this.txtidDenunciado.Text = (NegocioMantenimiento.TraerIdDenunciado()).ToString();
 }
Beispiel #8
0
 private void consultarMantenimientoTabla()
 {
     if (this.txtCodigoMantenimiento.Text == string.Empty)
     {
         this.tablaMantenimiento.DataSource = NegocioMantenimiento.consultarMantenimientoTabla(0);
     }
     else
     {
         this.tablaMantenimiento.DataSource = NegocioMantenimiento.consultarMantenimientoTabla(int.Parse(this.txtCodigoMantenimiento.Text));
     }
 }
Beispiel #9
0
 private void CargarGrillaLocalidades()
 {
     try
     {
         int idPartidoSel = hIdPartidoSel.Value != "" ? int.Parse(hIdPartidoSel.Value) : int.Parse(cboPartidos.Items[0].Value);
         this.gvLocalidades.DataSource = NegocioMantenimiento.TraerLocalidadesPorPartido(idPartidoSel);
         this.gvLocalidades.DataBind();
         this.lblPartido.Text = this.cboPartidos.SelectedItem.Text;
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #10
0
 protected void btnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         this.txtCod.Enabled    = true;
         this.txtDesc.Enabled   = true;
         this.cboEstado.Enabled = true;
         habilitarBotones(false);
         this.txtDesc.Text = "";
         PonerFoco("txtDesc");
         this.txtCod.Text = (NegocioMantenimiento.TraerId()).ToString();
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #11
0
    private void CargarGrillaTipoExpedientes()
    {
        DataSet ds = NegocioMantenimiento.TraerTipoExpedientes();

        try
        {
            this.GvTipoExpedientes.DataSource = ds;
            //aca
            this.GvTipoExpedientes.DataBind();
            Session.Remove("listadoTipoExpedientes");
            Session.Add("listadoTipoExpedientes", ds);
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #12
0
 private void CargarComboAreas()
 {
     try
     {
         DataTable dtAreas = NegocioMantenimiento.TraerAreas();
         this.cboArea.DataSource     = dtAreas;
         this.cboArea.DataValueField = "idArea";
         this.cboArea.DataTextField  = "descArea";
         this.cboArea.DataBind();
         this.cboArea.Items.Insert(0, "Sin Seleccionar");
         this.cboArea.Items[0].Value = "0";
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #13
0
 private void CargarComboEntidades()
 {
     try
     {
         DataTable dtEntidades = NegocioMantenimiento.TraerDenunciados();
         this.cboEntDenunciada.DataSource     = dtEntidades;
         this.cboEntDenunciada.DataValueField = "idDenunciado";
         this.cboEntDenunciada.DataTextField  = "entidad";
         this.cboEntDenunciada.DataBind();
         this.cboEntDenunciada.Items.Insert(0, "Sin Seleccionar");
         this.cboEntDenunciada.Items[0].Value = "0";
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #14
0
 private void CargarComboTiposDocumento()
 {
     try
     {
         DataSet dsTiposDoc = NegocioMantenimiento.TraerTiposDocumentos();
         this.cboTipoDni.DataSource     = dsTiposDoc;
         this.cboTipoDni.DataValueField = "idTipoDocumento";
         this.cboTipoDni.DataTextField  = "descTipoDocumento";
         this.cboTipoDni.DataBind();
         this.cboTipoDni.Items.Insert(0, "Sin Seleccionar");
         this.cboTipoDni.Items[0].Value = "0";
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
        private void contarRegistros()
        {
            this.tabla_aux.DataSource = NegocioMantenimiento.contarRegistros();

            if (this.tabla_aux.Rows.Count != 0)
            {
                int var = Convert.ToInt32(this.tabla_aux.Rows[0].Cells[0].Value) + 1;
                this.txtCodigoMantenimiento.Text = Convert.ToString(var);

                desbloquearCampos();
            }

            else
            {
                this.limpiarCampos();
                MessageBox.Show("Mantenimiento no registrado", "Registrar Manteniminento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #16
0
 protected void cboPartidos_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         int idPartidoSel = int.Parse(this.cboPartidos.SelectedValue);
         if (idPartidoSel == -1)
         {
             return;
         }
         hIdPartidoSel.Value           = idPartidoSel.ToString();
         this.gvLocalidades.DataSource = NegocioMantenimiento.TraerLocalidadesPorPartido(idPartidoSel);
         this.gvLocalidades.DataBind();
         this.lblPartido.Text = this.cboPartidos.SelectedItem.Text;
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #17
0
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         int    idLocSel = int.Parse(gvLocalidades.SelectedRow.Cells[1].Text);
         string mens     = NegocioMantenimiento.EliminarLocalidad(idLocSel);
         if (mens != "")
         {
             MostrarMensaje(mens);
         }
         else
         {
             CargarGrillaLocalidades();
         }
     }
     catch (Exception ex)
     {
         Response.Redirect("Errores.aspx?error=" + ex.Message);
     }
 }
Beispiel #18
0
    private void CargarComboLocalidades()
    {
        try
        {
            DataSet dsLocalidades = NegocioMantenimiento.TraerLocalidadesVteLopez();
            this.cboLocalidad.DataSource     = dsLocalidades;
            this.cboLocalidad.DataValueField = "idLocalidad";
            this.cboLocalidad.DataTextField  = "descLocalidad";

            this.cboLocalidad.DataBind();
            //this.cboLocalidad.Items.Add(new ListItem("", "0"));
            //this.cboLocalidad.SelectedValue = "0";
            this.cboLocalidad.Items.Insert(0, "Sin Seleccionar");
            this.cboLocalidad.Items[0].Value = "0";
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.btnAgregar.Attributes.Add("onClick", " return mostrarCampos('agregar');");
            this.btncancelar.Attributes.Add("onClick", "return ocultarCampos();");
            this.btnmodificar.Attributes.Add("onClick", "return mostrarCampos('modificar');");

            if (!IsPostBack)
            {
                if (Session["EsPopup"] != null)
                {
                    if (int.Parse(Session["EsPopup"].ToString()) == 1)
                    {
                        this.btnRegresar.Text = "Regresar";
                    }
                    else
                    {
                        this.btnRegresar.Text = "Volver";
                    }
                }
                else
                {
                    this.btnRegresar.Text = "Volver";
                }

                cboPartidos.DataSource     = NegocioMantenimiento.TraerPartidos();
                cboPartidos.DataValueField = "codPartido";
                cboPartidos.DataTextField  = "Nombre";
                cboPartidos.DataBind();

                cboPartidos.Items.Insert(0, new ListItem("<Seleccionar>", "-1"));

                CargarGrillaLocalidades();
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
 private void guardarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string respuesta = "";
         if (this.txtCodigoMantenimiento.Text == string.Empty || this.comboEstado.Text == string.Empty || this.txtObservacion.Text == string.Empty || this.txtPrecio.Text == string.Empty)
         {
             MensajeError("Falta ingresar algunos datos");
         }
         else
         {
             respuesta = NegocioMantenimiento.actualizarMantenimiento(Int32.Parse(this.txtCodigoMantenimiento.Text.Trim()), this.comboEstado.Text,
                                                                      this.txtObservacion.Text.ToUpper(), float.Parse(this.txtPrecio.Text));
             this.MensajeOK("Registro actualizado exitosamente");
             this.bloquearCampos();
             this.mostrarMantenimientos();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + ex.StackTrace);
     }
 }
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         string respuesta = "";
         if (this.comboEstado.Text == string.Empty || this.txtObservacion.Text == string.Empty || this.txtPrecio.Text == string.Empty ||
             this.lblClienteMostrar.Text == string.Empty)
         {
             MensajeError("Falta ingresar algunos datos");
         }
         else
         {
             respuesta = NegocioMantenimiento.insertarMantenimiento(Int32.Parse(this.lblClienteMostrar.Text), this.pickerFechaMantenimiento.Text, this.lblHoraSistemaMostrar.Text,
                                                                    this.comboEstado.Text, this.txtObservacion.Text.ToUpper(), float.Parse(this.txtPrecio.Text));
             this.MensajeOK("Registro ingresado exitosamente");
             this.limpiarCampos();
             this.bloquearCampos();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + ex.StackTrace);
     }
 }
Beispiel #22
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);
        }
    }
Beispiel #23
0
    protected void btnaceptar_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.txtdescripcion.Text.Trim() != "")
            {
                try
                {
                    TipoExpediente tipoexpediente = new TipoExpediente();
                    tipoexpediente.descTipoExpediente = this.txtdescripcion.Text.Trim();



                    if (hAccion.Value == "agregar")
                    {
                        byte Est;
                        if (this.cboestado.SelectedIndex == 0)
                        {
                            Est = 1;
                        }
                        else
                        {
                            Est = 0;
                        }

                        tipoexpediente.estado = Convert.ToBoolean(Est);

                        tipoexpediente.idTipoExpediente = NegocioMantenimiento.TraerIdTipoExpediente();
                        this.cboestado.Enabled          = true;
                        NegocioMantenimiento.AgregarTipoExpediente(tipoexpediente);

                        MostrarMensaje("Un nuevo Tipo de Expediente ha sido agregada satisfactoriamente");
                        txtdescripcion.Text     = "";
                        cboestado.SelectedIndex = 0;
                        txtdescripcion.Enabled  = false;
                    }

                    else
                    {
                        tipoexpediente.idTipoExpediente = Convert.ToByte(int.Parse(GvTipoExpedientes.SelectedRow.Cells[1].Text));


                        if (cboestado.SelectedItem.Text == "Activo")
                        {
                            byte Est = 1;

                            tipoexpediente.estado = Convert.ToBoolean(Est);
                        }
                        else
                        {
                            byte Est = 0;

                            tipoexpediente.estado = Convert.ToBoolean(Est);
                        }

                        NegocioMantenimiento.ModificarTipoExpediente(tipoexpediente);

                        MostrarMensaje("Usted ha modificado el tipo de expediente:  " + tipoexpediente.descTipoExpediente + ", satisfactoriamente.");
                        txtdescripcion.Text     = "";
                        cboestado.SelectedIndex = 0;


                        txtdescripcion.Enabled = false;
                    }



                    CargarGrillaTipoExpedientes();
                    this.txttipoexpediente.Text          = "";
                    this.txtdescripcion.Text             = "";
                    this.cboestado.Enabled               = false;
                    this.GvTipoExpedientes.SelectedIndex = -1;
                }
                catch (Exception ex)
                {
                    Response.Redirect("Errores.aspx?error=" + ex.Message);
                }
            }
            else
            {
                MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función.");

                this.txtdescripcion.Text             = "";
                this.txttipoexpediente.Text          = "";
                this.txtdescripcion.Enabled          = false;
                this.cboestado.Enabled               = false;
                this.GvTipoExpedientes.SelectedIndex = -1;
            }
        }

        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
        habilitarBotones(true);
    }
Beispiel #24
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);
        }
    }
Beispiel #25
0
    protected void btnaceptar_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.txtidpersona.Text.Trim() != "")
            {
                try
                {
                    Persona persona = new Persona();
                    persona.nombrePersona = this.txtnombre.Text.Trim();



                    if (hAccion.Value == "agregar")
                    {
                        int Est;
                        if (this.cboestado.SelectedIndex == 0)
                        {
                            Est = 1;
                        }
                        else
                        {
                            Est = 0;
                        }

                        persona.estado         = Convert.ToBoolean(Est);
                        persona.idPersona      = NegocioMantenimiento.TraerIdPersona();
                        this.cboestado.Enabled = true;
                        NegocioMantenimiento.AgregarPersona(persona);

                        MostrarMensaje("Una nueva Persona ha sido agregada satisfactoriamente");
                        txtnombre.Text          = "";
                        cboestado.SelectedIndex = 0;
                        txtnombre.Enabled       = false;
                    }

                    else
                    {
                        persona.idPersona = int.Parse(GvPersonas.SelectedRow.Cells[1].Text);


                        if (cboestado.SelectedItem.Text == "Activo")
                        {
                            int Est = 1;

                            persona.estado = Convert.ToBoolean(Est);
                        }
                        else
                        {
                            int Est = 0;

                            persona.estado = Convert.ToBoolean(Est);
                        }



                        NegocioMantenimiento.ModificarPersona(persona);

                        MostrarMensaje("Usted ha modificado la Persona:  " + persona.nombrePersona + ", satisfactoriamente.");
                        txtnombre.Text          = "";
                        cboestado.SelectedIndex = 0;


                        txtnombre.Enabled = false;
                    }



                    CargarGrillaPersonas();
                    this.txtidpersona.Text        = "";
                    this.txtnombre.Text           = "";
                    this.cboestado.Enabled        = false;
                    this.GvPersonas.SelectedIndex = -1;
                }
                catch (Exception ex)
                {
                    Response.Redirect("Errores.aspx?error=" + ex.Message);
                }
            }
            else
            {
                MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función.");

                this.txtnombre.Text    = "";
                this.txtidpersona.Text = "";
                this.txtnombre.Enabled = false;
                this.cboestado.Enabled = false;
            }
        }

        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
        habilitarBotones(true);
    }
Beispiel #26
0
 private void mostrarMantenimientos()
 {
     this.tablaMantenimiento.DataSource = NegocioMantenimiento.mostrarMantenimientos();
 }
Beispiel #27
0
    protected void BtnAceptar_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.txtDesc.Text.Trim() != "")
            {
                Area area = new Area();
                area.descArea = this.txtDesc.Text.Trim();

                if (hAccion.Value == "agregar")
                {
                    int Est;
                    if (this.cboEstado.SelectedIndex == 0)
                    {
                        Est = 1;
                    }
                    else
                    {
                        Est = 0;
                    }

                    area.estado            = Convert.ToBoolean(Est);
                    area.idArea            = NegocioMantenimiento.TraerId();
                    this.cboEstado.Enabled = true;
                    NegocioMantenimiento.AgregarArea(area);
                    MostrarMensaje("Una nueva área ha sido agregada satisfactoriamente");
                    txtDesc.Text            = "";
                    cboEstado.SelectedIndex = 0;
                    txtDesc.Enabled         = false;
                }
                else
                {
                    area.idArea = byte.Parse(GvAreas.SelectedRow.Cells[1].Text);
                    if (cboEstado.SelectedItem.Text == "Activo")
                    {
                        int Est = 1;
                        area.estado = Convert.ToBoolean(Est);
                    }
                    else
                    {
                        int Est = 0;
                        area.estado = Convert.ToBoolean(Est);
                    }
                    NegocioMantenimiento.ModificarArea(area);
                    MostrarMensaje("Usted ha modificado el area:  " + area.descArea + ", satisfactoriamente.");
                    txtDesc.Text            = "";
                    cboEstado.SelectedIndex = 0;
                    txtDesc.Enabled         = false;
                }
                CargarGrillaAreas();
                this.txtCod.Text           = "";
                this.txtDesc.Text          = "";
                this.cboEstado.Enabled     = false;
                this.GvAreas.SelectedIndex = -1;
            }
            else
            {
                MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función.");
                this.txtDesc.Text          = "";
                this.txtCod.Text           = "";
                this.txtDesc.Enabled       = false;
                this.cboEstado.Enabled     = false;
                this.GvAreas.SelectedIndex = -1;
            }
            habilitarBotones(true);
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
    }
Beispiel #28
0
    protected void btnAceptar_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.txtEntidad.Text.Trim() != "")
            {
                try
                {
                    Denunciado denunciado = new Denunciado();
                    denunciado.entidad = this.txtEntidad.Text.Trim();

                    if (hAccion.Value == "agregar")
                    {
                        int Est;
                        if (this.cboEstado.SelectedIndex == 0)
                        {
                            Est = 1;
                        }
                        else
                        {
                            Est = 0;
                        }

                        denunciado.estado       = Convert.ToBoolean(Est);
                        denunciado.idDenunciado = NegocioMantenimiento.TraerIdDenunciado();
                        this.cboEstado.Enabled  = true;
                        NegocioMantenimiento.AgregarDenunciado(denunciado);
                        MostrarMensaje("Una nuevo denunciado ha sido agregado satisfactoriamente");
                        txtEntidad.Text         = "";
                        cboEstado.SelectedIndex = 0;
                        txtEntidad.Enabled      = false;
                    }

                    else
                    {
                        denunciado.idDenunciado = Convert.ToByte(int.Parse(GvDenunciados.SelectedRow.Cells[1].Text));
                        if (cboEstado.SelectedItem.Text == "Activo")
                        {
                            int Est = 1;
                            denunciado.estado = Convert.ToBoolean(Est);
                        }
                        else
                        {
                            int Est = 0;
                            denunciado.estado = Convert.ToBoolean(Est);
                        }
                        NegocioMantenimiento.ModificarDenunciado(denunciado);
                        MostrarMensaje("Usted ha modificado la Entidad:  " + denunciado.entidad + ", satisfactoriamente.");
                        txtEntidad.Text         = "";
                        cboEstado.SelectedIndex = 0;
                        txtEntidad.Enabled      = false;
                    }

                    CargarGrillaDenunciados();
                    this.txtidDenunciado.Text        = "";
                    this.txtEntidad.Text             = "";
                    this.cboEstado.Enabled           = false;
                    this.GvDenunciados.SelectedIndex = -1;
                }
                catch (Exception ex)
                {
                    Response.Redirect("Errores.aspx?error=" + ex.Message);
                }
            }
            else
            {
                MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función.");
                this.txtEntidad.Text             = "";
                this.txtidDenunciado.Text        = "";
                this.txtEntidad.Enabled          = false;
                this.cboEstado.Enabled           = false;
                this.GvDenunciados.SelectedIndex = -1;
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
        habilitarBotones(true);
    }
Beispiel #29
0
    protected void btnaceptar_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.txtdescripcion.Text.Trim() != "")
            {
                try
                {
                    Fin fin = new Fin();
                    fin.descFin = this.txtdescripcion.Text.Trim();



                    if (hAccion.Value == "agregar")
                    {
                        int Est;
                        if (this.cboestado.SelectedIndex == 0)
                        {
                            Est = 1;
                        }
                        else
                        {
                            Est = 0;
                        }

                        fin.estado             = Convert.ToBoolean(Est);
                        fin.idFin              = NegocioMantenimiento.TraerIdFin();
                        this.cboestado.Enabled = true;
                        NegocioMantenimiento.AgregarFin(fin);

                        MostrarMensaje("Un nuevo Fin ha sido agregada satisfactoriamente");
                        txtdescripcion.Text     = "";
                        cboestado.SelectedIndex = 0;
                        txtdescripcion.Enabled  = false;
                    }

                    else
                    {
                        fin.idFin = byte.Parse(GvFines.SelectedRow.Cells[1].Text);


                        if (cboestado.SelectedItem.Text == "Activo")
                        {
                            int Est = 1;

                            fin.estado = Convert.ToBoolean(Est);
                        }
                        else
                        {
                            int Est = 0;

                            fin.estado = Convert.ToBoolean(Est);
                        }



                        NegocioMantenimiento.ModificarFines(fin);

                        MostrarMensaje("Usted ha modificado el Fin:  " + fin.descFin + ", satisfactoriamente.");
                        txtdescripcion.Text     = "";
                        cboestado.SelectedIndex = 0;


                        txtdescripcion.Enabled = false;
                    }



                    CargarGrillaFines();
                    this.txtidfin.Text         = "";
                    this.txtdescripcion.Text   = "";
                    this.cboestado.Enabled     = false;
                    this.GvFines.SelectedIndex = -1;
                }
                catch (Exception ex)
                {
                    Response.Redirect("Errores.aspx?error=" + ex.Message);
                }
            }
            else
            {
                MostrarMensaje("Por Favor, complete todos los campos antes de realizar esta función.");

                this.txtdescripcion.Text    = "";
                this.txtidfin.Text          = "";
                this.txtdescripcion.Enabled = false;
                this.cboestado.Enabled      = false;
                this.GvFines.SelectedIndex  = -1;
            }
        }

        catch (Exception ex)
        {
            Response.Redirect("Errores.aspx?error=" + ex.Message);
        }
        habilitarBotones(true);
    }