示例#1
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        Perfil per = new Perfil();

        per.Per_tipo = txbPerfil.Text;

        switch (PerfilDB.Insert(per))
        {
        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>success();</script>", false);
            break;

        case -2:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>error();</script>", false);
            break;
        }

        txbPerfil.Text = "";
    }
示例#2
0
    protected void btn_Click(object sender, EventArgs e)
    {
        Perfil p = new Perfil();

        p.Per_descricao = txtDescricao.Text;

        switch (PerfilDB.Insert(p))
        {
        case 0:
            ltl.Text  = "<div class='alert alert-success'>";
            ltl.Text += ">>>>>>>>>> Cadastro OK <<<<<<<<<<";
            ltl.Text += "</div>";
            CarregarGrid();
            break;

        case -2:
            ltl.Text  = "<div class='alert alert-danger'>";
            ltl.Text += ">>>>>>>>>> ERRO <<<<<<<<<<";
            ltl.Text += "</div>";
            break;
        }
    }