protected void GridView_CLASES_RowCommand(object sender, GridViewCommandEventArgs e) { HiddenField_GRIILA_SELECCIONADA_ACTUALMENTE.Value = GrillasFormulario.Clases.ToString(); int indexSeleccionado = Convert.ToInt32(e.CommandArgument); TextBox datoGrilla; HiddenField_FILA_CLASE.Value = indexSeleccionado.ToString(); HiddenField_ID_CLASE.Value = GridView_CLASES.DataKeys[indexSeleccionado].Values["ID_CLASE"].ToString(); datoGrilla = GridView_CLASES.Rows[indexSeleccionado].FindControl("TextBox_DESCRIPCION_CLASE") as TextBox; HiddenField_DESCRIPCION_CLASE.Value = datoGrilla.Text.Trim(); if (e.CommandName == "modificar") { HiddenField_ACCION_CLASE.Value = AccionesGrilla.modificar.ToString(); habilitar_fila_grilla(GridView_CLASES, indexSeleccionado, 5, false, false, false); ocultar_paneles_generales(true, true, true, false); acciones_sobre_botones_deacicon_grillas(Button_NUEVO_CLASE, Button_GUARDAR_CLASE, Button_CANCELAR_CLASE, false, true, true); } else { if (e.CommandName == "eliminar") { HiddenField_ACCION_CLASE.Value = AccionesGrilla.Eliminar.ToString(); ocultar_paneles_generales(true, true, true, false); acciones_sobre_botones_deacicon_grillas(Button_NUEVO_CLASE, Button_GUARDAR_CLASE, Button_CANCELAR_CLASE, false, false, false); clase _clase = new clase(Session["idEmpresa"].ToString()); DataTable tablaInfoClase = _clase.ObtenerActidadesEmpresaPorIdClase(HiddenField_ACCION_CLASE.Value); DataRow filaInfoClase = tablaInfoClase.Rows[0]; Informar(Panel_FONDO_MENSAJE_SECCION, Image_MENSAJE_ACCION_SECCION, Panel_MENSAJE_ACCION_SECCION, Label_MENSAJE_ACCION_SECCION, "Al eliminar la CLASE seleccionada se verán afectadas " + filaInfoClase["NUM_ACTIVIDADES"].ToString() + " ACTIVIDADES y " + filaInfoClase["NUM_EMPRESAS"].ToString() + " EMPRESAS, Desea continuar?", Proceso.Pregunta); } else { if (e.CommandName == "seleccionar") { HiddenField_ACCION_CLASE.Value = AccionesGrilla.Seleccionar.ToString(); seleccionarFilaDeGrilla(GridView_CLASES, indexSeleccionado); cargar_GridView_ACTIVIDADES(GridView_CLASES.DataKeys[indexSeleccionado].Values["ID_CLASE"].ToString()); ocultar_paneles_generales(true, true, true, true); acciones_sobre_botones_deacicon_grillas(Button_NUEVO_ACTIVIDAD, Button_GUARDAR_ACTIVIDAD, Button_CANCELAR_ACTIVIDAD, true, false, false); admin_columnas_grilla(GridView_ACTIVIDADES, false, true, true, false); HiddenField_ACCION_ACTIVIDAD.Value = AccionesGrilla.Ninguna.ToString(); HiddenField_FILA_ACTIVIDAD.Value = null; HiddenField_ID_ACTIVIDAD.Value = null; HiddenField_DESCRIPCION_ACTIVIDAD.Value = null; } } } }
private void Modificar() { int filaSeleccionada = 0; GridViewRow filaGrilla = null; TextBox datoGrilla; String ID_SELECCIONADO = null; DataTable tablaInfo; DataRow filaInfo; if (HiddenField_GRIILA_SELECCIONADA_ACTUALMENTE.Value == GrillasFormulario.Secciones.ToString()) { filaSeleccionada = Convert.ToInt32(HiddenField_FILA_SECCION.Value); filaGrilla = GridView_SECCIONES.Rows[filaSeleccionada]; datoGrilla = filaGrilla.FindControl("TextBox_ID_SECCION") as TextBox; ID_SELECCIONADO = datoGrilla.Text.Trim().ToUpper(); seccion _seccion = new seccion(Session["idEmpresa"].ToString()); tablaInfo = _seccion.ObtenerDivisionesClasesActidadesEmpresaPorIdSeccion(ID_SELECCIONADO); filaInfo = tablaInfo.Rows[0]; Informar(Panel_FONDO_MENSAJE_SECCION, Image_MENSAJE_ACCION_SECCION, Panel_MENSAJE_ACCION_SECCION, Label_MENSAJE_ACCION_SECCION, "Al modificar la SECCIÓN seleccionada se verán afectadas " + filaInfo["NUM_DIVISIONES"].ToString() + " DIVISIONES, " + filaInfo["NUM_CLASES"].ToString() + " CLASES, " + filaInfo["NUM_ACTIVIDADES"].ToString() + " ACTIVIDADES y " + filaInfo["NUM_EMPRESAS"].ToString() + " EMPRESAS, Desea continuar?", Proceso.Pregunta); } else { if (HiddenField_GRIILA_SELECCIONADA_ACTUALMENTE.Value == GrillasFormulario.Divisiones.ToString()) { filaSeleccionada = Convert.ToInt32(HiddenField_FILA_DIVISION.Value); filaGrilla = GridView_DIVISIONES.Rows[filaSeleccionada]; datoGrilla = filaGrilla.FindControl("TextBox_ID_DIVISION") as TextBox; ID_SELECCIONADO = datoGrilla.Text.Trim().ToUpper(); division _division = new division(Session["idEmpresa"].ToString()); tablaInfo = _division.ObtenerClasesActidadesEmpresaPorIdDivision(ID_SELECCIONADO); filaInfo = tablaInfo.Rows[0]; Informar(Panel_FONDO_MENSAJE_SECCION, Image_MENSAJE_ACCION_SECCION, Panel_MENSAJE_ACCION_SECCION, Label_MENSAJE_ACCION_SECCION, "Al modificar la DIVISIÓN seleccionada se verán afectadas " + filaInfo["NUM_CLASES"].ToString() + " CLASES, " + filaInfo["NUM_ACTIVIDADES"].ToString() + " ACTIVIDADES y " + filaInfo["NUM_EMPRESAS"].ToString() + " EMPRESAS, Desea continuar?", Proceso.Pregunta); } else { if (HiddenField_GRIILA_SELECCIONADA_ACTUALMENTE.Value == GrillasFormulario.Clases.ToString()) { filaSeleccionada = Convert.ToInt32(HiddenField_FILA_CLASE.Value); filaGrilla = GridView_CLASES.Rows[filaSeleccionada]; datoGrilla = filaGrilla.FindControl("TextBox_ID_CLASE") as TextBox; ID_SELECCIONADO = datoGrilla.Text.Trim().ToUpper(); clase _clase = new clase(Session["idEmpresa"].ToString()); tablaInfo = _clase.ObtenerActidadesEmpresaPorIdClase(ID_SELECCIONADO); filaInfo = tablaInfo.Rows[0]; Informar(Panel_FONDO_MENSAJE_SECCION, Image_MENSAJE_ACCION_SECCION, Panel_MENSAJE_ACCION_SECCION, Label_MENSAJE_ACCION_SECCION, "Al modificar la CLASE seleccionada se verán afectadas " + filaInfo["NUM_ACTIVIDADES"].ToString() + " ACTIVIDADES y " + filaInfo["NUM_EMPRESAS"].ToString() + " EMPRESAS, Desea continuar?", Proceso.Pregunta); } else { if (HiddenField_GRIILA_SELECCIONADA_ACTUALMENTE.Value == GrillasFormulario.Actividades.ToString()) { filaSeleccionada = Convert.ToInt32(HiddenField_FILA_ACTIVIDAD.Value); filaGrilla = GridView_ACTIVIDADES.Rows[filaSeleccionada]; datoGrilla = filaGrilla.FindControl("TextBox_ID_ACTIVIDAD") as TextBox; ID_SELECCIONADO = datoGrilla.Text.Trim().ToUpper(); actividad _actividad = new actividad(Session["idEmpresa"].ToString()); tablaInfo = _actividad.ObtenerEmpresaPorIdActividad(ID_SELECCIONADO); filaInfo = tablaInfo.Rows[0]; Informar(Panel_FONDO_MENSAJE_SECCION, Image_MENSAJE_ACCION_SECCION, Panel_MENSAJE_ACCION_SECCION, Label_MENSAJE_ACCION_SECCION, "Al modificar la ACTIVIDAD seleccionada se verán afectadas " + filaInfo["NUM_EMPRESAS"].ToString() + " EMPRESAS, Desea continuar?", Proceso.Pregunta); } } } } }