예제 #1
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         PermisoComponent permisoComponent = new PermisoComponent();
         permisoComponent.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #2
0
 private void btnEliminarPermiso_Click(object sender, EventArgs e)
 {
     if (txtIPermiso.Text == "")
     {
         MetroMessageBox.Show(this, "No selecciono un registro", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         var confirmar = MetroMessageBox.Show(this, "¿Desea Borrar este registro?", "Borrar", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (confirmar == DialogResult.Yes)
         {
             PermisoComponent permisoComponent = new PermisoComponent();
             permisoComponent.Delete(int.Parse(mgListadoPermiso.CurrentRow.Cells[0].Value.ToString()));
             llenarGrillaPermiso();
         }
     }
 }