예제 #1
0
 protected void gdvTipoDocumento_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         TipoDocumento objTipoDoc = new TipoDocumento();
         objTipoDoc.Codigo = Convert.ToInt32(gdvTipoDocumento.DataKeys[e.RowIndex].Values[0]);
         objTipoDoc.Excluir(objTipoDoc.Codigo);
         this.Selecionar();
     }
     catch (Model.Base.GepexException.EBancoDados ex)
     {
         Mensagem.Aviso(Comum.TraduzirMensagem(ex));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
예제 #2
0
 private void BtnExcluir_Click(object sender, EventArgs e)
 {
     if (GridDados.CurrentRow != null)
     {
         if (MessageBox.Show("Confirma a Exclusão do Registro", "Confirmação", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             Documentos.IdDocumento = int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString());
             Documentos.Excluir();
             PopularGrid();
             LimpaDados();
             GridDados.Focus();
         }
     }
     else
     {
         MessageBox.Show("Não existe Registro para Excluir", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }