private void SubirBajar_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { string Panel; int moduloId; int Pasos; if (((ImageButton)sender).CommandName == "arriba") { Pasos = -3; if (((ImageButton)sender).CommandArgument == "panelIzquierdo") { moduloId = Int32.Parse(panelIzquierdo.SelectedItem.Value); Panel = "Izquierda"; } else if (((ImageButton)sender).CommandArgument == "panelCentral") { moduloId = Int32.Parse(panelCentral.SelectedItem.Value); Panel = "Centro"; } else { moduloId = Int32.Parse(panelDerecho.SelectedItem.Value); Panel = "Derecha"; } } else { Pasos = 3; if (((ImageButton)sender).CommandArgument == "panelIzquierdo") { moduloId = Int32.Parse(panelIzquierdo.SelectedItem.Value); Panel = "Izquierda"; } else if (((ImageButton)sender).CommandArgument == "panelCentral") { moduloId = Int32.Parse(panelCentral.SelectedItem.Value); Panel = "Centro"; } else { moduloId = Int32.Parse(panelDerecho.SelectedItem.Value); Panel = "Derecha"; } } IDataReader dr = ModulosBD.Obtener(moduloId); dr.Read(); Pasos += (int)dr["ModuloOrden"]; dr.Close(); ModulosBD.ActualizaOrden(moduloId, Pasos, Panel); PaginasBD.ActualizaOrdenModulos(pagId); EnlazarDatos(); }
private void MoverModulo_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { string Panel; int moduloId; if (((ImageButton)sender).CommandName == "izquierda") { if (((ImageButton)sender).CommandArgument == "panelCentral") { Panel = "Izquierda"; moduloId = Int32.Parse(panelCentral.SelectedItem.Value); } else { Panel = "Centro"; moduloId = Int32.Parse(panelDerecho.SelectedItem.Value); } } else { if (((ImageButton)sender).CommandArgument == "panelCentral") { Panel = "Derecha"; moduloId = Int32.Parse(panelCentral.SelectedItem.Value); } else { Panel = "Centro"; moduloId = Int32.Parse(panelIzquierdo.SelectedItem.Value); } } ModulosBD.ActualizaOrden(moduloId, -1, Panel); PaginasBD.ActualizaOrdenModulos(pagId); EnlazarDatos(); }