public static string actualizaReplicaFormatoCompra(int cveOT, int cveProg, DateTime fecha, int cveNvoFmto) { bool isUpdated = false; THE_FormatoCompraIpad[] result; WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); try { /*Se obtiene el tipo de Formato asignado*/ result = client.ConsultarFormatoCompraOT(cveOT, cveProg, fecha); } catch (Exception) { return("No se encontrarón Formatos"); } if (result != null && result.Count() > 0) { try { result[0].CveFormato.CveFormato = cveNvoFmto; isUpdated = client.ActualizaReplicaFormatoCompra(result[0]); } catch (Exception) { return("Ocurrio un problema al Cambiar Formato"); } } else { return("No se encontrarón Formatos"); } return(isUpdated.ToString()); }
private void getScreenData() { Datos_PantallaOTIpad dataPantalla = null; WebService_FIATubeSoapClient client; StringBuilder initJS = new StringBuilder(); TransmisionProgramaIpad[] tdProg; try{ client = new WebService_FIATubeSoapClient(); if (Request.QueryString["CveOrdenTrabajo"].ToString() != "") { tdProg = client.GetProgramasTransmitir(Int32.Parse(Request.QueryString["CveOrdenTrabajo"].ToString()), Int32.Parse(Session["numUsuario"].ToString()), Int32.Parse(Request.QueryString["IdSeccion"].ToString())); if (tdProg != null) { initJS.Append(getJSArrayDatosPantalla("arrProgramasTransmitir", tdProg)); } client = new WebService_FIATubeSoapClient(); dataPantalla = client.ObtenerDatosPantallaOrdenTrabajo(Request.QueryString["CveOrdenTrabajo"].ToString()); if (dataPantalla != null) { initJS.Append(getJSArrayDatosPantalla("arrOTAgenda", dataPantalla.OTAgenda)); initJS.Append(getJSArrayDatosPantalla("arrOTEquipo", dataPantalla.OTEquipo)); initJS.Append(getJSArrayDatosPantalla("arrOTLogistica", dataPantalla.OTLogistica)); initJS.Append(getJSArrayDatosPantalla("arrOTOrdenTrab", dataPantalla.OTOrdenTrab)); string strEliminada = "arrEstaEliminada=" + dataPantalla.EstaEliminada.ToString().ToLower() + ";"; initJS.Append(strEliminada); ScriptManager.RegisterStartupScript(this, this.GetType(), "js", initJS.ToString(), true); } } } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnActualizar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnActualizar_Click(Object sender, EventArgs e) { WebService_FIATubeSoapClient client; THE_SolicitudFormatoIpad[] result = null; try { client = new WebService_FIATubeSoapClient(); //Validacion Agregada Por Alex Picon para filtrar las solicitudes en caso de ser de un EVDT if (hiddCveS.Value == String.Empty) { result = client.ConsultaSolicitudFormato(Convert.ToInt32(hiddProg.Value), Convert.ToInt32(hiddSecc.Value), Convert.ToDateTime(hiddFecI.Value), Convert.ToDateTime(hiddFecF.Value), int.Parse(hiddLocl.Value)); } else { result = client.ConsultaSolicitudFormato(0, 0, Convert.ToDateTime(hiddFecI.Value), Convert.ToDateTime(hiddFecF.Value), int.Parse(hiddLocl.Value)); } /*Se carga el grid de resultados*/ this.llenarSolicitudes(result); } catch (Exception ex) { this.logError(ex); } }
private void cargaProgramas() { try { StringBuilder cadena = new StringBuilder("<option value='0'>== TODOS ==</option>"); wsFiatube.TDI_Programa[] programas = null; wsFiatube.WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); programas = client.ConsultaProgramasFIA(); if (programas != null) { foreach (wsFiatube.TDI_Programa prog in programas) { cadena.Append("<option value='").Append(prog.CvePrograma).Append("'>").Append(prog.NombrePrograma).Append("</option>"); } } ScriptManager.RegisterStartupScript(this, this.GetType(), "js", " setProgData(\"" + cadena.ToString() + "\"); ", true); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "js", "alertModal('Ocurrio un problema al cargar los programas: " + ex.Message + "')", true); this.logError(ex); } }
public static bool updateRating(int cveOT, int rating) { try { WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); return(client.updateRatingOT(cveOT, rating)); } catch (Exception) { return(false); } }
private void cargaInfoEquipoTrabajo() { TDI_EMPL[] aux = null; StringBuilder initJS = new StringBuilder(); wsFiatube.TDI_Programa[] programas = null; StringBuilder cadena = new StringBuilder("<option value='0'>== TODOS ==</option>"); WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); try { if (int.Parse(Request.QueryString["locl"].ToString()) == 36) { /*Se obtiene la informacion del autocomplete de reporteros, camarografos y editores*/ aux = client.GetReporterosList(); initJS.Append(this.getJSArrayDeclaration("arrReporteros", aux)); aux = client.GetCamarografosList(); initJS.Append(this.getJSArrayDeclaration("arrCamarografos", aux)); aux = client.GetEditoresList(); initJS.Append(this.getJSArrayDeclaration("arrEditores", aux)); } else { wsFiatube.PantallaOT data = client.ObtieneDatosEquiporlocal(int.Parse(Request.QueryString["locl"].ToString())); /*Se obtiene la informacion del autocomplete de reporteros, camarografos y editores*/ initJS.Append(this.getJSArrayDeclaration("arrReporteros", data.listaReporteros)); initJS.Append(this.getJSArrayDeclaration("arrCamarografos", data.listaCamarografos)); initJS.Append(this.getJSArrayDeclaration("arrEditores", data.listaEditores)); } programas = client.ConsultaProgramasFIA(); if (programas != null) { foreach (wsFiatube.TDI_Programa prog in programas) { cadena.Append("<option data-ff='").Append(this.SerializeObjectIntoJson(prog.FechaFin).Replace("\"", "")).Append("' data-fi='").Append(this.SerializeObjectIntoJson(prog.FechaInicio).Replace("\"", "")).Append("' value='").Append(prog.CvePrograma).Append("'>").Append(prog.NombrePrograma).Append("</option>"); } } ScriptManager.RegisterStartupScript(this, this.GetType(), "js", initJS.ToString() + " setProgData(\"" + cadena.ToString() + "\"); ", true); } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnActualizar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnActualizar_Click(Object sender, EventArgs e) { int tiempoMuestra = Convert.ToInt32(hiddHrs.Value); //Validar en donde se cambia ese valor RptCables[] result = null; WebService_FIATubeSoapClient client; try { /*Se actualiza grid de reporte de cables*/ client = new WebService_FIATubeSoapClient(); result = client.ObtenerReporteCablesSecc(DateTime.Now, tiempoMuestra, Convert.ToInt32(hiddSec.Value)); this.llenaGridCables(result); } catch(Exception ex){ this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnUpdateEquipo control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnUpdateEquipo_Click(Object sender, EventArgs e) { StringBuilder initJS = new StringBuilder(); wsFiatube.PantallaOT resultado = null; wsFiatube.WebService_FIATubeSoapClient client = null; try { /*Se obtiene la informacion del equipo de trabajo*/ client = new WebService_FIATubeSoapClient(); /*Si la local es diferente a ajusco se obtien los empleados de la local correspondiente*/ if (int.Parse(HiddcboLocales.Value) != 36) { resultado = client.ObtieneDatosEquiporlocal(int.Parse(HiddcboLocales.Value)); } else { resultado = client.ObtieneDatosPantallaOT(Convert.ToInt32(Session["numUsuario"]), true, true); } /*se generan los arrays con la informacion de reporteros, camarografos y editores*/ if (resultado != null) { if (resultado.listaReporteros != null) { initJS.Append(getJSArrayDeclaration("arrReporteros", resultado.listaReporteros)); } if (resultado.listaCamarografos != null) { initJS.Append(getJSArrayDeclaration("arrCamarografos", resultado.listaCamarografos)); } if (resultado.listaEditores != null) { initJS.Append(getJSArrayDeclaration("arrEditores", resultado.listaEditores)); } } initJS.Append(" updateEquiposLocal(); "); ScriptManager.RegisterStartupScript(this, this.GetType(), "js", initJS.ToString(), true); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "js", " alertModal('Ocurrio un problema al obtener el equipo de trabajo de la local: " + ex.Message + "');", true); this.logError(ex); } }
//private void CargaListas() //{ // wsFiatube.WebService_FIATubeSoapClient objetoMetodo = new WebService_FIATubeSoapClient(); // THE_SolMatLocal objeto = new THE_SolMatLocal(); // THE_SolMatLocal[] lstSolMatLocal =objetoMetodo.ObtieneSolMatLocal(objeto); // THE_MaterialLocal objeto2 = new THE_MaterialLocal (); // THE_MaterialLocal[] lstMaterialLocal= objetoMetodo.ObtieneMaterialLocal(objeto2); // string matsol = SerializeObjectIntoJson(lstSolMatLocal); // string matloc = SerializeObjectIntoJson(lstMaterialLocal); // ScriptManager.RegisterStartupScript(this, this.GetType(), "js", "arrglMatSol=" + matsol + ";arrgMatLoc=" + matloc + ";", true); //} protected void updateTable_Click(object sender, EventArgs e) { wsFiatube.WebService_FIATubeSoapClient objetoMetodo = new WebService_FIATubeSoapClient(); THE_SolMatLocal objeto = new THE_SolMatLocal(); THE_SolMatLocal[] lstSolMatLocal = objetoMetodo.ObtieneSolMatLocal(objeto); THE_MaterialLocal objeto2 = new THE_MaterialLocal(); THE_MaterialLocal[] lstMaterialLocal = objetoMetodo.ObtieneMaterialLocal(objeto2); string matsol = SerializeObjectIntoJson(lstSolMatLocal); string matloc = SerializeObjectIntoJson(lstMaterialLocal); searchData(matsol, matloc); }
/// <summary> /// Handles the Click event of the btnUpdateEquipo control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private string updateEquipo() { StringBuilder result = new StringBuilder(); StringBuilder initJS = new StringBuilder(); wsFiatube.PantallaOT resultado = null; wsFiatube.WebService_FIATubeSoapClient client = null; try { /*Se obtiene la informacion del equipo de trabajo*/ client = new WebService_FIATubeSoapClient(); /*Si la local es diferente a ajusco se obtien los empleados de la local correspondiente*/ if (int.Parse(hiddLocalCv.Value) != 36) { resultado = client.ObtieneDatosEquiporlocal(int.Parse(hiddLocalCv.Value)); } else { resultado = client.ObtieneDatosPantallaOT(Convert.ToInt32(Session["numUsuario"]), true, true); } initJS.Append("<option value='0'>== SELECCIONE ==</option>"); /*se generan los arrays con la informacion de reporteros, camarografos y editores*/ if (resultado != null) { if (resultado.listaReporteros != null) { foreach (wsFiatube.TDI_EMPL item in resultado.listaReporteros) { initJS.Append("<option value='").Append(item.EmpleadoLlavePrimaria).Append("'>").Append(item.EmpleadoNombre).Append("</option>"); } } } result.Append(" $('#divGridAgenda').css('height', screen.height - 262); $('#cmbReportero').empty(); $('#cmbReportero').append(\"").Append(initJS.ToString()).Append("\"); setRating(); "); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "js", " alertModal('Ocurrio un problema al obtener el equipo de trabajo de la local: " + ex.Message + "');", true); this.logError(ex); } return(result.ToString()); }
public void btnBuscar_Click(Object sender, EventArgs e) { try{ WebService_FIATubeSoapClient client; StringBuilder initJS = new StringBuilder(); StringBuilder initJSDatosPantalla = new StringBuilder(); client = new WebService_FIATubeSoapClient(); BusquedaMultipleOTIpad[] data; data = client.ObtenerOdenTrabajoMultiple(Int32.Parse(hiddSecc.Value), DateTime.Parse(dpFechaBusq.Value), Convert.ToInt32(Session["numUsuario"])); if (data != null) { initJS.Append(getJSArrayDatosPantalla("arrOTS", data)); ScriptManager.RegisterStartupScript(this, this.GetType(), "js", initJS.ToString() + " btnBuscarClient_Click();", true); } } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Gets the info reporteros. /// </summary> private void getInfoReporteros(int loclId) { try { PantallaOT result; IList <TDI_EMPL> reporteros = null; StringBuilder script = new StringBuilder(@" availableReps = [ "); /*Se realiza la solicitud de reporteros al WS de FIATUBE*/ WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); result = client.ObtieneDatosEquiporlocal(loclId); if (result != null) { reporteros = result.listaReporteros; } /*Se recorre la lista y se genera el codigo JavaScript a ejecutar para asignar el valor a el autocomplete de reporteros*/ if (reporteros != null) { foreach (TDI_EMPL reportero in reporteros) { script.Append("{label:\"").Append(reportero.EmpleadoNombre.Trim().ToUpper()).Append("\", value:'").Append(reportero.EmpleadoLlavePrimaria.ToString()).Append("', icon:'").Append(reportero.EmpleadoNumero.ToString()).Append("'},"); } //script.Append("{label:\"").Append(reportero.EmpleadoNombre.Trim().ToUpper()).Append("\", value:").Append(reportero.EmpleadoLlavePrimaria).Append("},"); script.Remove(script.Length - 1, 1); } script.Append("]; "); /*Se registra el Script para que sea ejecutado por el cliente*/ ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "js", script.ToString() + " applyEvents(); ", true); myHidden.Value = script.ToString(); } catch (Exception ex) { logError(ex); } }
/// <summary> /// Gets the formats. /// </summary> private void getFormats() { TDI_Formato[] formatos = null; StringBuilder formatOptions = new StringBuilder(); try { WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); formatos = client.ConsultaFormatos(); if (formatos != null) { foreach (TDI_Formato formato in formatos) { formatOptions.Append("<option value='").Append(formato.CveFormato).Append("'>").Append(formato.Descripcion).Append("</option>"); } } ViewState["formats"] = formatOptions; } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnActualizar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnActualizar_Click(Object sender, EventArgs e) { AgendaOTPrograma[] result = null; WebService_FIATubeSoapClient client; string listFormats; StringBuilder consolidado = new StringBuilder(); /*Se verifica si se encuentran cargados ya los formatos si no se cargan*/ if (ViewState["formats"] == null || ViewState["formats"].ToString() == string.Empty) { this.getFormats(); } try { client = new WebService_FIATubeSoapClient(); result = client.ObtenAgendaPrograma_LOCALES(hiddProd.Value, hiddSecc.Value, hiddTitl.Value, string.Empty, hiddFech.Value, hiddFech.Value, 0, hiddLocl.Value); /*Se limpia el div de resultados*/ divContentResult.InnerHtml = string.Empty; divContentResult.InnerHtml += new StringBuilder(@"<div class='divttlAgenda'><label class=""openMdlAgDiaria"" data-fecha='").Append(Convert.ToDateTime(hiddFech.Value).ToString("dd/MM/yyyy")).Append("' ") .Append("data-secc='").Append(hiddSecc.Value).Append("' ") .Append("data-prog='").Append(hiddProd.Value).Append("' ") .Append(">").Append(Convert.ToDateTime(hiddFech.Value).ToString("dddd, dd").ToUpper()).Append("</label></div>"); divContentResult.InnerHtml += "<ul class='mySortable'>"; if (result != null) { foreach (AgendaOTPrograma item in result) { listFormats = ((StringBuilder)ViewState["formats"]).ToString(); consolidado.Append("<li class='divSeccAgendaDiariaProg ui-state-default'><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>"); consolidado.Append("<div class='divRegContent' data-item='").Append(JsonConvert.SerializeObject(item, Formatting.Indented)) .Append("'>"); //Contenedor del registro consolidado.Append("<img onerror='errorImg(this);' class='ImgSizeAgendaDiariaPrograma'alt='Imagen Video' src='").Append(item.VideoImg == null ? "../../Images/noimage.png" : item.VideoImg).Append("'").Append(item.VideoReferencia == null || item.VideoReferencia.Trim().Equals(String.Empty) ? string.Empty : @" onMouseOver=""this.style.cursor='pointer'"" onclick='imgVideo_click(this); return false;'") .Append(" data-numOT='").Append(item.CveOrdenTrabajo).Append("' ") .Append(" data-file='").Append(item.VideoReferencia == null ? string.Empty : item.VideoReferencia).Append("' ") .Append(" data-img='").Append(item.VideoImg == null ? string.Empty : item.VideoImg).Append("' />"); //Fin imagen video consolidado.Append("<label class='divSeccAgendaDiariaProgramaLG'>").Append(item.NombreSeccion).Append(" </label>"); consolidado.Append(@"<label class='divSeccAgendaDiariaPrograma' data-value='").Append(item.CveOrdenTrabajo).Append(@"' data-oCve='").Append(item.ClaveOT).Append(@"' onMouseOver=""this.style.cursor='pointer'"" onclick='showData_click(this);'> ").Append(item.ClaveOT).Append(" </label>"); consolidado.Append(@"<label class='divSeccAgendaDiariaProgramaLG' data-value='").Append(item.CveOrdenTrabajo).Append(@"' data-oCve='").Append(item.ClaveOT).Append(@"' onMouseOver=""this.style.cursor='pointer'"" onclick='showData_click(this);'> ").Append(item.TituloOT).Append(" </label>"); consolidado.Append("<select class='cmbSecciones varFloatLeft varMarginTop2' onchange='tipoNota_changed(this);'") .Append(" data-cveOT='").Append(item.CveOrdenTrabajo).Append("' ") .Append(" data-cvePr='").Append(item.CvePrograma).Append("' ") .Append(">").Append(listFormats.Insert(listFormats.IndexOf("value='" + item.CveFormato + "'") - 1, " selected='selected' ")).Append("</select>"); consolidado.Append(@"<label class='divSeccAgendaDiariaPrograma' onMouseOver=""this.style.cursor='pointer'"" onclick='abrirAvance(this); return false;' style='color:").Append(item.TieneAvance > 0 ? "#00FA9A" : "Red").Append(";' ") .Append(" data-type='O' data-numDat='").Append(item.CveOrdenTrabajo) .Append("' data-oCve='").Append(item.ClaveOT).Append("' data-titu='").Append(item.TituloOT).Append("'>Avances</label>"); consolidado.Append("<button type='button'class='btnReplicarAgendaDiariaPrograma' title='Replicar' onclick = 'btnReplicar_click(this);' data-seccion ='" + item.CveSeccion + "' data-id ='" + item.CveOrdenTrabajo + "'></button>"); consolidado.Append("<label >").Append((item.OrigenCalculadoQry != string.Empty) ? item.OrigenCalculadoQry : " ").Append("</label>"); consolidado.Append("<label class='divSeccAgendaDiariaPrograma' style='color:").Append(item.Guion ? "#00FA9A" : "Red").Append(";'>").Append(item.Guion ? "Guion" : "Sin Guion").Append("</label>"); consolidado.Append("<button type='button'class='btniNewsAgendaDiariaPrograma2' onclick='sendiNewsRep(this);' title='Enviar a iNEWs carpeta reportero'") .Append(" data-clvOt='").Append(item.ClaveOT).Append("' ") .Append(" data-cveOt='").Append(item.CveOrdenTrabajo).Append("' ") .Append(" data-cvePrg='").Append(item.CvePrograma).Append("' ") .Append(" data-nomPrg='").Append(item.NombrePrograma).Append("' ") .Append(" data-dur='").Append(item.DuracionFormato).Append("' ") .Append(" data-fecha='").Append(item.FechaCompra.ToString("dd/MM/yyyy")).Append("' ") .Append(">").Append("</button>"); consolidado.Append("<button type='button'class='btniNewsAgendaDiariaPrograma2' title='Enviar a iNEWs preformato' onclick='INEWSPreform_Click(this);' ") .Append(" data-Obj='").Append(JsonConvert.SerializeObject(item, Formatting.Indented)).Append("' ") .Append(">").Append("</button>"); consolidado.Append("</div>");//Fin Contenedor del registro consolidado.Append("</li>"); } /*Se vacia la informacion recaudada dentro del div por orden alfabetico*/ divContentResult.InnerHtml += consolidado.ToString(); divContentResult.InnerHtml += "</ul>"; } } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnActualizar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnActualizar_Click(Object sender, EventArgs e) { int cont = 0; int repo = 0; string currSecc; BitacoraIpad[] result = null; string[] splitResult; string[] separador = { "--" }; WebService_FIATubeSoapClient client; StringBuilder cadAvances = null; IDictionary <String, StringBuilder> consolidado = new Dictionary <String, StringBuilder>(); try { try { repo = int.Parse(hiddRepo.Value); } catch (Exception) { repo = 0; } client = new WebService_FIATubeSoapClient(); result = client.getBitacoraDiaria_LOCALESByReportero(hiddFabr.Value, hiddSecc.Value, hiddFech.Value, txtTexto.Value /*txtOT.Value*/, txtTexto.Value, hiddProd.Value, hiddLocl.Value, repo); /*Se limpia el div de resultados*/ divContentResult.InnerHtml = string.Empty; if (result != null) { foreach (BitacoraIpad item in result.Where(n => n.OtraRepl.Equals(string.Empty))) { currSecc = item.SeccDesc.ToUpper(); /*Se verifica si la seccion ya existe en el diccionario, si no, se agrega la clave correspondiente*/ if (!consolidado.ContainsKey(currSecc)) { consolidado.Add(new KeyValuePair <string, StringBuilder>(currSecc, new StringBuilder())); consolidado[currSecc].Append("<div class='tablegPlaylistAgendaDiariatTITLE'>").Append(currSecc).Append("</div>"); } consolidado[currSecc].Append("<div class='divRegContent2'")//Contenedor del registro .Append(" data-OT='").Append(item.OtraCvec).Append("'") .Append(" data-Title='").Append(item.AgseTitu).Append("'"); if (item.Reporteros != null && item.Reporteros.Count() >= 1) { consolidado[currSecc].Append(" data-Rep='").Append(item.Reporteros[0].EmplNomb).Append("'"); } consolidado[currSecc].Append(" data-Ava='").Append(item.AvancesCad).Append("'") .Append(" data-Obj='").Append(item.Cuento).Append("'") .Append("</div>"); consolidado[currSecc].Append("<div class='tablegPlaylistAgendaDiariatTITLE2'>"); //Barra de titulo del registro consolidado[currSecc].Append("<div class='itemMenuBitDi' data-orig='").Append(item.AgseOrig).Append("' data-val='").Append(item.AgseNume).Append("' data-oCve='").Append(item.OtraCvec).Append("' onclick='btnshowOT_click(this);' >[ ").Append(item.AgseOrig == "O" ? "OT" : "PROP").Append(": <label>").Append(item.OtraCvec).Append("</label> ]</div>"); //OT asociada consolidado[currSecc].Append("<div class='itemMenuBitDi'>").Append(item.AgseTitu).Append("</div>"); //Titulo if (item.Reporteros != null && item.Reporteros.Count() >= 1) { consolidado[currSecc].Append("<div class='itemMenuBitDi'>").Append(item.Reporteros[0].EmplNomb).Append("</div>"); //Nombre de reportero asignado } consolidado[currSecc].Append("</div>"); //Fin Barra titulo registro //consolidado[currSecc].Append("<div>");// Cuerpo de registro consolidado[currSecc].Append("<div class='classBitacoraDiaria1'><img onerror='errorImg(this);' class='ImgSizeAgendaDiariaPrograma' alt='Imagen Video' src='").Append(item.VideoImg).Append("'").Append(item.VideoReferencia.Trim().Equals(String.Empty) ? string.Empty : @" onMouseOver=""this.style.cursor='pointer'"" onclick='imgVideo_click(this); return false;'") .Append(" data-numOT='").Append(item.AgseNume).Append("' ") .Append(" data-file='").Append(item.VideoReferencia).Append("' ") .Append(" data-img='").Append(item.VideoImg).Append("' /></div>"); consolidado[currSecc].Append("<label class='title varMarginTop'>AVANCES</label>"); consolidado[currSecc].Append("<Button type='button' class='btnOTADiaria' title='OT' data-val='").Append(item.AgseNume).Append("' data-oCve='").Append(item.OtraCvec).Append(@"' onMouseOver=""this.style.cursor='pointer'"" onclick='btnshowOT_click(this);'></button>"); consolidado[currSecc].Append("<input type='checkBox' class='checkBoxAgendas' title='comprar' onchange='chkCarrito_changed(this);' onclick='chkCarrito_changed(this);' data-AgseOrig='" + item.AgseOrig + "' data-AgseNume='" + item.AgseNume + "' data-AgseTitu='" + item.AgseTitu + "' data-OtraCvec='" + item.OtraCvec + "' data-AgseFini='" + item.AgseFini.ToShortDateString() + "' data-SeccLlPr='" + item.SeccLlPr + "' data-TinoLlPr='" + item.TinoLlPr + "'/>"); consolidado[currSecc].Append("<div class='txtCuentoBitDi'>").Append(item.Cuento).Append("</div>"); consolidado[currSecc].Append("<br />"); cadAvances = new StringBuilder(); if (item.AvancesCad != null) { cont = 0; splitResult = item.AvancesCad.Trim().Split(separador, StringSplitOptions.RemoveEmptyEntries); foreach (string avanc in splitResult) { if (!avanc.Trim().Equals(String.Empty)) { cadAvances.Append("-- ").Append(++cont).Append(" -- \n").Append(avanc).Append(" \n"); } } } consolidado[currSecc].Append("<textArea class='txtAreaBitacoraDiaria' readonly='readonly'>").Append(cadAvances.ToString()).Append("</textArea>"); //consolidado[currSecc].Append("</div>");//Fin Cuerpo de registro consolidado[currSecc].Append("</div>");//Fin Contenedor del registro } /*Se vacia la informacion recaudada dentro del div por orden alfabetico*/ foreach (String seccion in consolidado.Keys.OrderBy(n => n)) { divContentResult.InnerHtml += consolidado[seccion].ToString(); } } if (hiddUpEq.Value.Equals("1")) { ScriptManager.RegisterStartupScript(this, this.GetType(), "js", updateEquipo() + " $('#MainContent_divContentResult').css('height', screen.height - 223);", true); hiddUpEq.Value = "0"; } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "js", "$('#MainContent_divContentResult').css('height', screen.height - 223);", true); } } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Obtiene la informacion para llenar los diferentes controles que son utilizados en la pantalla. /// </summary> private void getScreenData() { string[] puestos; PantallaOT data = null; TDI_SeccionFormato[] formatos; WebService_FIATubeSoapClient client; StringBuilder initJS = new StringBuilder(); StringBuilder initJSDatosPantalla = new StringBuilder(); client = new WebService_FIATubeSoapClient(); Datos_PantallaOTIpad dataPantalla = null; try { bool bActualiza; client = new WebService_FIATubeSoapClient(); data = client.ObtieneDatosPantallaOT(Convert.ToInt32(Session["numUsuario"]), true, true); /*Se llena el combo de secciones y se asigna el valor seleccionado por default*/ cmbSeccion.Items.Clear(); foreach (TDI_Seccion seccion in data.listaSecciones) { cmbSeccion.Items.Add(new ListItem(seccion.NombreSeccion, seccion.CveSeccion.ToString())); } if (data.SeccionUsuario == null) { TDI_Seccion TdS = new TDI_Seccion(); TdS = client.ObtieneSeccionUsuario(Convert.ToInt32(Session["numUsuario"])); if (TdS != null) { cmbSeccion.Value = TdS.CveSeccion.ToString(); } } else { cmbSeccion.Value = data.SeccionUsuario.CveSeccion.ToString(); } /*Se validan las multiples secciones*/ puestos = Session["userPuestos"].ToString().Split(','); if (puestos.Contains("63") == true || puestos.Contains("9") == true) { cmbSeccion.Disabled = false; } else { cmbSeccion.Disabled = true; } /*Se obtienen los formatos*/ formatos = client.ObtenerSeccionFormatoXIDEmpleado(Convert.ToInt32(Session["numUsuario"])); if (formatos != null) { cmbFormato.Items.Clear(); foreach (TDI_SeccionFormato forma in formatos) { cmbFormato.Items.Add(new ListItem(forma.CveFormato.Descripcion, forma.CveFormato.CveFormato.ToString())); } } if (Request.QueryString["numOT"].ToString().Trim() != string.Empty) { bActualiza = true; } else { bActualiza = false; } cmbProduccion.Items.Clear(); cmbProduccion.Items.Add(new ListItem("== SELECCIONE ==", "0")); foreach (TDI_ProgramaEmpleado prog in data.listaProgramaEmpleado) { cmbProduccion.Items.Add(new ListItem(prog.CvePrograma.NombrePrograma, prog.CvePrograma.CvePrograma.ToString())); } /*Se valida si se trata de una actualizacion o creacion de una nueva OT*/ if (!bActualiza) { } else { //divOcultar.Visible = true; dataPantalla = client.ObtenerDatosPantallaOrdenTrabajo(Request.QueryString["numOT"].ToString()); if (dataPantalla != null) { initJS.Append(getJSArrayDatosPantalla("arrOTAgenda", dataPantalla.OTAgenda)); initJS.Append(getJSArrayDatosPantalla("arrOTEquipo", dataPantalla.OTEquipo)); initJS.Append(getJSArrayDatosPantalla("arrOTLogistica", dataPantalla.OTLogistica)); initJS.Append(getJSArrayDatosPantalla("arrOTOrdenTrab", dataPantalla.OTOrdenTrab)); string strEliminada = "arrEstaEliminada=" + dataPantalla.EstaEliminada.ToString().ToLower() + ";"; initJS.Append(strEliminada); } } PantallaOT PantallaOTLocal = null; try { PantallaOTLocal = client.ObtieneDatosEquiporlocal(dataPantalla.OTOrdenTrab[0].Local.LocalLlave); } catch { } if (dataPantalla != null && PantallaOTLocal != null && dataPantalla.OTOrdenTrab[0].Local.LocalLlave > 0 && dataPantalla.OTOrdenTrab[0].Local.LocalLlave != 36) { initJS.Append(this.getJSArrayDeclaration("arrReporteros", PantallaOTLocal.listaReporteros)); initJS.Append(this.getJSArrayDeclaration("arrReporterosFIA", data.listaReporteros)); initJS.Append(this.getJSArrayDeclaration("arrCamarografos", PantallaOTLocal.listaCamarografos)); initJS.Append(this.getJSArrayDeclaration("arrCamarografosFIA", data.listaCamarografos)); initJS.Append(this.getJSArrayDeclaration("arrEditores", PantallaOTLocal.listaEditores)); initJS.Append(this.getJSArrayDeclaration("arrEditoresFIA", data.listaEditores)); } else { initJS.Append(this.getJSArrayDeclaration("arrReporteros", data.listaReporteros)); initJS.Append(this.getJSArrayDeclaration("arrReporterosFIA", data.listaReporteros)); initJS.Append(this.getJSArrayDeclaration("arrCamarografos", data.listaCamarografos)); initJS.Append(this.getJSArrayDeclaration("arrCamarografosFIA", data.listaCamarografos)); initJS.Append(this.getJSArrayDeclaration("arrEditores", data.listaEditores)); initJS.Append(this.getJSArrayDeclaration("arrEditoresFIA", data.listaEditores)); } /*Se obtiene la informacion del autocomplete de reporteros, camarografos y editores*/ initJS.Append(this.getJSArrayDeclarationSeccion("arrSecciones", data.listaSecciones)); initJS.Append(this.getJArrayDeclarationEstatus("arrEstatus", data.listaEstatus)); ScriptManager.RegisterStartupScript(this, this.GetType(), "js", initJS.ToString(), true); } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Loads the screen controls. /// </summary> private void LoadScreenControls() { ListItem lstItem; TDI_Seccion seccion; TDI_EMPL[] reporteros; Secciones[] secciones; THE_CableIpad[] cable = null; WebService_FIATubeSoapClient client; try { client = new WebService_FIATubeSoapClient(); if (Request.QueryString["CveCable"] != null && Request.QueryString["CveCable"] != string.Empty && Convert.ToInt32(Request.QueryString["CveCable"]) > 0) { isEdit = true; /*Se obtiene la informacion del cable*/ cable = client.ConsultaCable(Convert.ToInt32(Request.QueryString["CveCable"])); } /*Se obtiene la informacion de los reporteros*/ reporteros = client.GetReporterosList(); cmbReporteros.Items.Add(new ListItem("== SELECCIONE ==", "-1")); if (reporteros != null) { foreach (TDI_EMPL item in reporteros) { lstItem = new ListItem(item.EmpleadoNombre, item.EmpleadoLlavePrimaria.ToString()); if (isEdit && cable != null && item.EmpleadoLlavePrimaria == Convert.ToInt32(cable[0].CveEmpl)) { lstItem.Selected = true; } cmbReporteros.Items.Add(lstItem); } } /*Se obtiene la informacion de las secciones*/ if (this.ValidaMultiSeccion()) { int idseccion = !isEdit?Convert.ToInt32(Session["UserSeccion"]) : (cable != null && cable.Count() > 0) ? cable[0].CveSecc.CveSeccion : 0; cmbSecciones.Visible = true; txtSeccion.Visible = false; secciones = client.getSecciones(string.Empty, string.Empty); if (secciones != null) { foreach (Secciones item in secciones) { lstItem = new ListItem(item.SeccDesc, item.SeccLlPr.ToString()); if (idseccion == item.SeccLlPr) { lstItem.Selected = true; hidSecc.Value = item.SeccLlPr.ToString(); } cmbSecciones.Items.Add(lstItem); } } } else { cmbSecciones.Visible = false; txtSeccion.Visible = true; seccion = client.ObtieneSeccionByIdEmpleado(Convert.ToInt32(Session["numUsuario"])); if (seccion != null) { txtSeccion.InnerText = seccion.NombreSeccion.ToUpper(); hidSecc.Value = seccion.CveSeccion.ToString(); } } /*Si es edicion se asignan los valores de los demas controles*/ if (isEdit && cable != null && cable.Count() > 0) { txtTitulo.Value = cable[0].Titulo; txtDescripcion.Value = cable[0].Descripcion; txtAvance.Value = cable[0].Avance; } } catch (Exception ex) { this.logError(ex); } }
public static string compraPropuesta(int idProg, int idFmto, int idRep, int idProp, string fechaCarr, THE_LogTransacciones Tran) { WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); try { CompraPropuestaIpad[] CompraPropuesta = new CompraPropuestaIpad[1]; TDI_ProgramaEmpleado Empleado = new TDI_ProgramaEmpleado(); TDI_EMPL oEmpleado = new TDI_EMPL(); TDI_ProgramaEmpleado Programa = new TDI_ProgramaEmpleado(); TDI_Programa oPrograma = new TDI_Programa(); TDI_PropuestaIpad oPropuesta = new TDI_PropuestaIpad(); TDI_Formato oFormato = new TDI_Formato(); TDI_SeccionFormato Formato = new TDI_SeccionFormato(); if (idProg != 0) { oPrograma.CvePrograma = idProg; } else { throw new Exception("Seleccione un programa para poder comprar."); } if (idFmto != 0) { oFormato.CveFormato = idFmto; } else { throw new Exception("Seleccione un Formato para poder comprar."); } oEmpleado.EmpleadoLlavePrimaria = idRep; oPropuesta.CvePropuesta = idProp; Empleado.CveEmpleado = oEmpleado; Programa.CvePrograma = oPrograma; Formato.CveFormato = oFormato; CompraPropuesta[0] = new CompraPropuestaIpad(); CompraPropuesta[0].CveProgramaEmpleado = Empleado; CompraPropuesta[0].CvePropuesta = oPropuesta; CompraPropuesta[0].CveSeccionFormato = Formato; CompraPropuesta[0].CveProgramaEmpleado = Programa; CompraPropuesta[0].FechaCompra = Convert.ToDateTime(fechaCarr); string OT = client.CompraPropuestaRegresaOT(CompraPropuesta, idRep.ToString(), Tran); if (OT != "0") { return(OT.ToString()); } else { throw new Exception("Ocurrio un problema al realizar la compra de la propuesta."); } } catch (Exception ex) { return(ex.Message); } }
/// <summary> /// Updates the screen data. /// </summary> private void updateScreenData() { DateTime fechaInicio; AgendaOTPrograma[] resultado = null; List <String> fechas = new List <string>(); StringBuilder myDiv = new StringBuilder(); List <StringBuilder> dias = new List <StringBuilder>(); try { /*Se genera el arreglo de dias para el programa*/ fechaInicio = Convert.ToDateTime(hiddFecIni.Value); for (int i = 0; i <= 6; i++) { fechas.Add(fechaInicio.AddDays(i).ToString("dd/MM/yyyy")); dias.Add(new StringBuilder(@"<div><label class=""openMdlAgDiaria"" data-fecha='").Append(fechaInicio.AddDays(i).ToString("dd/MM/yyyy")).Append("' ") .Append("data-secc='").Append(hiddSecc.Value).Append("' ") .Append("data-prog='").Append(hiddProg.Value).Append("' ") .Append(">").Append(fechaInicio.AddDays(i).ToString("dddd, dd").ToUpper()).Append("</label></div>")); } WebService_FIATubeSoapClient client = new WebService_FIATubeSoapClient(); resultado = client.ObtenAgendaPrograma(hiddProg.Value, hiddSecc.Value, string.Empty, string.Empty, hiddFecIni.Value, hiddFecFin.Value, 0); resultado = resultado.OrderBy(n => n.ClaveOT).ToArray <AgendaOTPrograma>(); /*Se limpia la informacion del div de resultados*/ if (resultado != null) { foreach (AgendaOTPrograma agenda in resultado) { myDiv.Append("<div style='background:").Append(agenda.ColorSeccion).Append(";margin:5px 5px 0 0; padding: 1px 0;border-radius: 5px;'>") .Append(@"<div id='divItemAgenda' class=""divWeekItems"">") .Append("<div><label style='color:").Append(agenda.ColorSeccion).Append(";'>").Append(agenda.ClaveOT == null ? string.Empty : agenda.ClaveOT.Replace("<", "<").Replace(">", ">")).Append("</label></div>") .Append(@"<div><label data-numOT='").Append(agenda.CveOrdenTrabajo).Append(@"' data-oCve='").Append(agenda.ClaveOT).Append(@"' onclick='showData_click(this);' onMouseOver=""this.style.cursor='pointer'"">").Append(agenda.TituloOT == null ? string.Empty : agenda.TituloOT.Replace("<", "<").Replace(">", ">")).Append("</label></div>") .Append(@"<div><img onerror='errorImg(this);' alt=""Sin Imagen"" width=""95"" height=""70"" src=""") .Append((agenda.VideoImg == string.Empty || agenda.VideoImg.Equals("noImage")) ? "../../Images/noimage.png" : agenda.VideoImg) .Append(@"""").Append(agenda.VideoReferencia.Equals(String.Empty) ? " " : @" onMouseOver=""this.style.cursor='pointer'"" onclick='imgVideo_click(this); return false;' ") .Append(" data-numOT='").Append(agenda.CveOrdenTrabajo).Append("' ") .Append(" data-cProg='").Append(agenda.CvePrograma).Append("' ") .Append(" data-file='").Append(agenda.VideoReferencia).Append("' ") .Append(" data-img='").Append(agenda.VideoImg).Append("' ") .Append("/></div>") .Append("<label>").Append(agenda.TipoNota == null ? string.Empty : agenda.TipoNota.ToUpper().Replace("<", "<").Replace(">", ">")).Append("</label>") .Append("</div>") .Append("</div>"); for (int i = 0; i < fechas.Count; i++) { if (agenda.FechaCompra.ToString("dd/MM/yyyy") == fechas[i]) { dias[i].Append(myDiv.ToString()); } } myDiv.Clear(); } } divLunes.InnerHtml = dias[0].ToString(); divMartes.InnerHtml = dias[1].ToString(); divMiercoles.InnerHtml = dias[2].ToString(); divJueves.InnerHtml = dias[3].ToString(); divViernes.InnerHtml = dias[4].ToString(); divSabado.InnerHtml = dias[5].ToString(); divDomingo.InnerHtml = dias[6].ToString(); } catch (Exception ex) { this.logError(ex); } }
/// <summary> /// Handles the Click event of the btnActualizar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnActualizar_Click(Object sender, EventArgs e) { int cont = 0; string[] splitResult; StringBuilder cadAvances; THE_FormatoCompraIpad[] result = null; WebService_FIATubeSoapClient client; StringBuilder consolidado = new StringBuilder(); try { client = new WebService_FIATubeSoapClient(); result = client.ConsultaBitacoraDiaria_LOCALES(Convert.ToInt32(hiddSecc.Value), Convert.ToInt32(hiddProd.Value), Convert.ToDateTime(hiddFech.Value), hiddLocl.Value); /*Se limpia el div de resultados*/ divContentResult.InnerHtml = string.Empty; if (result != null) { foreach (THE_FormatoCompraIpad item in result) { consolidado.Append("<div class='divRegContent2'>"); //Contenedor del registro consolidado.Append("<div class='tablegPlaylistAgendaDiariatTITLE'>"); //Barra de titulo del registro consolidado.Append("<label data-val='").Append(item.CveOT.CveOrdenTrabajo).Append("' data-oCve='").Append(item.CveOT.ClaveOrdenTrabajo).Append(@"' onMouseOver=""this.style.cursor='pointer'"" onclick='btnshowOT_click(this);'>( OT: ").Append(item.Concatenado).Append(" ").Append(item.CveOT.ClaveOrdenTrabajo).Append(" ) </label>"); //OT asociada consolidado.Append("<label>").Append(item.Reporteros).Append("</label>"); consolidado.Append("</div>"); //Fin Barra titulo registro consolidado.Append("<div>"); // Cuerpo de registro consolidado.Append("<div class='classBitacoraDiaria1'><img onerror='errorImg(this);' class='ImgSizeAgendaDiariaPrograma' alt='Imagen Video' src='").Append(item.VideoImg == null ? "../../Images/noimage.png" : item.VideoImg).Append("'").Append(item.VideoReferencia == null || item.VideoReferencia.Trim().Equals(String.Empty) ? string.Empty : @" onMouseOver=""this.style.cursor='pointer'"" onclick='imgVideo_click(this); return false;'") .Append(" data-numOT='").Append(item.CveOT.CveOrdenTrabajo).Append("' ") .Append(" data-file='").Append(item.VideoReferencia == null ? string.Empty : item.VideoReferencia).Append("' ") .Append(" data-img='").Append(item.VideoImg == null ? string.Empty : item.VideoImg).Append("' /></div>"); //Fin imagen video consolidado.Append("<div class='classBitacoraDiaria2'>"); // Informacion de OT consolidado.Append("<label>").Append(item.CveFormato.Descripcion).Append(", DURACION: ").Append(item.Duracion).Append(" SEGUNDOS.</label><BR/>"); consolidado.Append("<label>SECCIÓN: ").Append(item.CveOT.CveSeccion.NombreSeccion).Append("</label><BR/>"); consolidado.Append("<label>TIPO DE NOTA: ").Append(item.CveOT.CveTipoNota.DescripcionTipoNota).Append("</label><BR/>"); consolidado.Append("<label>").Append(item.CveOT.HistoryLine).Append("</label>"); consolidado.Append("</div>"); // Fin Informacion de OT consolidado.Append("<div class='classBitacoraDiaria3'>"); // consolidado.Append("<label class='title'>AVANCES</label>"); cadAvances = new StringBuilder(); if (item.Avances != null) { cont = 0; splitResult = item.Avances.Trim().Split('|'); foreach (string avanc in splitResult) { if (!avanc.Trim().Equals(String.Empty)) { cadAvances.Append("-- ").Append(++cont).Append(" -- \n").Append(avanc).Append(" \n"); } } } consolidado.Append("<textArea class='txtAreaBitacoraDiariaPrograma' readonly='readonly'>").Append(cadAvances.ToString()).Append("</textArea>"); consolidado.Append("</div>"); consolidado.Append("</div>"); // Fin Cuerpo de registro consolidado.Append("</div>"); //Fin Contenedor del registro } /*Se vacia la informacion recaudada dentro del div por orden alfabetico*/ divContentResult.InnerHtml += consolidado.ToString(); } } catch (Exception ex) { this.logError(ex); } }