Пример #1
0
    protected void btn_editarNomeFantasia_Click(object sender, EventArgs e)
    {
        if (txt_nomeFantasia.ReadOnly == false)
        {
            if (CompanyDB.UpdateNomeFantasia(txt_nomeFantasia.Text, Convert.ToInt32(Session["id"])) == 0)
            {
                ltl_status.Text           = "<script type=text/javascript> toastr.success('Dados atualizados com sucesso') </script>";
                txt_nomeFantasia.ReadOnly = true;
                txt_nomeFantasia.Enabled  = false;

                btn_editarNomeFantasia.Text = "";
                btn_editarNomeFantasia.Text = "<i class='fa fa-pencil-alt'></i>";
                Page_Load(this, EventArgs.Empty);
            }
            else
            {
                ltl_status.Text = "<script type=text/javascript> toastr.error('Algo deu errado, tente novamente mais tarde') </script>";
            }
        }
        else
        {
            btn_editarNomeFantasia.Text = "<i class='fa  fa-check'></i>";
            txt_nomeFantasia.ReadOnly   = false;

            txt_nomeFantasia.Enabled = true;
        }
    }