コード例 #1
0
ファイル: Teste.aspx.cs プロジェクト: Didox/MVC_e_Velocit_app
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Teste = new Teste();
        try
        {
            if (txtId.Text != "")
            {
                Teste.IDTeste = int.Parse(txtId.Text);
                Teste.Get();
            }

            Teste.Descricao = txtDescricao.Text;
        Teste.Oliveira = txtOliveira.Text;
        Teste.Assi = int.Parse(txtAssi.Text);

            Teste.Save();
            GetTeste((int)Teste.IDTeste);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
コード例 #2
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Teste = new Teste();

        try
        {
            if (txtId.Text != "")
            {
                Teste.IDTeste = int.Parse(txtId.Text);
                Teste.Get();
            }

            Teste.Descricao = txtDescricao.Text;
            Teste.Oliveira  = txtOliveira.Text;
            Teste.Assi      = int.Parse(txtAssi.Text);

            Teste.Save();
            GetTeste((int)Teste.IDTeste);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }