public ActionResult DeleteComposite(FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         RolesComponent rolesComponent = new RolesComponent();
         Roles          roles          = new Roles();
         Roles          roles1         = new Roles();
         roles1.Id     = int.Parse(collection.Get("name"));
         roles.Id      = int.Parse(collection.Get("id"));
         roles.permiso = roles1;
         rolesComponent.DeleteComposite(roles);
         return(RedirectToAction("VerPermisos", new { id = int.Parse(collection.Get("id")) }));
     }
     catch (Exception e)
     {
         return(View());
     }
 }
예제 #2
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (mgABMComposite.CurrentRow.Cells[0].Value == null || mgABMQuitar.CurrentRow.Cells[0].Value == null)
            {
                MetroMessageBox.Show(this, "No selecciono un rol o permiso", "error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            }
            else
            {
                Roles roles = new Roles();
                Roles unrol = new Roles();
                roles.Id      = int.Parse(mgABMComposite.CurrentRow.Cells[0].Value.ToString());
                unrol.Id      = int.Parse(mgABMQuitar.CurrentRow.Cells[0].Value.ToString());
                roles.permiso = unrol;
                RolesComponent rolesComponent = new RolesComponent();
                rolesComponent.DeleteComposite(roles);

                llenarGrillaABM();
            }
        }