示例#1
0
    //RowCommand da Grid Empresarial Editar
    protected void grvEmpEditar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Visualizar")
        {
            Mod_modelos mod = Mod_modelosDB.Select(Convert.ToInt32(e.CommandArgument));
            Descricao.Text = Function.QuebrarLinha(mod.DescricaoModelo, 70);
            ModalPopupExtenderDesc.Show();
            ModalEmpresarial.Show();
        }

        if (e.CommandName == "Editar")
        {
            int         id  = Convert.ToInt32(e.CommandArgument);
            Mod_modelos mod = Mod_modelosDB.Aplicar(id);


            Session.Remove("modelo");

            if (mod != null)
            {
                Session["modelo"] = mod;
                Session["editar"] = true;
                Response.Redirect("ConfirmarModelo.aspx");
            }
            else
            {
                lblTotalEmpEditar.Text = "Erro ao selecionar chamado";
            }
        }
    }
示例#2
0
    //RowCommand da Grid Empresarial Habilitar
    protected void grvEmpHabilitar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Visualizar")
        {
            Mod_modelos mod = Mod_modelosDB.Select(Convert.ToInt32(e.CommandArgument));
            Descricao.Text = Function.QuebrarLinha(mod.DescricaoModelo, 70); //Function.QuebrarLinha(mod.DescricaoModelo, 20);
            ModalPopupExtenderDesc.Show();
            ModalEmpresarial.Show();
        }

        if (e.CommandName == "Alterar")
        {
            Mod_modelos mod = new Mod_modelos();
            mod = Mod_modelosDB.Select(Convert.ToInt32(e.CommandArgument));
            Mod_modelosDB mod_db = new Mod_modelosDB();
            if (mod.AtivoModelo == true)
            {
                switch (mod_db.Habilitar(mod, 0))
                {
                case -2:
                    ClientScript.RegisterStartupScript(GetType(), "alerta", "alert('Status não Alterado.');", true);
                    break;

                case 0:

                    ClientScript.RegisterStartupScript(GetType(), "alerta", "alert('Modelo Desabilitado com sucesso!');", true);
                    CarregaGrid();
                    break;
                }
            }
            else if (mod.AtivoModelo == false)
            {
                switch (mod_db.Habilitar(mod, 1))
                {
                case -2:
                    ClientScript.RegisterStartupScript(GetType(), "alerta", "alert('Status não Alterado.');", true);
                    break;

                case 0:
                    ClientScript.RegisterStartupScript(GetType(), "alerta", "alert('Modelo Habilitado com sucesso.');", true);
                    CarregaGrid();
                    break;
                }
            }
        }
        ModalEmpresarial.Show();
    }
示例#3
0
 protected void btnEmpresarial_Click(object sender, ImageClickEventArgs e)
 {
     ModalEmpresarial.Show();
 }
示例#4
0
 protected void btnBuscarEmp2_Click(object sender, EventArgs e)
 {
     buscarModelo(txtBuscaEmp2, grvEmpEditar, lblTotalEmpEditar, 3);
     ModalEmpresarial.Show();
 }
示例#5
0
 //pageIndex da Grid Empresarial Editar
 protected void grvEmpEditar_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     grvEmpEditar.PageIndex = e.NewPageIndex;
     CarregaGrid();
     ModalEmpresarial.Show();
 }