コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }
            if (!Page.IsPostBack)
            {
                try
                {
                    LimpiarDatos();

                    if (Request.QueryString["a"] != null)//sAccBitacoraT
                    {
                        sAccesoBitacoraT = Utilidades.decodpar(Request.QueryString["a"].ToString());
                    }
                    if (Request.QueryString["t"] != null)//sCodT
                    {
                        this.hdnOrigen.Value = "T";
                        this.txtIdTarea.Text = Utilidades.decodpar(Request.QueryString["t"].ToString());
                        if (sAccesoBitacoraT != "X")
                        {
                            string sIdTarea = quitaPuntos(this.txtIdTarea.Text);
                            getTarea(sIdTarea);
                            if (sAccesoBitacoraT != "X")
                            {
                                ObtenerDatosAsunto(int.Parse(sIdTarea));
                            }
                        }
                    }
                    //Relleno el combo de tipo de asunto
                    this.cboTipo.DataValueField = "t384_idtipo";
                    this.cboTipo.DataTextField  = "t384_destipo";
                    this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
                    this.cboTipo.DataBind();
                }
                catch (Exception ex)
                {
                    sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }
            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
コード例 #2
0
    protected string Grabar(string strTiposAsunto)
    {
        string sResul = "";

        #region abrir conexión
        try
        {
            oConn = Conexion.Abrir();
            tr    = Conexion.AbrirTransaccion(oConn);
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al abrir la conexión", ex);
            return(sResul);
        }
        #endregion
        try
        {
            string[] aFun = Regex.Split(strTiposAsunto, "///");
            foreach (string oFun in aFun)
            {
                string[] aValores = Regex.Split(oFun, "##");
                switch (aValores[0])
                {
                case "I":
                    TIPOASUNTO.Insert(tr, Utilidades.unescape(aValores[2]), byte.Parse(aValores[3]));
                    break;

                case "U":
                    TIPOASUNTO.Update(tr, Utilidades.unescape(aValores[2]), int.Parse(aValores[1]), byte.Parse(aValores[3]));
                    break;

                case "D":
                    TIPOASUNTO.Delete(tr, int.Parse(aValores[1]));
                    break;
                }
            }
            Conexion.CommitTransaccion(tr);
            //sResul = "OK@#@";
            sResul = ObtenerTiposAsunto("3", "0");
        }
        catch (Exception ex)
        {
            Conexion.CerrarTransaccion(tr);
            sResul = "Error@#@" + Errores.mostrarError("Error al actualizar los tipos de asunto", ex);
        }
        finally
        {
            Conexion.Cerrar(oConn);
        }

        return(sResul);
    }
コード例 #3
0
    private string ObtenerTiposAsunto(string sOrden, string sAscDesc)
    {
        StringBuilder strBuilder = new StringBuilder();

        strBuilder.Append("<table id='tblDatos' class='texto MANO' style='WIDTH: 450px;' mantenimiento='1'>");
        strBuilder.Append("<colgroup><col style='width:15px;' /><col style='width:435px;' /></colgroup>");
        strBuilder.Append("<tbody>");
        SqlDataReader dr = TIPOASUNTO.Catalogo("", null, null, byte.Parse(sOrden), byte.Parse(sAscDesc));

        while (dr.Read())
        {
            strBuilder.Append("<tr id='" + dr["t384_idtipo"].ToString() + "' orden='" + dr["T384_orden"].ToString());
            strBuilder.Append("' bd='' onclick='mm(event)' onKeyUp=\"mfa(this,'U')\" style='height:20px;'>");
            strBuilder.Append("<td><img src='../../../../images/imgFN.gif'></td>");
            strBuilder.Append("<td><input type='text' id='txtFun' class='txtL' style='width:95%' value='");
            strBuilder.Append(dr["t384_destipo"].ToString() + "' maxlength='40'></td></tr>");
        }
        dr.Close();
        dr.Dispose();
        strBuilder.Append("</tbody>");
        strBuilder.Append("</table>");
        strTablaHtml = strBuilder.ToString();
        return("OK@#@" + strTablaHtml);
    }
コード例 #4
0
    private void ObtenerDatosAsunto()
    {
        int nTarea = 0;

        //Relleno el combo de tipo de asunto
        this.cboTipo.DataValueField = "t384_idtipo";
        this.cboTipo.DataTextField  = "t384_destipo";
        this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
        this.cboTipo.DataBind();

        if (nIdAsunto == -1)
        {
            nTarea                     = nIdT;
            txtValCre.Text             = DateTime.Now.ToShortDateString();
            txtValNotif.Text           = DateTime.Now.ToShortDateString();
            this.txtIdResponsable.Text = Session["NUM_EMPLEADO_ENTRADA"].ToString();
            this.txtResponsable.Text   = Session["APELLIDO1"].ToString() + " " + Session["APELLIDO2"].ToString() + ", " + Session["NOMBRE"].ToString();
            this.txtRegistrador.Text   = Session["APELLIDO1"].ToString() + " " + Session["APELLIDO2"].ToString() + ", " + Session["NOMBRE"].ToString();
        }
        else
        {
            ASUNTO_T o = ASUNTO_T.Select(tr, nIdAsunto);
            nTarea              = o.t332_idtarea;
            txtIdAsunto.Text    = o.t600_idasunto.ToString();
            txtDesAsunto.Text   = o.t600_desasunto;
            txtDescripcion.Text = o.t600_desasuntolong;
            this.txtEtp.Text    = o.t600_etp.ToString("N");
            this.txtEtr.Text    = o.t600_etr.ToString("N");//#,##0.##
            if (o.t600_fcreacion.Year > 1900)
            {
                txtValCre.Text = o.t600_fcreacion.ToShortDateString();
            }
            if (o.t600_fnotificacion.Year > 1900)
            {
                txtValNotif.Text = o.t600_fnotificacion.ToShortDateString();
            }
            if (o.t600_flimite.Year > 1900)
            {
                txtValLim.Text = o.t600_flimite.ToShortDateString();
            }
            if (o.t600_ffin.Year > 1900)
            {
                txtValFin.Text = o.t600_ffin.ToShortDateString();
            }
            this.txtDpto.Text               = o.t600_dpto;
            this.txtAlerta.Text             = o.t600_alerta;
            this.txtObs.Text                = o.t600_obs;
            this.txtRefExt.Text             = o.t600_refexterna;
            this.txtSistema.Text            = o.t600_sistema;
            this.cboEstado.SelectedValue    = o.t600_estado.ToString();
            this.cboEstado.Text             = o.Estado;
            this.txtEstadoAnt.Text          = o.t600_estado.ToString();
            this.cboPrioridad.SelectedValue = o.t600_prioridad.ToString();
            this.cboPrioridad.Text          = o.Prioridad;
            this.cboSeveridad.SelectedValue = o.t600_severidad.ToString();
            this.cboSeveridad.Text          = o.Severidad;
            this.cboTipo.SelectedValue      = o.t384_idtipo.ToString();
            this.cboTipo.Text               = o.Tipo;
            this.txtNotificador.Text        = o.t600_notificador;
            this.txtIdResponsable.Text      = o.t600_responsable.ToString();
            this.txtResponsable.Text        = o.Responsable;
            this.txtRegistrador.Text        = o.Registrador;
        }

        TAREAPSP        oTarea = TAREAPSP.Obtener(null, nTarea);
        PROYECTOSUBNODO oPSN   = PROYECTOSUBNODO.Obtener(null, oTarea.t305_idproyectosubnodo);

        if (oPSN.t305_opd)
        {
            lblNumero.Style.Add("display", "none");
            txtIdAsunto.Style.Add("display", "none");
            lblCreacion.Style.Add("visibility", "hidden");
            txtValCre.Style.Add("visibility", "hidden");
            tsPestanas.Items[1].Disabled = true;
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }

            if (!Page.IsPostBack)
            {
                try
                {
                    strTablaHtmlAsunto = "<table id='tblDatos1'></table>";
                    strTablaHtmlAccion = "<table id='tblDatos2'></table>";
                    strTablaHtmlPTs    = "<table id='tblPTs'></table>";

                    if (Request.QueryString["sOrigen"] != null)
                    {
                        sOrigen = Utilidades.decodpar(Request.QueryString["sOrigen"].ToString());
                    }
                    if (Request.QueryString["sAccesoBitacoraPE"] != null)
                    {
                        sAccesoBitacoraPE = Utilidades.decodpar(Request.QueryString["sAccesoBitacoraPE"].ToString());
                    }

                    if (Request.QueryString["sT305IdProy"] != null)
                    {
                        this.hdnOrigen.Value = "T";
                        nPSN = int.Parse(Utilidades.decodpar(Request.QueryString["sT305IdProy"].ToString()));
                        this.hdnT305IdProy.Value = nPSN.ToString();
                        this.txtEstado.Text      = Utilidades.decodpar(Request.QueryString["sEstado"].ToString());
                        this.txtCodProy.Text     = Utilidades.decodpar(Request.QueryString["sCodProy"].ToString());
                        this.txtNomProy.Text     = Utilidades.decodpar(Request.QueryString["sNomProy"].ToString());
                    }
                    else
                    {
                        if (Session["ID_PROYECTOSUBNODO"].ToString() != "")
                        {
                            nPSN = int.Parse(Session["ID_PROYECTOSUBNODO"].ToString());
                            this.hdnT305IdProy.Value = nPSN.ToString();
                            this.hdnAcceso.Value     = PROYECTOSUBNODO.getAcceso(null, nPSN, (int)Session["UsuarioActual"]);
                            SqlDataReader dr = PROYECTO.fgGetDatosProy(nPSN);
                            if (dr.Read())
                            {
                                sAccesoBitacoraPE = dr["t305_accesobitacora_pst"].ToString();
                                if (sAccesoBitacoraPE != "X")
                                {
                                    this.txtEstado.Text  = dr["t301_estado"].ToString();
                                    this.txtNomProy.Text = dr["t301_denominacion"].ToString();
                                    this.txtCodProy.Text = int.Parse(dr["t301_idproyecto"].ToString()).ToString("#,###");
                                    if (this.hdnAcceso.Value == "R")
                                    {
                                        sAccesoBitacoraPE = "L";
                                    }
                                    else
                                    {
                                        if (this.txtEstado.Text == "C" || this.txtEstado.Text == "H")
                                        {
                                            sAccesoBitacoraPE = "L";
                                        }
                                    }
                                }
                            }
                            dr.Close();
                            dr.Dispose();
                        }
                    }
                    if (nPSN > -1 && sAccesoBitacoraPE != "X")
                    {
                        switch (this.txtEstado.Text)
                        {
                        case "A":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyAbierto.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto abierto");
                            break;

                        case "C":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyCerrado.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto cerrado");
                            break;

                        case "P":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyPresup.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto presupuestado");
                            break;

                        case "H":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyHistorico.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto histórico");
                            break;
                        }
                        ObtenerDatosAsunto(nPSN);
                        ObtenerPTs(nPSN.ToString());
                        LimpiarDatosAccion();
                    }
                    //Relleno el combo de tipo de asunto
                    this.cboTipo.DataValueField = "t384_idtipo";
                    this.cboTipo.DataTextField  = "t384_destipo";
                    this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
                    this.cboTipo.DataBind();
                }
                catch (Exception ex)
                {
                    sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            //Para que se muestre la botonera, únicamente hay que indicar el número de botonera
            //y crear el manejador de eventos para la misma.
            Master.nBotonera           = 27;
            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);
            Master.TituloPagina        = "Consulta de Bitácora de tarea";
            Master.bFuncionesLocales   = true;
            Master.FuncionesJavaScript.Add("PopCalendar/PopCalendar.js");
            Master.FicherosCSS.Add("PopCalendar/CSS/Classic.css");

            try
            {
                if (!Page.IsPostBack)
                {
                    Utilidades.SetEventosFecha(this.txtFechaInicio);
                    Utilidades.SetEventosFecha(this.txtFechaFin);
                    Utilidades.SetEventosFecha(this.txtLimD);
                    Utilidades.SetEventosFecha(this.txtLimH);
                    Utilidades.SetEventosFecha(this.txtFinD);
                    Utilidades.SetEventosFecha(this.txtFinH);

                    strTablaHtmlAsunto = "<table id='tblDatos1'></table>";
                    //this.txtUne.Text = Session["NodoActivo"].ToString();
                    //this.txtDesCR.Text = Session["DesNodoActivo"].ToString();
                    if (Request.QueryString["sCodProy"] != null)
                    {
                        this.txtEstado.Text = Request.QueryString["sEstado"].ToString();
                        this.txtUne.Text    = Request.QueryString["sCR"].ToString();
                        //this.txtDesCR.Text = Request.QueryString["sDesCR"].ToString();
                        this.txtCodProy.Text = Request.QueryString["sCodProy"].ToString();
                        this.txtNomProy.Text = Request.QueryString["sNomProy"].ToString();
                    }
                    else
                    {
                        if (Session["ID_PROYECTOSUBNODO"].ToString() != "")
                        {
                            int nPE = int.Parse(Session["ID_PROYECTOSUBNODO"].ToString());
                            this.hdnT305IdProy.Value = nPE.ToString();
                            SqlDataReader dr = PROYECTO.fgGetDatosProy2(nPE);
                            if (dr.Read())
                            {
                                this.txtUne.Text = dr["t303_idnodo"].ToString();
                                //this.txtDesCR.Text = dr["t303_denominacion"].ToString();
                                this.txtEstado.Text  = dr["t301_estado"].ToString();
                                this.txtNomProy.Text = dr["t301_denominacion"].ToString();
                                this.txtCodProy.Text = int.Parse(dr["t301_idproyecto"].ToString()).ToString("#,###");
                            }
                            dr.Close();
                            dr.Dispose();
                        }
                    }
                    //Relleno el combo de tipo de asunto
                    this.cboTipo.DataValueField = "t384_idtipo";
                    this.cboTipo.DataTextField  = "t384_destipo";
                    this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
                    this.cboTipo.DataBind();
                }
            }
            catch (Exception ex)
            {
                Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
            }

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.nBotonera           = 27;
            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);
            Master.TituloPagina        = "Consulta de Bitácora";
            Master.bFuncionesLocales   = true;
            Master.FuncionesJavaScript.Add("PopCalendar/PopCalendar.js");
            Master.FicherosCSS.Add("PopCalendar/CSS/Classic.css");
            try
            {
                if (!Page.IsPostBack)
                {
                    int   nPE = -1;
                    short nCR;

                    Utilidades.SetEventosFecha(this.txtFechaInicio);
                    Utilidades.SetEventosFecha(this.txtFechaFin);
                    Utilidades.SetEventosFecha(this.txtLimD);
                    Utilidades.SetEventosFecha(this.txtLimH);
                    Utilidades.SetEventosFecha(this.txtFinD);
                    Utilidades.SetEventosFecha(this.txtFinH);

                    strTablaHtmlAsunto = "<table id='tblDatos1'></table>";
                    //this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                    //this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));

                    if (Request.QueryString["sCodProy"] != null)
                    {
                        nPE = int.Parse(quitaPuntos(Request.QueryString["sCodProy"].ToString()));
                        nCR = short.Parse(Request.QueryString["sCR"].ToString());
                        this.txtEstado.Text = Request.QueryString["sEstado"].ToString();
                        this.txtUne.Text    = Request.QueryString["sCR"].ToString();
                        //this.txtDesCR.Text = Request.QueryString["sDesCR"].ToString();
                        this.txtCodProy.Text = Request.QueryString["sCodProy"].ToString();
                        this.txtNomProy.Text = Request.QueryString["sNomProy"].ToString();
                    }
                    else
                    {
                        if (Session["ID_PROYECTOSUBNODO"].ToString() != "")
                        {
                            nPE = int.Parse(Session["ID_PROYECTOSUBNODO"].ToString());
                            this.hdnT305IdProy.Value = nPE.ToString();
                            SqlDataReader dr = PROYECTO.fgGetDatosProy2(nPE);
                            if (dr.Read())
                            {
                                nCR = short.Parse(dr["t303_idnodo"].ToString());
                                this.txtUne.Text = nCR.ToString();
                                //this.txtDesCR.Text = dr["t303_denominacion"].ToString();
                                this.txtEstado.Text  = dr["t301_estado"].ToString();
                                this.txtNomProy.Text = dr["t301_denominacion"].ToString();
                                this.txtCodProy.Text = int.Parse(dr["t301_idproyecto"].ToString()).ToString("#,###");
                                sAccesoBitacoraPE    = dr["t305_accesobitacora_pst"].ToString();
                            }
                            dr.Close();
                            dr.Dispose();
                        }
                        //else
                        //{
                        //    nCR = short.Parse(Session["NodoActivo"].ToString());
                        //    this.txtUne.Text = Session["NodoActivo"].ToString();
                        //    this.txtDesCR.Text = Session["DesNodoActivo"].ToString();
                        //}
                    }
                    if (nPE > -1)
                    {
                        this.hdnT305IdProy.Value = nPE.ToString();
                        //oRDENADO POR FECHA DE NOTIFICACIÓN
                        if (sAccesoBitacoraPE != "X")
                        {
                            obtenerAsuntos(nPE.ToString(), "6", "0", 0, 0, 0, 0, "", "", "", "", "", "", "N", "");
                        }
                    }
                    else
                    {
                        this.hdnT305IdProy.Value = "";
                    }
                    //Relleno el combo de tipo de asunto
                    this.cboTipo.DataValueField = "t384_idtipo";
                    this.cboTipo.DataTextField  = "t384_destipo";
                    this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
                    this.cboTipo.DataBind();
                }
            }
            catch (Exception ex)
            {
                Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
            }

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }