Example #1
0
 private void BtnGravar_Click(object sender, EventArgs e)
 {
     if (TxtDescricao.Text.Trim() != "")
     {
         Eventos.IdCodigo  = int.Parse(TxtCodigo.Text);
         Eventos.Descricao = TxtDescricao.Text;
         Eventos.ProvDesc  = LstProvDesc.SelectedIndex;
         if (Ck_FolhaBruta.Checked)
         {
             Eventos.FolhaBruta = 1;
         }
         else
         {
             Eventos.FolhaBruta = 0;
         }
         Eventos.GravarDados();
         PopularGrid();
         PopularCampos(Eventos.IdCodigo);
         StaFormEdicao = false;
         FrmPrincipal.ControleBotoes(false);
     }
     else
     {
         MessageBox.Show("Descrição do Evento não Informado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtDescricao.Focus();
     }
 }
Example #2
0
 private void BotoesReset()
 {
     BtnGravar.Enabled  = true;
     BtnAlterar.Enabled = false;
     BtnExcluir.Enabled = false;
     TxtDescricao.Clear();
 }
Example #3
0
        protected void BtnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                if (TxtDescricao.Text.Trim().Equals(String.Empty))
                {
                    TxtDescricao.Text = "";
                    TxtDescricao.Focus();
                    throw new CampoNaoInformadoException("Tipo de Conta Bancária", "Descrição", true);
                }

                TipoContaBancaria lTipoContaBancaria = null;
                string mensagem = "";
                if (Request.QueryString["id"] != null)
                {
                    lTipoContaBancaria = TipoContaBancariaBLL.Instance.BuscarPorId(Convert.ToInt32(Request.QueryString["id"]));
                    mensagem = "Tipo de Conta Bancária alterado com sucesso.";
                }
                else
                {
                    lTipoContaBancaria = new TipoContaBancaria();
                    mensagem = "Tipo de Conta Bancária cadastrado com sucesso.";
                }
                lTipoContaBancaria.Descricao = TxtDescricao.Text.Trim();
                lTipoContaBancaria.Operacao = TxtOperacao.Text.Trim();
                TipoContaBancariaBLL.Instance.Persistir(lTipoContaBancaria);
                Web.ExibeAlerta(Page, mensagem, "Listar.aspx");
            }
            catch (BusinessException ex)
            {
                Web.ExibeAlerta(Page, ex.Message);
            }
        }
Example #4
0
 private void Reset()
 {
     TxtDescricao.Clear();
     BtnAlterar.Enabled = false;
     BtnExcluir.Enabled = false;
     BtnGravar.Enabled  = true;
     TxtDescricao.Focus();
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         load();
         TxtDescricao.Focus();
     }
 }
 private void Limpar()
 {
     TxtDescricao.Clear();
     TxtValor.Text        = "0,00";
     BtnExcluir.IsEnabled = false;
     BtnAlterar.IsEnabled = false;
     BtnGravar.IsEnabled  = true;
 }
Example #7
0
 protected void btnNovo_Click(object sender, EventArgs e)
 {
     TxtDescricao.Text = "";
     TxtTipo.Text      = "";
     TxtMarca.Text     = "";
     TxtPreco.Text     = "";
     IdH.Value         = "0";
     TxtDescricao.Focus();
 }
Example #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         PopuparGrid();
     }
     PopuparGrid();
     TxtDescricao.Focus();
 }
Example #9
0
 private void Reset()
 {
     TxtAno.Text = dtAno.ToString("yyyy");
     TxtDescricao.Clear();
     BtnAlterar.Enabled = false;
     BtnExcluir.Enabled = false;
     BtnGravar.Enabled  = true;
     MktData.Clear();
     MktData.Focus();
 }
 private void Limpar()
 {
     TxtEmpresa.Clear();
     TxtUsuario.Clear();
     TxtSenha.Clear();
     TxtDominio.Clear();
     TxtDescricao.Clear();
     BtnAlterar.IsEnabled = false;
     BtnExcluir.IsEnabled = false;
     BtnGravar.IsEnabled  = true;
 }
