Example #1
0
        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);
            }
        }
Example #2
0
        /// <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);
            }
        }
Example #3
0
        /// <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());
        }