Beispiel #1
0
        private void eliminar_Click(object sender, EventArgs e)
        {
            Int32 id = (Int32)dataGridRoles.Rows[dataGridRoles.CurrentCell.RowIndex].Cells["id_rol"].Value;

            DialogResult result = MessageBox.Show("Seguro quiere eliminar al rol", "Rol", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                data.Delete(id, out exError);
                if (exError == null)
                {
                    cargarDataGrid();
                }
                else
                {
                    MessageBox.Show("No se pudo eliminar el rol, " + exError.Message);
                    return;
                }
            }
        }
Beispiel #2
0
 public ReturnValor Delete(BEEliminaRolRequest pEliminaRol)
 {
     try
     {
         using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required))
         {
             oReturn.Exitosa = oRolData.Delete(pEliminaRol);
             if (oReturn.Exitosa)
             {
                 tx.Complete();
                 oReturn.Message = HelpMessages.Evento_DELETE;
             }
         }
     }
     catch (Exception ex)
     {
         oReturn = HelpException.mTraerMensaje(ex);
     }
     return(oReturn);
 }