private void MostrarRadio() { try { uint posini = ((numPagActual - 1) * NumPosicionesPag) + 1; uint posfin = posini + NumPosicionesPag - 1; if (datosRadio != null) { for (int i = 0; i < datosRadio.Length; i++) { uint pos = ((ServiciosCD40.DestinosRadioSector)datosRadio[i]).PosHMI; if ((pos >= posini) && (pos <= posfin)) { uint posenpanel = CalculatePosButton(pos); Button ibut = (Button)TEnlacesRadio.FindControl("Button" + posenpanel.ToString()); TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + posenpanel.ToString()); //ibut.ImageUrl = "~/Configuracion/Images/BotonEnlaceExternoAs.jpg"; ibut.CssClass = "BtnPanelRadioAsignado"; //En el tooltip del botón se muestra el identificador del destino y en el texto el literal ibut.ToolTip = ((ServiciosCD40.DestinosRadioSector)datosRadio[i]).IdDestino; tbox.Text = ((ServiciosCD40.DestinosRadioSector)datosRadio[i]).Literal; tbox.ToolTip = ((ServiciosCD40.DestinosRadioSector)datosRadio[i]).IdDestino; } } } } catch (Exception ex) { logDebugView.Error("(TFTRadio-MostrarRadio): ", ex); } }
private void DesasignarDestino(string id) { try { Button ibut = (Button)TEnlacesRadio.FindControl(id); TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + id.Replace("Button", "")); if (ibut != null && ibut.CssClass == "BtnPanelRadioAsignado") { uint posicion = CalculatePosHmi(UInt16.Parse(id.Replace("Button", ""))); ServiciosCD40.DestinosRadioSector elemento = (ServiciosCD40.DestinosRadioSector) Array.Find(datosRadio, delegate(object d) { return(((ServiciosCD40.DestinosRadioSector)d).PosHMI == posicion); }); if (elemento != null) { if (ServicioCD40.DeleteSQL(elemento) < 0) { logDebugView.Warn("(TFTRadio-DesasignarDestino): No se ha podido desasignar el destino"); } else { #region Sincronizar CD30 Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); KeyValueConfigurationElement sincronizar = config.AppSettings.Settings["SincronizaCD30"]; if ((sincronizar != null) && (Int32.Parse(sincronizar.Value) == 1)) { SincronizaCD30.SincronizaCD30 sincro = new SincronizaCD30.SincronizaCD30(); switch (sincro.BajaColateralRadio(elemento.IdNucleo, elemento.PosHMI, elemento.IdSector)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } } } } catch (Exception ex) { logDebugView.Error("(TFTRadio-DesasignarDestino): ", ex); } }
protected void CeldaEnlaceRadio_OnClick(object sender, EventArgs e) { Button ibut = (Button)TEnlacesRadio.FindControl(((Button)sender).ID); TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + ibut.ID.Replace("Button", "")); //if (ibut.ImageUrl == "~/Configuracion/Images/BotonEnlaceExterno.jpg") if (ibut.CssClass == "BtnPanelRadioLibre") { BtLiberar.Enabled = false; BModificar.Enabled = false; //El botón Asignar sólo debe estar habilitado si el botón del panel está libre y //se ha seleccionado algún destino de la lista if (LBoxDestinos.SelectedIndex >= 0) { BtAsignar.Enabled = PermisoSegunPerfil; ViewState["IdDestino"] = LBoxDestinos.SelectedItem.Text; } else { BtAsignar.Enabled = false; } } else { BtLiberar.Enabled = PermisoSegunPerfil; BModificar.Enabled = true; BtAsignar.Enabled = false; } //if (BtAsignar.Enabled || BtLiberar.Enabled) if (tbox.Text != "" || PermisoSegunPerfil) { ViewState["IdBoton"] = ((Button)sender).ID; TEnlacesRadio.Enabled = false; LBoxDestinos.Enabled = false; BtLC.Enabled = false; BtTelefonia.Enabled = false; IButPagAbajo.Enabled = false; IButPagArriba.Enabled = false; BtSector.Enabled = false; Panel1.Visible = true; } else if (!PermisoSegunPerfil) { PanelNoPermissions.Visible = true; } }
private void AsignarDestino(string id) { Button ibut = (Button)TEnlacesRadio.FindControl(id); //if (ibut.ImageUrl == "~/Configuracion/Images/BotonEnlaceExternoAs.jpg") if (ibut.CssClass != "BtnPanelRadioAsignado") { DesasignarDestino(id); } uint posicion = CalculatePosHmi(UInt16.Parse(id.Replace("Button", ""))); ServiciosCD40.DestinosRadioSector elemento = (ServiciosCD40.DestinosRadioSector) Array.Find(datosRadio, delegate(object d) { return(((ServiciosCD40.DestinosRadioSector)d).PosHMI == posicion); }); if (elemento != null) { TBoxLiteral.Text = elemento.Literal; TBoxDestino.Text = elemento.IdDestino; } else { TBoxLiteral.Text = (string)ViewState["IdDestino"]; TBoxDestino.Text = (string)ViewState["IdDestino"]; } DListPrioridadSIP.SelectedIndex = 0; //TBoxLiteral.Text = id; Panel2.Visible = true; MostrarElementosPanel(TBoxLiteral.Text); CargaRecursos(elemento != null ? elemento.IdDestino : (string)ViewState["IdDestino"]); //MVO-20170710: Se oculta la tabla de recursos y se mantienen los valores por defecto. Todos los recursos marcados // Por defecto, todos los recursos quedan seleccionados //if (GViewEstado.Visible && GViewEstado.Rows.Count > 0) if (GViewEstado.Rows.Count > 0) { foreach (GridViewRow row in GViewEstado.Rows) { ((CheckBox)row.Cells[0].FindControl("DListEstados")).Checked = true; } } }
protected void BtModificar_Click(object sender, EventArgs e) { EsconderPanelOpciones(); Modificando = true; string id = (string)ViewState["IdBoton"]; TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + id.Replace("Button", "")); uint posicion = CalculatePosHmi(UInt16.Parse(id.Replace("Button", ""))); ServiciosCD40.DestinosRadioSector elemento = (ServiciosCD40.DestinosRadioSector) Array.Find(datosRadio, delegate(object d) { return(((ServiciosCD40.DestinosRadioSector)d).PosHMI == posicion); }); //ServiciosCD40.DestinosRadioSector elemento = (ServiciosCD40.DestinosRadioSector)Array.Find(datosRadio, // delegate(object d) { return ((ServiciosCD40.DestinosRadioSector)d).PosHMI == Convert.ToUInt32(id.Replace("Button", "")); }); if (elemento != null) { MuestraOpcionesFrecuencia(tbox.Text, elemento.IdDestino); } }
private void LimpiarPanel() { int visibleCount = 0; for (int i = 1; i <= NumFilasVisibles * NUM_COLUMNAS_FIJAS; i++) { TableCell tCell = (TableCell)TEnlacesRadio.FindControl("TableCell" + i.ToString()); if (tCell != null) { int fila = (i - 1) / (int)NUM_COLUMNAS_FIJAS; //0..NUM_COLUMNAS_FIJAS int columna = (i - 1) % (int)NUM_COLUMNAS_FIJAS; //0..NUM_COLUMNAS_FIJAS if ((fila <= NumFilasVisibles) && (columna < NumColumnasVisibles)) { tCell.Visible = true; if (++visibleCount <= NumPosicionesPag) { tCell.Enabled = true; } else { tCell.Enabled = false; // JOI: #4487 tCell.Visible = false; } } else { tCell.Visible = false; } Button ibut = (Button)TEnlacesRadio.FindControl("Button" + i.ToString()); TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + i.ToString()); //ibut.ImageUrl = "~/Configuracion/Images/BotonEnlaceExterno.jpg"; ibut.CssClass = "BtnPanelRadioLibre"; tbox.Text = ""; ibut.ToolTip = String.Empty; tbox.ToolTip = String.Empty; } } }
private void GuardarNuevaPosicionEnBD(string idDest, string literal, uint prioridad, uint prioSip, string cascos, string modo, bool supervisarPortadora) { if (Session["idsistema"] != null && Session["NombreSector"] != null && Session["idnucleo"] != null) { try { TextBox tbox = (TextBox)TEnlacesRadio.FindControl("TextBox" + ((string)ViewState["IdBoton"]).Replace("Button", "")); if (tbox != null) { ServiciosCD40.DestinosRadioSector t = new ServiciosCD40.DestinosRadioSector(); t.IdSistema = (string)Session["idsistema"]; t.IdSector = (string)Session["NombreSector"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdDestino = idDest; t.PosHMI = CalculatePosHmi(UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", ""))); t.TipoDestino = 0; t.Literal = literal; t.Prioridad = prioridad; t.PrioridadSIP = prioSip; t.Cascos = cascos; t.ModoOperacion = modo; t.SupervisionPortadora = supervisarPortadora; if (ServicioCD40.InsertSQL(t) < 0) { logDebugView.Warn("(TFTRadio-GuardarNuevaPosicionEnBD): No se ha podido guardar la posicion."); } //for (int i = 1; i < 8; i++) //{ // ServiciosCD40.Altavoces alt = new ServiciosCD40.Altavoces(); // alt.IdSistema = t.IdSistema; // alt.IdSector = t.IdSector; // alt.IdNucleo = t.IdNucleo; // alt.IdDestino = t.IdDestino; // alt.PosHMI = t.PosHMI; // alt.TipoDestino = t.TipoDestino; // alt.NumAltavoz = (uint)i; // alt.Estado = ((DropDownList)Table1.FindControl("DropDownList" + i.ToString())).SelectedValue; // if (ServicioCD40.InsertSQL(alt) < 0) logDebugView.Warn("(TFTRadio-GuardarNuevaPosicionEnBD): No se ha podido guardar el altavoz de la posicion."); //} #region Sincronizar CD30 Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); KeyValueConfigurationElement sincronizar = config.AppSettings.Settings["SincronizaCD30"]; if ((sincronizar != null) && (Int32.Parse(sincronizar.Value) == 1)) { // Obtener el emplazamiento del recurso asignado al destino ServiciosCD40.RecursosRadio rRadio = new ServiciosCD40.RecursosRadio(); rRadio.IdSistema = (string)Session["idsistema"]; rRadio.IdDestino = t.IdDestino; ServiciosCD40.Tablas[] listaRecursos = ServicioCD40.ListSelectSQL(rRadio); if (listaRecursos != null && listaRecursos.Length > 0) { SincronizaCD30.SincronizaCD30 sincro = new SincronizaCD30.SincronizaCD30(); switch (sincro.AltaColateralRadio(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.IdDestino, ((ServiciosCD40.RecursosRadio)listaRecursos[0]).IdEmplazamiento)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } } #endregion } } catch (Exception ex) { logDebugView.Error("(TFTRadio-GuardarNuevaPosicionEnBD): ", ex); } } }