private void btnModificarPermiso_Click(object sender, EventArgs e) { if (txtIPermiso.Text == "") { MetroMessageBox.Show(this, "No selecciono un registro", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { PermisoComponent permisoComponent = new PermisoComponent(); Permiso permiso = new Permiso(); permiso.Id = int.Parse(mgListadoPermiso.CurrentRow.Cells[0].Value.ToString()); permiso.name = txtIPermiso.Text; permisoComponent.Update(permiso); llenarGrillaPermiso(); } }
public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here Permiso permiso = new Permiso(); permiso.name = collection.Get("name"); permiso.Id = id; PermisoComponent permisoComponent = new PermisoComponent(); if (permisoComponent.Verificar(permiso)) { permisoComponent.Update(permiso); return(RedirectToAction("Index")); } else { return(RedirectToAction("ErroPage", new { id = permiso.name })); } } catch (Exception e) { return(View()); } }