Example #11
0
 private void BtnNovo_Click(object sender, EventArgs e)
 {
     TxtDescricao.Text        = "";
     TxtValor.Value           = 0;
     LstTipoDoc.SelectedValue = "0";
     //
     MvCaixa.LerDados(0);
     StaFormEdicao = true;
     HabilitarControles();
     TxtDescricao.Focus();
 }
Example #12
0
 private void LimpaProduto()
 {
     TxtDescricao.Clear();
     TxtQuant.Clear();
     TxtPrecoCusto.Clear();
     TxtFabricante.Clear();
     TxtProduto.Clear();
     TxtEAN.Clear();
     TxtProduto.Enabled = true;
     TxtProduto.Focus();
     total = 0;
     DataVencNF.Show();
 }
Example #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         LstGrupo.DataSource     = Controle.ConsultaTabela("SELECT ID_GRUPO,GRUPO FROM GRUPOPRODUTO WHERE LISTAWEB=1 AND LISTAVENDA=1 ORDER BY GRUPO");
         LstGrupo.DataTextField  = "GRUPO";
         LstGrupo.DataValueField = "ID_GRUPO";
         LstGrupo.DataBind();
         LstGrupo.Items.Insert(0, "TODOS");
         LstGrupo.SelectedValue = "0";
         PopuparGrid();
     }
     PopuparGrid();
     TxtDescricao.Focus();
 }
Example #14
0
 protected void BtnSalvar_Click(object sender, EventArgs e)
 {
     try
     {
         if (TxtDescricao.Text.Trim().Equals(String.Empty))
         {
             TxtDescricao.Text = "";
             TxtDescricao.Focus();
             throw new CampoNaoInformadoException("Evento Folha", "Descrição", true);
         }
         if (TxtPercentual.Text.Trim().Equals(String.Empty))
         {
             TxtPercentual.Text = "";
             TxtPercentual.Focus();
             throw new CampoNaoInformadoException("Evento Folha", "Descrição", true);
         }
         EventoFolha lEventoFolha = null;
         string      mensagem     = "";
         if (Request.QueryString["id"] != null)
         {
             lEventoFolha = EventoFolhaBLL.Instance.BuscarPorId(Convert.ToInt32(Request.QueryString["id"]));
             mensagem     = "Evento Folha alterado com sucesso.";
         }
         else
         {
             lEventoFolha = new EventoFolha();
             mensagem     = "Evento Folha cadastrado com sucesso.";
         }
         lEventoFolha.Descricao  = TxtDescricao.Text;
         lEventoFolha.Percentual = float.Parse(TxtPercentual.Text);
         if (RbtnDesconto.Checked)
         {
             lEventoFolha.TipoEvento = ETipoEvento.Desconto;
         }
         else
         {
             lEventoFolha.TipoEvento = ETipoEvento.Provento;
         }
         EventoFolhaBLL.Instance.Persistir(lEventoFolha);
         Web.ExibeAlerta(Page, mensagem, "Listar.aspx");
     }
     catch (BusinessException ex)
     {
         Web.ExibeAlerta(Page, ex.Message);
     }
 }
Example #15
0
        public void LimparCampos()
        {
            TxtDescricao.Clear();
            TxtCodigo.Clear();

            foreach (Control ctrl in groupBox2.Controls)
            {
                if (ctrl is CheckBox)
                {
                    CheckBox ckb = (CheckBox)ctrl;

                    if (ckb.Checked)
                    {
                        ckb.Checked = false;
                    }
                }
            }
        }
Example #16
0
        private void BtnEditar_Click(object sender, EventArgs e)
        {
            if (GridDados.CurrentRow == null)
            {
                Paginas.SelectTab(0);
                MessageBox.Show("Não existe Registro para Edição", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                PopularCampos(int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString()));

                /* if (int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString()) <= 10)
                 * {
                 *   MessageBox.Show("Evento resevado pelo sistema, não pode ser alterado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 *   return;
                 * }*/
                StaFormEdicao = true;
                FrmPrincipal.ControleBotoes(true);
                TxtDescricao.Focus();
            }
        }