private void btnDisponeTodos_Click(object sender, EventArgs e) { if (dtgValAsignadas.RowCount > 0) { Boolean Exito = true; for (int i = 0; i < dtgValAsignadas.RowCount; i++) { int xRow = dtgValAsignadas.GetVisibleRowHandle(i); //Inserta Detalles CLS_Perfiles_Pantallas del = new CLS_Perfiles_Pantallas(); del.Id_Perfil = cmbPerfiles.EditValue.ToString(); del.Id_Pantalla = dtgValAsignadas.GetRowCellValue(xRow, dtgValAsignadas.Columns["Id_Pantalla"]).ToString(); del.MtdEliminarPerfilesPantallas(); if (!del.Exito) { Exito = false; XtraMessageBox.Show(del.Mensaje); } } if (Exito) { CargarAsignadas(); CargarDisponible(); XtraMessageBox.Show("Se han quitado los permisos con exito"); } } else { XtraMessageBox.Show("Todos los permisos ya estan disponibles"); } }
private void EliminarPerfilesPantallas() { CLS_Perfiles_Pantallas Clase = new CLS_Perfiles_Pantallas(); Clase.Id_Pantalla = RemovePantalla; Clase.Id_Perfil = cmbPerfiles.EditValue.ToString(); Clase.MtdEliminarPerfilesPantallas(); if (Clase.Exito) { XtraMessageBox.Show("Se ha Eliminado el registro con exito"); LimpiarCampos(); } else { XtraMessageBox.Show(Clase.Mensaje); } }
private void btnDispone_Click(object sender, EventArgs e) { if (cmbPerfiles.EditValue != null && InventarioPantallaIdAsignada != string.Empty) { CLS_Perfiles_Pantallas del = new CLS_Perfiles_Pantallas(); del.Id_Perfil = cmbPerfiles.EditValue.ToString(); del.Id_Pantalla = InventarioPantallaIdAsignada; del.MtdEliminarPerfilesPantallas(); if (del.Exito) { XtraMessageBox.Show("Se ha quitado el permiso con exito"); CargarAsignadas(); CargarDisponible(); } else { XtraMessageBox.Show(del.Mensaje); } } else { XtraMessageBox.Show("No se ha seleccionado Usuario o pantalla a quitar"); } }