Example #1
0
    protected void btn_Conf_Click(object sender, EventArgs e)
    {
        if (hf_confirmar.Value == "ELIM")
        {
            ConductorBC c = new ConductorBC();
            c.ID = Convert.ToInt32(hf_id.Value);
            if (c.Eliminar())
            {
                utils.ShowMessage2(this, "eliminar", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "eliminar", "error");
            }
            ObtenerConductores(true);
        }
        if (hf_confirmar.Value == "BLOQUEAR")
        {
            ConductorBC c = new ConductorBC();
            c.ID             = Convert.ToInt32(hf_id.Value);
            c.MOTIVO_BLOQUEO = txt_confirmarMotivo.Text;

            if (c.Bloquear(((UsuarioBC)this.Session["Usuario"]).ID))
            {
                utils.ShowMessage2(this, "bloquear", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "bloquear", "error");
            }
            ObtenerConductores(true);
        }
        if (hf_confirmar.Value == "ACTIVAR")
        {
            ConductorBC c = new ConductorBC();
            c.ID = Convert.ToInt32(hf_id.Value);
            if (c.Activar())
            {
                utils.ShowMessage2(this, "activar", "success");
                utils.CerrarModal(this, "modalConf");
            }
            else
            {
                utils.ShowMessage2(this, "activar", "error");
            }
            ObtenerConductores(true);
        }
    }