private void MuestraParametrosPosicion() { uint posicionPulsada = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); if (!PermisoSegunPerfil) { BtAceptar.Enabled = TBoxLiteral.Enabled = DListPrioridadSIP.Enabled = DListPrioridadTecla.Enabled = false; } if (posicionPulsada <= 0) { return; } if (prefijosPosiciones[posicionPulsada] == PREFIJO_DESTINO_LCE || prefijosPosiciones[posicionPulsada] == PREFIJO_DESTINO_ATS || prefijosPosiciones[posicionPulsada] == PREFIJO_DESTINO_ATS_BIS) //línea caliente externa=1 ó ATS=3 { ServiciosCD40.DestinosExternosSector t = new ServiciosCD40.DestinosExternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdSector = (string)Session["NombreSector"]; t.IdPrefijo = prefijosPosiciones[posicionPulsada]; t.PosHMI = posicionPulsada; t.TipoAcceso = "IA"; try { DataSet ds = ServicioCD40.DataSetSelectSQL(t); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dExterno = ds.Tables[0].Rows[0]; TBoxLiteral.Text = (string)dExterno["Literal"]; // DListPrioridadSIP.SelectedIndex = (int)((uint)dExterno["PrioridadSIP"] - 1); DListPrioridadSIP.SelectedValue = Convert.ToString(((uint)dExterno["PrioridadSIP"])); DListPrioridadTecla.SelectedIndex = (int)((uint)dExterno["Prioridad"] - 1); PrioridadTecla = (int)((uint)dExterno["Prioridad"]); ViewState["IdDestino"] = (string)dExterno["IdDestino"]; ViewState["IdPrefijo"] = prefijosPosiciones[posicionPulsada].ToString(); if (prefijosPosiciones[posicionPulsada] == PREFIJO_DESTINO_ATS || prefijosPosiciones[posicionPulsada] == PREFIJO_DESTINO_ATS_BIS) { //Si es un destino ATS DListDestinosLCEN.Visible = true; LbDestinoLCEN.Visible = true; //Se carga la lista de Destinos LCEN libres en el sistema CargaDestinosLCEN_Libres(); //Obtenemos si es un Destino ATS con un numero de abonado dentro de un encaminamieno IP bEsDestinoATS_IP = ServicioCD40.DestinoATS_ConCentralIP((string)Session["idsistema"], (string)ViewState["IdDestino"]); if (null != dExterno["IdDestinoLCEN"]) { string strDestinoLCEN = dExterno["IdDestinoLCEN"].ToString(); if (!string.IsNullOrEmpty(strDestinoLCEN)) { if (DListDestinosLCEN.Items.FindByText(strDestinoLCEN) != null) { DListDestinosLCEN.Items.FindByText(strDestinoLCEN).Selected = true; } else { //Se añade el destino que tiene actualmente asignado, porque no estará en la lista DListDestinosLCEN.Items.Add(strDestinoLCEN); DListDestinosLCEN.Items.FindByText(strDestinoLCEN).Selected = true; } } } else { //Se selecciona el primer elemento que corresponde a "Ningún Destino Seleccionado" DListDestinosLCEN.SelectedIndex = 0; } } else { //Si es no es un destino ATS if (DListDestinosLCEN.Items.Count > 0) { DListDestinosLCEN.Items.Clear(); } DListDestinosLCEN.Visible = false; LbDestinoLCEN.Visible = false; } } } catch (Exception ex) { logDebugView.Error("(TFTTelefonia-MuestraParametrosPosicion): ", ex); } } else //línea caliente interna { if (DListDestinosLCEN.Items.Count > 0) { DListDestinosLCEN.Items.Clear(); } DListDestinosLCEN.Visible = false; LbDestinoLCEN.Visible = false; ServiciosCD40.DestinosInternosSector t = new ServiciosCD40.DestinosInternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdSector = (string)Session["NombreSector"]; t.IdPrefijo = PREFIJO_DESTINO_LCI; t.PosHMI = posicionPulsada; try { DataSet ds = ServicioCD40.DataSetSelectSQL(t); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dInterno = ds.Tables[0].Rows[0]; TBoxLiteral.Text = (string)dInterno["Literal"]; //DListPrioridadSIP.SelectedIndex = (int)((uint)dInterno["PrioridadSIP"] - 1); DListPrioridadSIP.SelectedValue = Convert.ToString(((uint)dInterno["PrioridadSIP"])); DListPrioridadTecla.SelectedIndex = (int)((uint)dInterno["Prioridad"] - 1); PrioridadTecla = (int)((uint)dInterno["Prioridad"]); ViewState["IdDestino"] = (string)dInterno["IdDestino"]; ViewState["IdPrefijo"] = prefijosPosiciones[posicionPulsada].ToString(); } } catch (Exception ex) { logDebugView.Error("(TFTTelefonia-MuestraParametrosPosicion): ", ex); } } }
private void GuardarNuevaPosicionEnBD(string idDest, string literal, uint idPref, uint prioridad, uint prioSip, string idDestinoLCEN) { if (Session["idsistema"] != null && Session["NombreSector"] != null && Session["idnucleo"] != null) { try { if (idPref == PREFIJO_DESTINO_LCE || idPref == PREFIJO_DESTINO_ATS || idPref == PREFIJO_DESTINO_ATS_BIS) //telefonia externa LC (prefijo=1) o Destino ATS(prefijo=3) { ServiciosCD40.DestinosExternosSector t = new ServiciosCD40.DestinosExternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdSector = (string)Session["NombreSector"]; t.OrigenR2 = (string)Session["NombreSector"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdDestino = idDest; t.PosHMI = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); t.IdPrefijo = idPref; t.TipoDestino = 1; t.Literal = literal; t.Prioridad = prioridad; t.PrioridadSIP = prioSip; t.TipoAcceso = "IA"; if (!string.IsNullOrEmpty(idDestinoLCEN)) { //Se ha asignado un recurso LCEN al Destino ATS t.IdPrefijoDestinoLCEN = PREFIJO_DESTINO_LCE; t.IdDestinoLCEN = idDestinoLCEN; } else { t.IdPrefijoDestinoLCEN = null; t.IdDestinoLCEN = null; } if (!Modificando && ServicioCD40.InsertSQL(t) < 0) { logDebugView.Warn("(TFTLC-GuardarNuevaPosicionEnBD): No se ha guardado la posicion de telefonia externa"); } else if (!Modificando) { #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.AltaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI + 56, t.Literal, t.IdDestino, 2, t.OrigenR2, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } if (Modificando && ServicioCD40.UpdateSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en update de telefonia externa"); } else if (Modificando) { #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.ModificaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI + 56, t.Literal, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } } else if (idPref == PREFIJO_DESTINO_LCI) //telefonia interna { ServiciosCD40.DestinosInternosSector t = new ServiciosCD40.DestinosInternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdSector = (string)Session["NombreSector"]; t.OrigenR2 = (string)Session["NombreSector"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdDestino = idDest; t.PosHMI = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); t.IdPrefijo = idPref; t.TipoDestino = 2; t.Literal = literal; t.Prioridad = prioridad; t.PrioridadSIP = prioSip; t.TipoAcceso = "IA"; if (!Modificando) { ServiciosCD40.DestinosInternosSector d = t; if (ServicioCD40.InsertaColateralEnUsuarioReciproco(ref d, (int)NumPosicionesPag)) { if (ServicioCD40.InsertSQL(t) < 0) { ServicioCD40.EliminaColateralEnUsuarioReciproco(ref d); logDebugView.Warn("(TFTLC-GuardarNuevaPosicionEnBD): No se ha guardado la posicion de telefonia interna"); return; } #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(); sincro.AltaColateralTelefonia(d.IdNucleo, d.IdSector, d.PosHMI + 56, d.Literal, d.IdDestino, 7, d.OrigenR2, d.Prioridad); } #endregion #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.AltaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI + 56, t.Literal, t.IdDestino, 7, t.OrigenR2, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } else { cMsg.alert((string)GetGlobalResourceObject("Espaniol", "PanelLcCompleto")); } return; } else { ServiciosCD40.DestinosInternosSector d = t; if (ServicioCD40.UpdateSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en update de telefonia externa"); } else { if (ServicioCD40.EliminaColateralEnUsuarioReciproco(ref d)) { d = t; if (ServicioCD40.InsertaColateralEnUsuarioReciproco(ref d, (int)NumPosicionesPag)) { #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(); sincro.AltaColateralTelefonia(d.IdNucleo, d.IdSector, d.PosHMI + 56, d.Literal, d.IdDestino, 7, d.OrigenR2, d.Prioridad); } #endregion #region Sincronizar CD30 if ((sincronizar != null) && (Int32.Parse(sincronizar.Value) == 1)) { SincronizaCD30.SincronizaCD30 sincro = new SincronizaCD30.SincronizaCD30(); switch (sincro.ModificaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI + 56, t.Literal, t.Prioridad)) { 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("(TFTLC-GuardarNuevaPosicionEnBD): ", ex); } } }
private void DesasignarDestino(string id) { try { Button ibut = (Button)TEnlacesLC.FindControl(id); if (ibut != null && ibut.CssClass == "BtnPanelTfAsignado") { uint prefijo = prefijosPosiciones[Int16.Parse(id.Replace("Button", ""))]; if (prefijo == PREFIJO_DESTINO_LCI && datosLCint != null) // LCI { for (int i = 0; i < datosLCint.Length; i++) { if ((((ServiciosCD40.DestinosInternosSector)datosLCint[i]).Literal == ibut.Text) && ((ServiciosCD40.DestinosInternosSector)datosLCint[i]).PosHMI == Int16.Parse(id.Replace("Button", ""))) { ServicioCD40.DeleteSQL(datosLCint[i]); ServiciosCD40.DestinosInternosSector s = new ServiciosCD40.DestinosInternosSector(); s = (ServiciosCD40.DestinosInternosSector)datosLCint[i]; ServicioCD40.EliminaColateralEnUsuarioReciproco(ref s); #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.BajaColateralTelefonia(((ServiciosCD40.DestinosInternosSector)datosLCint[i]).IdNucleo, ((ServiciosCD40.DestinosInternosSector)datosLCint[i]).IdSector, ((ServiciosCD40.DestinosInternosSector)datosLCint[i]).PosHMI + 56)) { case 127: sincro.BajaColateralTelefonia(s.IdNucleo, s.IdSector, s.PosHMI + 56); cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion break; } } } else if ((prefijo == PREFIJO_DESTINO_LCE || prefijo == PREFIJO_DESTINO_ATS || prefijo == PREFIJO_DESTINO_ATS_BIS) && datosLCext != null) // LCE=1 o ATS=3 { for (int i = 0; i < datosLCext.Length; i++) { if ((((ServiciosCD40.DestinosExternosSector)datosLCext[i]).Literal == ibut.Text) && ((ServiciosCD40.DestinosExternosSector)datosLCext[i]).PosHMI == Int16.Parse(id.Replace("Button", ""))) { ServicioCD40.DeleteSQL(datosLCext[i]); #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.BajaColateralTelefonia(((ServiciosCD40.DestinosExternosSector)datosLCext[i]).IdNucleo, ((ServiciosCD40.DestinosExternosSector)datosLCext[i]).IdSector, ((ServiciosCD40.DestinosExternosSector)datosLCext[i]).PosHMI + 56)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion break; } } } } } catch (Exception ex) { logDebugView.Error("(TFTLC-DesasignarDestino): ", ex); } }
private void MuestraParametrosPosicion() { UInt16 buttonIndex = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); uint posicionPulsada = CalculatePosHmi(buttonIndex); if (posicionPulsada <= 0) { return; } //20201007 #4576 TBoxLiteral.Enabled = false; if (!PermisoSegunPerfil) { BtAceptar.Enabled = DListPrioridadSIP.Enabled = DListPrioridadTecla.Enabled = false; } if (prefijosPosiciones[posicionPulsada] > 2) //telefonia externa { ServiciosCD40.DestinosExternosSector t = new ServiciosCD40.DestinosExternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdSector = (string)Session["NombreSector"]; t.IdPrefijo = prefijosPosiciones[posicionPulsada]; t.PosHMI = CalculatePosHmi(buttonIndex); t.TipoAcceso = "DA"; try { DataSet ds = ServicioCD40.DataSetSelectSQL(t); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dExterno = ds.Tables[0].Rows[0]; TBoxLiteral.Text = (string)dExterno["Literal"]; //DListPrioridadSIP.SelectedIndex = (int)((uint)dExterno["PrioridadSIP"] - 1); DListPrioridadSIP.SelectedValue = Convert.ToString(((uint)dExterno["PrioridadSIP"])); DListPrioridadTecla.SelectedIndex = (int)((uint)dExterno["Prioridad"] - 1); ViewState["IdDestino"] = (string)dExterno["IdDestino"]; ViewState["IdPrefijo"] = prefijosPosiciones[posicionPulsada].ToString(); } } catch (Exception ex) { logDebugView.Error("(TFTTelefonia-MuestraParametrosPosicion): ", ex); } } else if (prefijosPosiciones[posicionPulsada] == 2) //telefonia interna { ServiciosCD40.DestinosInternosSector t = new ServiciosCD40.DestinosInternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdSector = (string)Session["NombreSector"]; t.IdPrefijo = 2; t.PosHMI = CalculatePosHmi(buttonIndex); t.TipoAcceso = "DA"; try { DataSet ds = ServicioCD40.DataSetSelectSQL(t); if (ds.Tables[0].Rows.Count > 0) { DataRow dInterno = ds.Tables[0].Rows[0]; TBoxLiteral.Text = (string)dInterno["Literal"]; //DListPrioridadSIP.SelectedIndex = (int)((uint)dInterno["PrioridadSIP"] - 1); DListPrioridadSIP.SelectedValue = Convert.ToString(((uint)dInterno["PrioridadSIP"])); DListPrioridadTecla.SelectedIndex = (int)((uint)dInterno["Prioridad"] - 1); ViewState["IdDestino"] = (string)dInterno["IdDestino"]; ViewState["IdPrefijo"] = prefijosPosiciones[posicionPulsada].ToString(); } } catch (Exception ex) { logDebugView.Error("(TFTTelefonia-MuestraParametrosPosicion): ", ex); } } }
private void GuardarNuevaPosicionEnBD(string idDest, string literal, uint idPref, uint prioridad, uint prioSip) { if (Session["idsistema"] != null && Session["NombreSector"] != null && Session["idnucleo"] != null) { try { UInt16 buttonIndex = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); uint posHmi = CalculatePosHmi(buttonIndex); // TextBox tbox = (TextBox)TEnlacesInternos.FindControl("TextBox" + ((string)ViewState["IdBoton"]).Replace("Button", "")); if (idPref > 2)//telefonia externa { ServiciosCD40.DestinosExternosSector t = new ServiciosCD40.DestinosExternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdSector = (string)Session["NombreSector"]; t.OrigenR2 = (string)Session["NombreSector"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdDestino = idDest; t.PosHMI = posHmi; t.IdPrefijo = idPref; t.TipoDestino = 1; t.Literal = literal; t.Prioridad = prioridad; t.PrioridadSIP = prioSip; t.TipoAcceso = "DA"; if (!Modificando && ServicioCD40.InsertSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en insert de telefonia externa"); } else if (!Modificando) { #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.AltaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.IdDestino, t.IdPrefijo, t.OrigenR2, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } if (Modificando && ServicioCD40.UpdateSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en update de telefonia externa"); } else if (Modificando) { #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.ModificaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } } else if (idPref == 2) //telefonia interna { ServiciosCD40.DestinosInternosSector t = new ServiciosCD40.DestinosInternosSector(); t.IdSistema = (string)Session["idsistema"]; t.IdSector = (string)Session["NombreSector"]; t.OrigenR2 = (string)Session["NombreSector"]; t.IdNucleo = (string)Session["idnucleo"]; t.IdDestino = idDest; t.PosHMI = posHmi; t.IdPrefijo = idPref; t.TipoDestino = 2; t.Literal = literal; t.Prioridad = prioridad; t.PrioridadSIP = prioSip; t.TipoAcceso = "DA"; if (!Modificando && ServicioCD40.InsertSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en insert de telefonia interna"); } else if (!Modificando) { #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.AltaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.IdDestino, 1, t.OrigenR2, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } if (Modificando && ServicioCD40.UpdateSQL(t) < 0) { logDebugView.Warn("(TFTTelefonia-GuardarNuevaPosicionEnBD): fallo en update de telefonia interna"); } else if (Modificando) { #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.ModificaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.Prioridad)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } if (!Modificando) { // Dar de baja el colatarel en el usuario recíproco if (ServicioCD40.InsertaColateralEnUsuarioReciproco(ref t, (int)NumPosicionesPag)) { #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.AltaColateralTelefonia(t.IdNucleo, t.IdSector, t.PosHMI, t.Literal, t.IdDestino, 1, t.OrigenR2, t.Prioridad)) { 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("(TFTTelefonia-GuardarNuevaPosicionEnBD): ", ex); } } }
private void DesasignarDestino(string id) { try { Button ibut = (Button)TEnlacesInternos.FindControl(id); // TextBox tbox = (TextBox)TEnlacesInternos.FindControl("TextBox" + id.Replace("Button", "")); // if (ibut != null && ibut.ImageUrl == "~/Configuracion/Images/BotonEnlaceInternoAs.jpg") if (ibut != null && ibut.CssClass == "BtnPanelTfAsignado") { UInt16 buttonIndex = UInt16.Parse(((string)ViewState["IdBoton"]).Replace("Button", "")); uint recalcPosHMI = CalculatePosHmi(buttonIndex); uint prefijo = prefijosPosiciones[recalcPosHMI]; if (prefijo == 2) { for (int i = 0; i < datosInternos.Length; i++) { if ((((ServiciosCD40.DestinosInternosSector)datosInternos[i]).Literal == ibut.Text) && ((ServiciosCD40.DestinosInternosSector)datosInternos[i]).PosHMI == recalcPosHMI) { if (ServicioCD40.DeleteSQL(datosInternos[i]) < 0) { logDebugView.Warn("(TFTTelefonia-DesasignarDestino): Fallo en el delete enlace interno"); } else { ServiciosCD40.DestinosInternosSector s = new ServiciosCD40.DestinosInternosSector(); s = (ServiciosCD40.DestinosInternosSector)datosInternos[i]; ServicioCD40.EliminaColateralEnUsuarioReciproco(ref s); #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.BajaColateralTelefonia(((ServiciosCD40.DestinosInternosSector)datosInternos[i]).IdNucleo, ((ServiciosCD40.DestinosInternosSector)datosInternos[i]).IdSector, ((ServiciosCD40.DestinosInternosSector)datosInternos[i]).PosHMI)) { case 127: sincro.BajaColateralTelefonia(s.IdNucleo, s.IdSector, s.PosHMI); cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } break; } } } else if (prefijo > 2) { for (int i = 0; i < datosExternos.Length; i++) { if ((((ServiciosCD40.DestinosExternosSector)datosExternos[i]).Literal == ibut.Text) && ((ServiciosCD40.DestinosExternosSector)datosExternos[i]).PosHMI == recalcPosHMI) { if (ServicioCD40.DeleteSQL(datosExternos[i]) < 0) { logDebugView.Warn("(TFTTelefonia-DesasignarDestino): Fallo en el delete enlace externo"); } 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.BajaColateralTelefonia(((ServiciosCD40.DestinosExternosSector)datosExternos[i]).IdNucleo, ((ServiciosCD40.DestinosExternosSector)datosExternos[i]).IdSector, ((ServiciosCD40.DestinosExternosSector)datosExternos[i]).PosHMI)) { case 127: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod127")); break; case 128: cMsg.alert((string)GetGlobalResourceObject("Espaniol", "Cod128")); break; default: break; } } #endregion } break; } } } } } catch (Exception ex) { logDebugView.Error("(TFTTelefonia-DesasignarDestino): ", ex); } }