예제 #1
0
 private void bbDelCarac_Click(object sender, EventArgs e)
 {
     if (bsCaracteristica.Current != null)
     {
         if (MessageBox.Show("Confirma exclusão do registro selecionado?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
         {
             try
             {
                 TCN_Caracteristica.ExcluirCaracteristica(bsCaracteristica.Current as TRegistro_Caracteristica, null);
                 afterBusca();
             }
             catch (Exception ex)
             { MessageBox.Show("Erro excluir registro: " + ex.Message.Trim()); }
         }
     }
 }
예제 #2
0
 private void bbAltCarac_Click(object sender, EventArgs e)
 {
     if (bsCaracteristica.Current != null)
     {
         Utils.InputBox ibp = new Utils.InputBox(string.Empty, (bsCaracteristica.Current as TRegistro_Caracteristica).Ds_caracteristica);
         ibp.Text = "Alterar Caracteristica Produto";
         string ret = ibp.ShowDialog();
         if (!string.IsNullOrEmpty(ret))
         {
             try
             {
                 TCN_Caracteristica.GravarCaracteristica(new TRegistro_Caracteristica {
                     Id_caracteristica = (bsCaracteristica.Current as TRegistro_Caracteristica).Id_caracteristica, Ds_caracteristica = ret.ToUpper()
                 }, null);
                 afterBusca();
             }
             catch (Exception ex)
             { MessageBox.Show("Erro alterar registro: " + ex.Message.Trim()); }
         }
     }
 }
예제 #3
0
        private void bbAddCarac_Click(object sender, EventArgs e)
        {
            Utils.InputBox ibp = new Utils.InputBox();
            ibp.Text = "Caracteristica Produto";
            string ret = ibp.ShowDialog();

            if (!string.IsNullOrEmpty(ret))
            {
                try
                {
                    TCN_Caracteristica.GravarCaracteristica(new TRegistro_Caracteristica {
                        Ds_caracteristica = ret.ToUpper()
                    }, null);
                    afterBusca();
                }
                catch (Exception ex)
                { MessageBox.Show("Erro gravar registro: " + ex.Message.Trim()); }
            }
            else
            {
                MessageBox.Show("Obrigatório informar caracteristica para gravar.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #4
0
 private void afterBusca()
 {
     bsCaracteristica.DataSource = TCN_Caracteristica.Buscar(string.Empty, string.Empty, 0, string.Empty, null);
     bsCaracteristica_PositionChanged(this, new EventArgs());
 }