protected void btn_atualiza_Click(object sender, EventArgs e)
        {
            DAO.Juizofinal_cliente obj_cliente = DAO.Juizofinal_cliente.GetCliente_ID(Convert.ToInt16(sCliente));

            if (txt_libera_licenca.Text != String.Empty && txt_libera_jazigo.Text == String.Empty)
            {
                obj_cliente.Licenca_comprada = Convert.ToInt16(txt_libera_licenca.Text);
            }
            else if (txt_libera_jazigo.Text != String.Empty && txt_libera_licenca.Text == String.Empty)
            {
                obj_cliente.Jazigo_comprado = Convert.ToInt16(txt_libera_jazigo.Text);
            }
            else if (txt_libera_jazigo.Text != String.Empty && txt_libera_licenca.Text != String.Empty)
            {
                obj_cliente.Licenca_comprada = Convert.ToInt16(txt_libera_licenca.Text);
                obj_cliente.Jazigo_comprado  = Convert.ToInt16(txt_libera_jazigo.Text);
            }

            obj_cliente.UpdateRegistro();

            limpaCampos();

            string mensagem = "Liberação de licennça de uso e de Jazigo atualizados com sucesso!";
            string url      = "Default.aspx";

            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('" + mensagem + "'); location='" + url + "';", true);
            return;
        }
Exemple #2
0
        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            try
            {
                Roles.AddUserToRole((sender as CreateUserWizard).UserName, "Clientes");

                DAO.Juizofinal_cliente.RodaProc();

                DAO.Juizofinal_cliente obj = DAO.Juizofinal_cliente.busca_cliente(CreateUserWizard1.UserName);
                obj.Jazigo_comprado = 1;
                if (check_corporacoes.Checked == true)
                {
                    obj.Corporacao = true;
                }
                obj.UpdateRegistro();

                DAO.Email.Pessoa_cadastrada("*****@*****.**", CreateUserWizard1.UserName);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "Ok", "alert('Cadastro realizado com sucesso!');", true);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Ok", "alert('Ocorreu um erro em seu cadastro. Favor mande um e-mail para nosso contato.');", true);
                //throw;
            }
        }