Exemple #1
0
 private void bbAddValor_Click(object sender, EventArgs e)
 {
     if (bsCaracteristica.Current != null)
     {
         Utils.InputBox ibp = new Utils.InputBox();
         ibp.Text = "Valor Caracteristica";
         string ret = ibp.ShowDialog();
         if (!string.IsNullOrEmpty(ret))
         {
             try
             {
                 TCN_ValorCaracteristica.Gravar(new TRegistro_ValorCaracteristica {
                     Id_caracteristica = (bsCaracteristica.Current as TRegistro_Caracteristica).Id_caracteristica, Valor = ret.ToUpper()
                 }, null);
                 bsCaracteristica_PositionChanged(this, new EventArgs());
             }
             catch (Exception ex)
             { MessageBox.Show("Erro gravar registro: " + ex.Message.Trim()); }
         }
         else
         {
             MessageBox.Show("Obrigatório informar valor para gravar.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Exemple #2
0
 private void bsCaracteristica_PositionChanged(object sender, EventArgs e)
 {
     if (bsCaracteristica.Current != null)
     {
         bsValor.DataSource = TCN_ValorCaracteristica.Buscar((bsCaracteristica.Current as TRegistro_Caracteristica).Id_caracteristicastr,
                                                             string.Empty,
                                                             string.Empty,
                                                             0,
                                                             string.Empty,
                                                             null);
     }
     else
     {
         bsValor.Clear();
     }
 }
Exemple #3
0
 private void bbDelValor_Click(object sender, EventArgs e)
 {
     if (bsValor.Current != null)
     {
         if (MessageBox.Show("Confirma exclusão do registro selecionado?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
         {
             try
             {
                 TCN_ValorCaracteristica.Excluir(bsValor.Current as TRegistro_ValorCaracteristica, null);
                 bsCaracteristica_PositionChanged(this, new EventArgs());
             }
             catch (Exception ex)
             { MessageBox.Show("Erro excluir registro: " + ex.Message.Trim()); }
         }
     }
 }
Exemple #4
0
 private void bbAltValor_Click(object sender, EventArgs e)
 {
     if (bsValor.Current != null)
     {
         Utils.InputBox ibp = new Utils.InputBox(string.Empty, (bsValor.Current as TRegistro_ValorCaracteristica).Valor);
         ibp.Text = "Alterar Valor Caracteristica Produto";
         string ret = ibp.ShowDialog();
         if (!string.IsNullOrEmpty(ret))
         {
             try
             {
                 TCN_ValorCaracteristica.Gravar(new TRegistro_ValorCaracteristica {
                     Id_caracteristica = (bsValor.Current as TRegistro_ValorCaracteristica).Id_caracteristica,
                     Id_item           = (bsValor.Current as TRegistro_ValorCaracteristica).Id_item, Valor = ret.ToUpper()
                 }, null);
                 bsCaracteristica_PositionChanged(this, new EventArgs());
             }
             catch (Exception ex)
             { MessageBox.Show("Erro alterar registro: " + ex.Message.Trim()); }
         }
     }
 }