public ActionResult Edit(Guid id, ModoLectura modoLectura)
        {
            if (id != modoLectura.Id_ModoLectura)
            {
                return(HttpNotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    db.Entry(modoLectura).State = EntityState.Modified;
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ModoLecturaExists(modoLectura.Id_ModoLectura))
                    {
                        return(HttpNotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(modoLectura));
        }
        public ActionResult Create(ModoLectura modoLectura, HttpPostedFileBase Imagen_ModoLectura)
        {
            using (var transacion = db.Database.BeginTransaction())
            {
                modoLectura.ImagenModoLectura = Helper.Helper.ConvertirImagenByte(Imagen_ModoLectura);
                try
                {
                    if (ModelState.IsValid)
                    {
                        modoLectura.Id_ModoLectura = Guid.NewGuid();
                        db.ModoLectura.Add(modoLectura);
                        db.SaveChanges();
                        transacion.Commit();
                        return(RedirectToAction(nameof(Index)));
                    }
                }
                catch (Exception ex)
                {
                    transacion.Rollback();
                    ModelState.AddModelError(string.Empty, ex.Message);
                    return(View(modoLectura));
                }
            }

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

        //strComentario = Utilidades.unescape(Request.QueryString["strComentario"]).Replace("</br>","\n");
        strTitulo = Utilidades.unescape(Request.QueryString["strTitulo"]);
        sEstado   = Request.QueryString["estado"];
        this.txtComentario.Text = strComentario;

        bool bEstadoLectura = false;

        if (sEstado == "L")
        {
            bEstadoLectura = true;
        }

        if (bEstadoLectura)
        {
            ModoLectura.Poner(this.Controls);
        }
    }
コード例 #4
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; }
            }

            sErrores     = "";
            strTablaAECR = "";
            strArrayVAE  = "";

            nIdTarea = int.Parse(Request.QueryString["nIdTarea"].ToString());

            try
            {
                ObtenerDatosTarea();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos del elemento", ex);
            }

            try
            {
                if (gsTipoPlant != "E")
                {//No puede haber atributos estadisticos para plantillas empresariales
                    PlantProy oPlant = PlantProy.Select(int.Parse(this.hdnIdPlant.Text));
                    ObtenerAtributosEstadisticosCR(oPlant.codune.ToString());
                    ObtenerAtributosEstadisticosTarea();
                    ObtenerValoresAtributosEstadisticosCR(oPlant.codune.ToString());
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener datos complementarios", ex);
            }

            this.hdnAcceso.Text = Request.QueryString["Permiso"].ToString();
            if (this.hdnAcceso.Text == "R")
            {
                ModoLectura.Poner(this.Controls);
            }
            //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);
        }
    }
コード例 #5
0
    private string Permiso(string sT305IdProy, string sCodUne, string sNumProyEco, string sIdTarea)
    {
        string sResul = "N", sEstProy;

        try
        {
            //1º miramos si hay acceso sobre la tarea
            string sUserAct = Session["UsuarioActual"].ToString();
            int    iUserAct = int.Parse(sUserAct);
            sIdTarea = sIdTarea.Replace(".", "");
            sResul   = TAREAPSP.getAcceso(null, int.Parse(sIdTarea), iUserAct);
            //N-> no hay acceso R-> acceso en lectura W-> acceso en escritura
            if (sResul != "N")
            {
                //Miramos el estado del proyecto economico. Por que si está cerrado aunque tenga permiso solo se podrá leer
                sEstProy = EstrProy.estadoProyecto(sT305IdProy);
                if (sEstProy == "C" || sEstProy == "H")
                {
                    if (sResul == "W")
                    {
                        sResul = "R";
                    }
                }
                if (sResul == "R")
                {
                    ModoLectura.Poner(this.Controls);
                }
            }
            gsAcceso            = sResul;
            this.hdnAcceso.Text = sResul;
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al obtener permisos sobre la tarea " + sIdTarea, ex);
        }
        //return "OK@#@" + sResul;
        return(sResul);
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.bFuncionesLocales = true;

            Master.FuncionesJavaScript.Add("Javascript/fechas.js");
            Master.FuncionesJavaScript.Add("Javascript/boxover.js");
            Master.FicherosCSS.Add("Capa_Presentacion/BonoTransporte/css/BonoTransporte.css");

            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);

            if (Request.QueryString["se"] != null)
            {
                sEstado = Utilidades.decodpar(Request.QueryString["se"].ToString());
            }
            if (Request.QueryString["so"] != null)
            {
                sOrigen = Utilidades.decodpar(Request.QueryString["so"].ToString());
            }
            if (Request.QueryString.Get("ni") != null)
            {
                nID = int.Parse(Utilidades.decodpar(Request.QueryString.Get("ni").ToString()));
            }

            lblBeneficiario.InnerText = (Session["GVT_SEXO"].ToString() == "V") ? "Beneficiario" : "Beneficiaria";
            cboEmpresa.Style.Add("display", "none");

            switch (sOrigen)
            {
            case "":
                switch (sEstado)
                {
                case "A":        // Aprobada
                case "C":        // Contabilizada
                case "L":        // Aceptada
                case "N":        // Notificada
                case "S":        // Pagada
                case "X":        // Anulada
                    Master.nBotonera    = 8;
                    bLectura            = true;
                    Master.TituloPagina = "Detalle de bono de transporte";
                    imgAM.Style.Add("display", "none");
                    imgSM.Style.Add("display", "none");
                    break;

                case "B":        // No aprobada
                case "O":        // No aceptada
                //case "P":// Aparcada
                case "R":        // Recuperada
                    Master.nBotonera    = 6;
                    Master.TituloPagina = "Detalle de bono de transporte";
                    break;

                case "T":        // Tramitada
                    Master.nBotonera    = 5;
                    bLectura            = true;
                    Master.TituloPagina = "Detalle de bono de transporte";
                    imgAM.Style.Add("display", "none");
                    imgSM.Style.Add("display", "none");
                    break;

                default:
                    Master.nBotonera    = 11;
                    Master.TituloPagina = "Nuevo bono de transporte";
                    break;
                }
                break;

            case "APROBAR":
                bLectura         = true;
                Master.nBotonera = 13;
                imgAM.Style.Add("display", "none");
                imgSM.Style.Add("display", "none");
                break;

            case "ACEPTAR":
                bLectura         = true;
                Master.nBotonera = 15;
                imgAM.Style.Add("display", "none");
                imgSM.Style.Add("display", "none");
                //paddingLeft = "3px";
                DIALIMITECONTABILIZACIONGV oDL = DIALIMITECONTABILIZACIONGV.Obtener();
                sDiaLimiteContAnoAnterior = oDL.t670_dialimitecontanoanterior.ToString();
                sDiaLimiteContMesAnterior = oDL.t670_dialimitecontmesanterior.ToString();
                break;

            case "CONSULTA":
                bLectura         = true;
                Master.nBotonera = 8;
                break;
            }

            if (sEstado == "T" || sEstado == "N" || sEstado == "A")
            {
                imgManoVisador.Style.Add("visibility", "visible");
                if (sEstado == "T")
                {
                    imgManoVisador.ToolTip = "Muestra quien o quienes han de aprobar la solicitud.";
                }
                else
                {
                    imgManoVisador.ToolTip = "Muestra quien o quienes han de aceptar la solicitud.";
                }
            }

            if (!Page.IsPostBack)
            {
                try
                {
                    //obtenerMonedas();

                    if (nID == 0 || Request.QueryString.Get("ni") == null)
                    {
                        string   sDatosIniciales = NuevoBonoTransporte.obtenerDatosIniciales(Session["GVT_USUARIOSUPER"].ToString(), Fechas.FechaAAnnomes(DateTime.Today).ToString());
                        string[] aDatosIniciales = null;
                        if (sDatosIniciales != "")
                        {
                            aDatosIniciales = Regex.Split(sDatosIniciales, "#sFin#");
                            if (aDatosIniciales.Length == 1)
                            {
                                string[] aElem = Regex.Split(aDatosIniciales[0], "#sCad#");
                                hdnIdBono.Text      = aElem[0];
                                txtBono.Text        = aElem[1];
                                txtImporte.Text     = decimal.Parse(aElem[2]).ToString("N");
                                hdnImporte.Text     = aElem[2];
                                lblMoneda.InnerText = aElem[5];
                                lblMoneda.Attributes.Add("title", "cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../images/info.gif' style='vertical-align:middle' /> Moneda] body=[" + aElem[6] + "] hideselects=[off]");
                                hdnMoneda.Text            = aElem[5];
                                hdnIdProyectoSubNodo.Text = aElem[3];
                                hdnInteresado.Text        = aElem[4];
                                txtProyecto.Text          = aElem[7] + " - " + aElem[8];
                            }
                        }
                    }
                    else
                    { //if (Request.QueryString.Get("ni") != null)
                        txtReferencia.Text = nID.ToString();
                    }
                    if (bLectura)
                    {
                        ModoLectura.Poner(this.Controls);
                    }
                    ObtenerDatosCabeceraBono(nID);
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al cargar 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, System.EventArgs e)
        {
            if (!Page.IsCallback)
            {
                Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);
                Master.TituloPagina        = "Detalle de conexión wifi";
                Master.Comportamiento      = 9;

                Master.bFuncionesLocales = true;
                Master.FuncionesJavaScript.Add("Javascript/convocados.js");
                Master.FuncionesJavaScript.Add("Javascript/boxover.js");
                Master.FuncionesJavaScript.Add("PopCalendar/PopCalendar.js");

                Master.FicherosCSS.Add("PopCalendar/CSS/Classic.css");

                Utilidades.SetEventosFecha(this.txtFechaIni);
                Utilidades.SetEventosFecha(this.txtFechaFin);

                this.txtSolicitante.Attributes.Add("readonly", "readonly");
                this.txtUsuario.Attributes.Add("readonly", "readonly");
                this.txtPwd.Attributes.Add("readonly", "readonly");

                bNuevo      = "";
                strInicial  = "";
                sLectura    = "false";
                strMsg      = "";
                strLocation = "";

                string sHoy = System.DateTime.Today.ToShortDateString();

                //bool bCargando = false;
                //if (Request.QueryString["I"] != null)
                //{
                //    if (Request.QueryString["I"] == "1")
                //        bCargando = true;
                //}
                if (!Page.IsPostBack)//|| bCargando
                {
                    //bNuevo = Request.Form["ctl00$CPHC$hdnNuevo"];
                    if (Request.QueryString["hdnNuevo"] != null)
                    {
                        bNuevo = Utilidades.decodpar(Request.QueryString["hdnNuevo"].ToString());//Request.Form["ctl00$CPHC$hdnNuevo"];
                    }
                    if (bNuevo == "True")
                    {
                        //Botonera.Items[2].Enabled = false;
                        this.txtSolicitante.Text = Session["CR2I_APELLIDO1"].ToString() + " " + Session["CR2I_APELLIDO2"].ToString() + ", " + Session["CR2I_NOMBRE"].ToString();
                        this.txtCIP.Text         = Session["CR2I_CIP"].ToString();
                        //this.txtInteresado.Text = Session["CR2I_APELLIDO1"].ToString() + " " + Session["CR2I_APELLIDO2"].ToString() + ", " + Session["CR2I_NOMBRE"].ToString();
                        this.txtFechaIni.Text = DateTime.Today.ToShortDateString();
                        this.txtFechaFin.Text = DateTime.Today.ToShortDateString();
                        if (DateTime.Now.Minute < 30)
                        {
                            this.cboHoraIni.SelectedValue = (DateTime.Now.Hour).ToString() + ":00";
                        }
                        else
                        {
                            this.cboHoraIni.SelectedValue = (DateTime.Now.Hour).ToString() + ":30";
                        }

                        //                    this.cboHoraIni.SelectedValue = "7:00";// Request.Form["ctl00$CPHC$hdnHora"].ToString().Trim();
                        if (this.cboHoraIni.SelectedIndex < 22)
                        {
                            this.cboHoraFin.SelectedValue = "18:00";                                    //this.cboHoraIni.SelectedIndex + 1;
                        }
                        else
                        {
                            this.cboHoraFin.SelectedIndex = this.cboHoraIni.SelectedIndex + 1;
                        }
                    }
                    else
                    {
                        //Botonera.Items[4].Enabled = false;
                        //Botonera.Items[6].Enabled = true;
                        //Botonera.Items[8].Enabled = true;
                        if (Request.QueryString["hdnReserva"] != null)
                        {
                            sIDReserva = Utilidades.decodpar(Request.QueryString["hdnReserva"].ToString());//Request.Form["ctl00$CPHC$hdnReserva"];
                        }
                        if (sIDReserva != null)
                        {
                            hdnIDReserva.Text = sIDReserva;
                            WIFI oWifi = WIFI.Obtener(null, int.Parse(hdnIDReserva.Text));

                            this.txtSolicitante.Text = Session["CR2I_APELLIDO1"].ToString() + " " + Session["CR2I_APELLIDO2"].ToString() + ", " + Session["CR2I_NOMBRE"].ToString();
                            //this.txtCIP.Text = Session["CR2I_CIP"].ToString();
                            this.txtInteresado.Text       = oWifi.t085_interesado;
                            this.txtFechaIni.Text         = oWifi.t085_fechoraini.ToShortDateString();
                            this.txtFechaFin.Text         = oWifi.t085_fechorafin.ToShortDateString();
                            this.cboHoraIni.SelectedValue = oWifi.t085_fechoraini.ToShortTimeString();
                            this.cboHoraFin.SelectedValue = oWifi.t085_fechorafin.ToShortTimeString();
                            this.txtEmpresa.Text          = oWifi.t085_empresa;
                            this.txtObservaciones.Text    = oWifi.t085_observaciones;
                            this.txtUsuario.Text          = oWifi.t085_usuwifi;
                            this.txtPwd.Text    = oWifi.t085_pwdwifi;
                            this.hdnEstado.Text = oWifi.t085_estado.ToString();
                            //fstConexion.Style.Add("visibility","visible");

                            if (oWifi.t085_estado == 3 || oWifi.t085_estado == 4)
                            {
                                //Botonera.Items[0].Enabled = false;
                                //if (oWifi.t085_estado == 4)
                                //    Botonera.Items[2].Enabled = false;
                                //System.Web.UI.Control Area = this.FindControl("AreaTrabajo");
                                //ModoLectura.Poner(Area.Controls);
                                sLectura = "true";
                                System.Web.UI.Control Area = this.AreaTrabajo.FindControl("tblFiltros");
                                if (Area != null)
                                {
                                    ModoLectura.Poner(Area.Controls);
                                }
                                else
                                {
                                    ModoLectura.Poner(this.Controls);
                                }
                            }
                        }
                    }
                }//Fin de Postback
                 //CargarDatos();
            }
        }// Fin de Load
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            try
            {
                if (Session["IDRED"] == null)
                {
                    try
                    {
                        Response.Redirect("~/SesionCaducadaModal.aspx", true);
                    }
                    catch (System.Threading.ThreadAbortException) { return; }
                }

                // Leer Espacio de comunicación
                hdnProy.Text = Request.QueryString["nProy"].ToString();

                if (Request.QueryString["bNueva"] != "true")
                {
                    hdnID.Text = Request.QueryString["ID"].ToString();
                    ESPACIOCOMUNICACION oESPACIOCOMUNICACION = ESPACIOCOMUNICACION.Select(null, int.Parse(hdnID.Text));
                    if ((bool)oESPACIOCOMUNICACION.t639_consumo)
                    {
                        chkConsumo.Checked = true;
                    }
                    else
                    {
                        chkConsumo.Checked = false;
                    }

                    if ((bool)oESPACIOCOMUNICACION.t639_produccion)
                    {
                        chkProdu.Checked = true;
                    }
                    else
                    {
                        chkProdu.Checked = false;
                    }

                    if ((bool)oESPACIOCOMUNICACION.t639_facturacion)
                    {
                        chkFactu.Checked = true;
                    }
                    else
                    {
                        chkFactu.Checked = false;
                    }

                    if ((bool)oESPACIOCOMUNICACION.t639_otros)
                    {
                        chkOtros.Checked = true;
                    }
                    else
                    {
                        chkOtros.Checked = false;
                    }

                    if ((bool)oESPACIOCOMUNICACION.t639_vigenciaproyecto)
                    {
                        rdbVigencia.SelectedValue = "T";
                        txtDesde.Text             = "";
                        txtHasta.Text             = "";
                        hdnDesde.Text             = "";
                        hdnHasta.Text             = "";
                    }
                    else
                    {
                        rdbVigencia.SelectedValue = "P";
                        hdnDesde.Text             = oESPACIOCOMUNICACION.t639_vigenciadesde.ToString();
                        txtDesde.Text             = mes[int.Parse(oESPACIOCOMUNICACION.t639_vigenciadesde.ToString().Substring(4, 2)) - 1] + " " + oESPACIOCOMUNICACION.t639_vigenciadesde.ToString().Substring(0, 4);
                        hdnHasta.Text             = oESPACIOCOMUNICACION.t639_vigenciahasta.ToString();
                        txtHasta.Text             = mes[int.Parse(oESPACIOCOMUNICACION.t639_vigenciahasta.ToString().Substring(4, 2)) - 1] + " " + oESPACIOCOMUNICACION.t639_vigenciahasta.ToString().Substring(0, 4);
                    }

                    txtDescripcion.Text   = oESPACIOCOMUNICACION.t639_descripcion;
                    hdnObservaciones.Text = oESPACIOCOMUNICACION.t639_observaciones;
                    ModoLectura.Poner(this.Controls);
                }
                else
                {
                    sIDDocuAux = "SUPER-" + Session["IDFICEPI_ENTRADA"].ToString() + "-" + DateTime.Now.Ticks.ToString();
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos de la comunicación", 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);
        }
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["IDRED"] == null)
        {
            try
            {
                Response.Redirect("~/SesionCaducadaModal.aspx", true);
            }
            catch (System.Threading.ThreadAbortException) { return; }
        }

        this.hdnComentario.Value = Utilidades.decodpar(Request.QueryString["strComentario"].ToString());
        if (this.hdnComentario.Value == "@")
        {
            string sIdTarea  = Request.QueryString["IDTAREA"].ToString();
            string sFecha    = Request.QueryString["FECHA"].ToString();
            string sEmpleado = Request.QueryString["EMPLEADO"].ToString();

            CONSUMOIAP oCONSUMOIAP = CONSUMOIAP.Select(null, int.Parse(sIdTarea), int.Parse(sEmpleado), DateTime.Parse(sFecha));
            this.hdnComentario.Value = oCONSUMOIAP.t337_comentario;
        }

        strTitulo   = Utilidades.decodpar(Request.QueryString["strTitulo"].ToString());
        sEstado     = Request.QueryString["estado"];
        sImputacion = Request.QueryString["imputacion"];

        this.txtComentario.Text = this.hdnComentario.Value;

        bool bEstadoLectura = false;

        switch (sEstado) //Estado
        {
        case "0":        //Paralizada
            bEstadoLectura = true;
            break;

        case "1":    //Activo
            break;

        case "2":    //Pendiente
            bEstadoLectura = true;
            break;

        case "3":    //Finalizada
            if (sImputacion == "0")
            {
                bEstadoLectura = true;
            }
            break;

        case "4":    //Cerrada
            if (sImputacion == "0")
            {
                bEstadoLectura = true;
            }
            break;
        }
        if (bEstadoLectura)
        {
            ModoLectura.Poner(this.Controls);
        }
    }
コード例 #10
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; }
            }

            sErrores       = "";
            strTablaHitos  = "";
            strTablaTareas = "";
            sOrigen        = "";

            sTipoHito = Utilidades.decodpar(Request.QueryString["th"].ToString());                         //sTipoHito
            nIdHito   = int.Parse(Utilidades.decodpar(Request.QueryString["h"].ToString()));               //nIdHito
            nIdPE     = int.Parse(quitaPuntos(Utilidades.decodpar(Request.QueryString["pe"].ToString()))); //nPE
            try
            {
                Utilidades.SetEventosFecha(this.txtValFecha);

                ObtenerDatosHito();
                ObtenerTareas(sTipoHito, nIdHito);
                //ObtenerOtrosHitos(nIdPE);
                //Inserto el control calendario para la fecha del hito
                //if (sTipoHito == "HF")
                if (Request.QueryString["o"] != null)//origen
                {
                    sOrigen = Utilidades.decodpar(Request.QueryString["o"].ToString());
                    this.cboModo.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos del hito", ex);
            }
            //try
            //{
            //    string strTabla = ObtenerDocumentos(nIdHito.ToString(), sTipoHito);
            //    string[] aTabla = Regex.Split(strTabla, "@#@");
            //    if (aTabla[0] == "OK") divCatalogoDoc.InnerHtml = aTabla[1];
            //}
            //catch (Exception ex)
            //{
            //    sErrores += Errores.mostrarError("Error al obtener datos complementarios", ex);
            //}
            this.hdnAcceso.Text = Utilidades.decodpar(Request.QueryString["pm"].ToString());//Permiso
            if (this.hdnAcceso.Text == "R")
            {
                ModoLectura.Poner(this.Controls);
            }
            //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);
        }
    }
コード例 #11
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; }
            }

            Utilidades.SetEventosFecha(this.txtFecAnticipo);
            Utilidades.SetEventosFecha(this.txtFecDevolucion);
            //Master.bContienePestanas = true;
            //Master.bFuncionesLocales = true;
            //Master.TituloPagina = "Detalle de nota estándar";

            //Master.FuncionesJavaScript.Add("Javascript/fechas.js");
            //Master.FuncionesJavaScript.Add("Javascript/boxover.js");
            //Master.FuncionesJavaScript.Add("PopCalendar/PopCalendar.js");
            //Master.FicherosCSS.Add("PopCalendar/CSS/Classic.css");
            //Master.Botonera.ButtonClick += new System.EventHandler(this.Botonera_Click);

            //if (Request.QueryString["ni"] != null)
            //    nID = int.Parse(Utilidades.decodpar(Request.QueryString["ni"].ToString()));
            //if (Request.QueryString["se"] != null)
            //    sEstado = Utilidades.decodpar(Request.QueryString["se"].ToString());
            //if (Request.QueryString["st"] != null)
            //    sTipo = Utilidades.decodpar(Request.QueryString["st"].ToString());
            //if (Request.QueryString["so"] != null)
            //    sOrigen = Utilidades.decodpar(Request.QueryString["so"].ToString());
            if (Request.QueryString["nPSN"] != null)
            {
                nPSN = int.Parse(Utilidades.decodpar(Request.QueryString["nPSN"].ToString()));
            }
            if (Request.QueryString["sF"] != null)
            {
                sFechaIAP = Utilidades.decodpar(Request.QueryString["sF"].ToString());
            }
            if (Request.QueryString["nN"] != null)
            {
                nIDNaturaleza = int.Parse(Utilidades.decodpar(Request.QueryString["nN"].ToString()));
            }

            lblBeneficiario.InnerText = (Session["SEXOUSUARIO"].ToString() == "V") ? "Beneficiario" : "Beneficiaria";
            cboEmpresa.Style.Add("display", "none");

            //if (sEstado == "" || sEstado == "R" || sEstado == "P")
            divDisposiciones.Style.Add("display", "block");
            //else
            //    divDisposiciones.Style.Add("display", "none");

            if (!Page.IsPostBack)
            {
                try
                {
                    obtenerMotivos();
                    cboMotivo.Enabled = false;
                    if (nIDNaturaleza == 20)
                    {
                        cboMotivo.SelectedValue = "6";
                    }
                    obtenerMonedas();

                    if (bLectura)
                    {
                        ModoLectura.Poner(this.Controls);
                        imgCalculadora.Visible = false;
                        Calculadora.Visible    = false;
                    }
                    ObtenerDatosIAP(nPSN);
                    ObtenerDatosCabecera(nID);
                    ObtenerDatosGastos(nID);
                }
                catch (Exception ex)
                {
                    sErrores = Errores.mostrarError("Error al cargar 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);
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.bFuncionesLocales = true;

            Master.FuncionesJavaScript.Add("Javascript/fechas.js");
            Master.FuncionesJavaScript.Add("Javascript/boxover.js");
            Master.FicherosCSS.Add("Capa_Presentacion/PagoConcertado/css/PagoConcertado.css");

            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);

            if (Request.QueryString["se"] != null)
            {
                sEstado = Utilidades.decodpar(Request.QueryString["se"].ToString());
            }
            if (Request.QueryString["so"] != null)
            {
                sOrigen = Utilidades.decodpar(Request.QueryString["so"].ToString());
            }
            if (Request.QueryString.Get("ni") != null)
            {
                nID = int.Parse(Utilidades.decodpar(Request.QueryString.Get("ni").ToString()));
            }

            lblBeneficiario.InnerText = (Session["GVT_SEXO"].ToString() == "V") ? "Beneficiario" : "Beneficiaria";
            cboEmpresa.Style.Add("display", "none");

            switch (sOrigen)
            {
            case "":
                switch (sEstado)
                {
                case "A":        // Aprobada
                case "C":        // Contabilizada
                case "L":        // Aceptada
                case "N":        // Notificada
                case "S":        // Pagada
                case "X":        // Anulada
                    Master.nBotonera    = 8;
                    bLectura            = true;
                    Master.TituloPagina = "Detalle del pago concertado";
                    break;

                case "B":        // No aprobada
                case "O":        // No aceptada
                //case "P":// Aparcada
                case "R":        // Recuperada
                    Master.nBotonera    = 6;
                    Master.TituloPagina = "Detalle del pago concertado";
                    break;

                case "T":        // Tramitada
                    Master.nBotonera    = 5;
                    bLectura            = true;
                    Master.TituloPagina = "Detalle del pago concertado";
                    break;

                default:
                    Master.nBotonera    = 11;
                    Master.TituloPagina = "Nuevo pago concertado";
                    break;
                }
                if (sEstado != "" && sEstado != "R")
                {
                    if (sEstado != "T")
                    {
                        tdlblAcuerdo.Style.Add("visibility", "visible");
                        tdtxtAcuerdo.Style.Add("visibility", "visible");
                    }
                    lblProy.Attributes.Add("onclick", "");
                    lblProy.Attributes.Add("class", "texto");
                    lblAcuerdo.Attributes.Add("onclick", "");
                    lblAcuerdo.Attributes.Add("class", "texto");
                }
                else if (sEstado == "R")
                {
                    lblProy.Attributes.Add("onclick", "getPE()");
                    lblProy.Attributes.Add("class", "enlace");
                    tdlblAcuerdo.Style.Add("visibility", "hidden");
                    tdtxtAcuerdo.Style.Add("visibility", "hidden");
                }
                break;

            case "APROBAR":
                bLectura         = true;
                Master.nBotonera = 13;
                tdlblAcuerdo.Style.Add("visibility", "visible");
                tdtxtAcuerdo.Style.Add("visibility", "visible");
                lblProy.Attributes.Add("onclick", "");
                lblProy.Attributes.Add("class", "texto");
                break;

            case "ACEPTAR":
                bLectura         = true;
                Master.nBotonera = 15;
                DIALIMITECONTABILIZACIONGV oDL = DIALIMITECONTABILIZACIONGV.Obtener();
                sDiaLimiteContAnoAnterior = oDL.t670_dialimitecontanoanterior.ToString();
                sDiaLimiteContMesAnterior = oDL.t670_dialimitecontmesanterior.ToString();
                tdlblAcuerdo.Style.Add("visibility", "visible");
                tdtxtAcuerdo.Style.Add("visibility", "visible");
                lblProy.Attributes.Add("onclick", "");
                lblProy.Attributes.Add("class", "texto");
                lblAcuerdo.Attributes.Add("onclick", "");
                lblAcuerdo.Attributes.Add("class", "texto");
                break;

            case "CONSULTA":
                bLectura         = true;
                Master.nBotonera = 8;
                break;
            }

            if (sEstado == "T" || sEstado == "N" || sEstado == "A")
            {
                imgManoVisador.Style.Add("visibility", "visible");
                if (sEstado == "T")
                {
                    imgManoVisador.ToolTip = "Muestra quien o quienes han de aprobar la solicitud.";
                }
                else
                {
                    imgManoVisador.ToolTip = "Muestra quien o quienes han de aceptar la solicitud.";
                }
            }

            if (!Page.IsPostBack)
            {
                try
                {
                    obtenerMotivos((int)Session["GVT_USUARIOSUPER"], sEstado);
                    obtenerMonedas();

                    hdnCCIberper.Text = Session["GVT_CCIBERPER"].ToString();
                    if ((int)Session["GVT_CCIBERPER"] > 1)
                    {
                        lblNodo.Attributes.Add("class", "enlace");
                        lblNodo.Attributes.Add("onclick", "getCCIberper()");
                    }

                    if (bLectura)
                    {
                        ModoLectura.Poner(this.Controls);
                    }
                    ObtenerDatosCabeceraPago(nID);
                    //if (nID > 0) tabOtros.DefaultStyle.Add("Display", "block");
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al cargar 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);
    }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            try
            {
                obtenerProveedores();
                obtenerMedios();
                obtenerTarifaDatos();
                obtenerTiposTarjeta();
                //obtenerEstados();

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

                //string[] aFiguras = Regex.Split(Session["FIGURAS"].ToString(), ",");
                //for (int i = 0; i < aFiguras.Length; i++)
                //{
                //    if (aFiguras[i] == "C")
                //    {
                //        sLectura = "false";
                //        break;
                //    }
                //}
                if (User.IsInRole("C"))
                {
                    sLectura = "false";
                }

                // Leer Línea

                if (Request.QueryString["bNueva"] != "true")
                {
                    hdnId.Text = Request.QueryString["ID"].ToString();
                    GEMO.DAL.LINEA oLINEA = GEMO.DAL.LINEA.Select(null, int.Parse(hdnId.Text));
                    //if (oLINEA.t708_prefintern.ToString() == "") txtPrefijo.Text = "";
                    //else txtPrefijo.Text = short.Parse(oLINEA.t708_prefintern.ToString()).ToString("000");
                    txtPrefijo.Text  = oLINEA.t708_prefintern.ToString();
                    txtNumlinea.Text = long.Parse(oLINEA.t708_numlinea.ToString()).ToString("###########");
                    txtNumext.Text   = int.Parse(oLINEA.t708_numext.ToString()).ToString("#########");

                    if (oLINEA.t313_idempresa == null)
                    {
                        hdnIdEmpresa.Text = "0";
                        //txtIDEmpresa.Text = "";
                        txtEmpresa.Text = "";
                    }
                    else
                    {
                        hdnIdEmpresa.Text = oLINEA.t313_idempresa.ToString();
                        //txtIDEmpresa.Text = int.Parse(oLINEA.t313_idempresa.ToString()).ToString("##,###,###");
                        txtEmpresa.Text = oLINEA.empresa;
                    }

                    if (oLINEA.t712_idtarjeta != null)
                    {
                        cboTipoTarjeta.SelectedValue = oLINEA.t712_idtarjeta.ToString();
                    }
                    if (oLINEA.t063_idproveedor != null)
                    {
                        cboProveedor.SelectedValue = oLINEA.t063_idproveedor.ToString();
                    }

                    if (oLINEA.t134_idmedio != null)
                    {
                        cboMedio.SelectedValue = oLINEA.t134_idmedio.ToString();
                    }

                    cboTarifa.SelectedValue = oLINEA.t711_idtarifa.ToString();


                    if (sLectura == "false" || sOrigen == "2")
                    {
                        switch (oLINEA.t710_idestado.ToString())
                        {
                        case ("X"):
                        {
                            cboEstado.Items.Add(new ListItem("Preactiva", "X"));
                            cboEstado.Items.Add(new ListItem("Activa", "A"));
                            cboEstado.Items.Add(new ListItem("Inactiva", "I"));
                            break;
                        }

                        case ("A"):
                        case ("B"):
                        {
                            cboEstado.Items.Add(new ListItem("Bloqueada", "B"));
                            cboEstado.Items.Add(new ListItem("Activa", "A"));
                            cboEstado.Items.Add(new ListItem("Inactiva", "I"));
                            break;
                        }

                        case ("Y"):
                        {
                            cboEstado.Items.Add(new ListItem("Preinactiva", "Y"));
                            cboEstado.Items.Add(new ListItem("Activa", "A"));
                            cboEstado.Items.Add(new ListItem("Inactiva", "I"));
                            break;
                        }

                        case ("I"):
                        {
                            cboEstado.Items.Add(new ListItem("Inactiva", "I"));
                            cboEstado.Items.Add(new ListItem("Activa", "A"));
                            break;
                        }
                        }
                    }
                    else
                    {
                        switch (oLINEA.t710_idestado.ToString())
                        {
                        case ("X"):
                        case ("A"):
                        case ("Y"):
                        {
                            cboEstado.Items.Add(new ListItem("Activa", "A"));
                            break;
                        }

                        case ("B"):
                        {
                            cboEstado.Items.Add(new ListItem("Bloqueada", "B"));
                            break;
                        }

                        case ("I"):
                        {
                            cboEstado.Items.Add(new ListItem("Inactiva", "I"));
                            break;
                        }
                        }
                    }
                    cboEstado.SelectedValue = oLINEA.t710_idestado.ToString();
                    hdnEstado.Text          = cboEstado.SelectedValue;

                    txtModelo.Text  = oLINEA.t708_modelo;
                    txtIMEI.Text    = oLINEA.t708_IMEI;
                    txtICC.Text     = oLINEA.t708_ICC;
                    txtObserva.Text = oLINEA.t708_observa;

                    if (oLINEA.t001_responsable == null)
                    {
                        hdnIdResponsable.Text = "0";
                        //txtIDResponsable.Text = "";
                        txtResponsable.Text = "";
                    }
                    else
                    {
                        hdnIdResponsable.Text = oLINEA.t001_responsable.ToString();
                        //txtIDResponsable.Text = int.Parse(oLINEA.t001_responsable.ToString()).ToString("##,###,###");
                        txtResponsable.Text = oLINEA.responsable;
                    }

                    if (oLINEA.t708_tipouso != null)
                    {
                        rdlTipoUso.SelectedValue = oLINEA.t708_tipouso;
                    }

                    if (oLINEA.t001_beneficiario == null)
                    {
                        hdnIdBeneficiario.Text = "0";
                        //txtIDBeneficiario.Text = "";
                        txtBeneficiario.Text = "";
                    }
                    else
                    {
                        hdnIdBeneficiario.Text = oLINEA.t001_beneficiario.ToString();
                        //txtIDBeneficiario.Text = int.Parse(oLINEA.t001_beneficiario.ToString()).ToString("##,###,###");
                        txtBeneficiario.Text = oLINEA.beneficiario;
                    }

                    txtDepartamento.Text = oLINEA.t708_departamento;

                    if ((bool)oLINEA.t708_QEQ)
                    {
                        chkQEQ.Checked = true;
                    }
                    else
                    {
                        chkQEQ.Checked = false;
                    }
                }
                else
                {
                    //cboEstado.Items.Add(new ListItem("", "0"));
                    cboEstado.Items.Add(new ListItem("Activa", "A"));
                    //cboProveedor.SelectedValue = "1";
                    //cboEstado.Items.Add(new ListItem("Preactiva", "X"));
                    //cboEstado.SelectedValue = "A";
                    //cboEstado.Enabled = false;
                }

                if (sLectura == "true")
                {
                    ModoLectura.Poner(this.Controls);
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos de la línea", 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);
        }
    }
コード例 #14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsCallback)
            {
                try
                {
                    hdnIDArea.Text = Request.QueryString["IDAREA"].ToString();

                    Utilidades.SetEventosFecha(this.txtFechaAnalisis);

                    if (Request.QueryString["bNueva"].ToString() == "false")
                    {
                        hdnIDEntrada.Text = Request.QueryString["IDENTRADA"].ToString();
                        dr_resultado      = null;
                        dr_resultado      = ENTRADA.Select(null, short.Parse(Request.QueryString["IDENTRADA"]));
                        if (dr_resultado.Read())
                        {
                            txtDenominacion.Text = (string)dr_resultado["T074_DENOMINACION"];
                            txtCreador.Text      = (string)dr_resultado["CREADOR"];
                            txtOrigen.Text       = (string)dr_resultado["ORIGEN"];
                            txtComunicante.Text  = (string)dr_resultado["T074_COMUNICANTE"];
                            txtMedio.Text        = (string)dr_resultado["T074_MEDIO"];
                            txtOrganizacion.Text = (string)dr_resultado["T074_ORGANIZACION"];
                            txtAnalista.Text     = (string)dr_resultado["ANALISTA"];
                            hdnAnalista.Text     = dr_resultado["T074_ANALISTA"].ToString();
                            hdnOrigen.Text       = dr_resultado["T075_ORIGEN"].ToString();
                            txtOrden.Text        = dr_resultado["T074_ORDEN"].ToString();

                            if (dr_resultado["T074_FECHAANAL"] == System.DBNull.Value)
                            {
                                txtFechaAnalisis.Text = "";
                            }
                            else
                            {
                                txtFechaAnalisis.Text = ((DateTime)dr_resultado["T074_FECHAANAL"]).ToShortDateString();
                            }

                            txtDescripcion.Text = (string)dr_resultado["T074_DESCRIPCION"];
                            txtNotas.Text       = (string)dr_resultado["T074_NOTAS"];
                        }
                        dr_resultado.Close();
                        dr_resultado.Dispose();
                        dr_resultado = null;

                        hdnModoLectura.Text = Session["MODOLECTURA"].ToString();

                        if (hdnModoLectura.Text == "1")
                        {
                            Control Area = this.FindControl("frmDatos");
                            ModoLectura.Poner(Area.Controls);
                        }
                    }
                    else
                    {
                    }
                }
                catch (Exception ex)
                {
                    hdnErrores.Text = 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");
                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);
            }
            //this.txtIdEntrada.Attributes.Add("readonly", "readonly");
            //txtDescripcion.Attributes.Add("readonly", "readonly");
            //txtFechaInicio.Attributes.Add("readonly", "readonly");
            //txtFechaFin.Attributes.Add("readonly", "readonly");


            // Put user code to initialize the page here
            //if(!this.IsPostBack){
            //    dr_resultado = null;
            //    Provincia objProvincia = new Provincia();
            //    dr_resultado = objProvincia.Catalogo();

            //    ddlProvincia.DataSource = dr_resultado;
            //    ddlProvincia.DataTextField = "DESCRIPCION";
            //    ddlProvincia.DataValueField = "CODIGO";
            //    ddlProvincia.DataBind();
            //    ddlProvincia.Items.Insert(0, new ListItem("", "0"));

            //    if (Request.QueryString["bNueva"]=="false"){
            //        lblTituloEnlace.Visible=false;
            //        lblTituloSinEnlace.Visible=true;
            //        btnBorrarTitulo.Visible=false;
            //    }

            //    imgbtnGrabar.Attributes.Add("onclick", "return false");
            //    imgbtnCancelar.Attributes["onclick"] = "javascript:salir();";
            //    hdnbNueva.Text = Request.QueryString["bNueva"].ToString();
            //    if (hdnbNueva.Text == "false")
            //    {
            //        dr_resultado = null;
            //        Formacion objFormacion = new Formacion();
            //        dr_resultado = objFormacion.LeerUnRegistro(Request.QueryString["IDFICEPI"],int.Parse(Request.QueryString["IDCODTITULO"]));
            //        dr_resultado.Read();

            //        txtDescripcion.Text = (string)dr_resultado["T019_DESCRIPCION"];
            //        txtEspecialidad.Text = (string)dr_resultado["T012_ESPECIALIDAD"];

            //        if (dr_resultado["T012_FECINICIO"]==System.DBNull.Value)
            //            txtFechaInicio.Text = "";
            //        else
            //            txtFechaInicio.Text = ((DateTime)dr_resultado["T012_FECINICIO"]).ToShortDateString();

            //        if (dr_resultado["T012_FECFIN"]==System.DBNull.Value)
            //            txtFechaFin.Text = "";
            //        else
            //            txtFechaFin.Text = ((DateTime)dr_resultado["T012_FECFIN"]).ToShortDateString();

            //        txtCentroFormacion.Text = (string)dr_resultado["T012_CENTROFORMACION"];
            //        txtExpediente.Text = (string)dr_resultado["T012_EXPEDIENTE"];
            //        txtObservaciones.Text =(string)dr_resultado["T012_OBSERVACIONES"];
            //        ddlProvincia.SelectedValue = dr_resultado["T002_IDPROVIN"].ToString();
            //        lblFecultmodif.Text = dr_resultado["T012_FECULTMODIF"].ToString();
            //        chkIbermatica.Checked = (bool)dr_resultado["T012_IBERMATICA"];
            //        dr_resultado.Close();

            //        SqlDataReader dr_resultado2 = null;
            //        dr_resultado2 = null;
            //        Formacion objFormacion2 = new Formacion();
            //        dr_resultado2 = objFormacion2.LeerFUMA(Request.QueryString["IDFICEPI"]);
            //        dr_resultado2.Read();
            //        lblFecultmodifApar.Text = dr_resultado2["T012_FECULTMODIFA"].ToString();
            //        dr_resultado.Close();
            //        dr_resultado.Dispose();
            //    }
            //    else
            //    {
            //        lblFecultmodif.Width = Unit.Pixel(93);
            //    }
            //}

            //strPerfilCV = Session["PERFIL_CV"].ToString();

            //if ( Session["PERFIL_CV"].ToString()!="4")
            //{
            //    ModoLectura.Poner(this.Controls);
            //}
            //btnBorrarTitulo.Attributes.Add("hidefocus","true");
            //btnBorrarFechaInicio.Attributes.Add("hidefocus","true");
            //btnBorrarFechaFin.Attributes.Add("hidefocus","true");
        }
コード例 #15
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; }
            }

            //txtDesTarea.Attributes["maxlength"] = "100";
            nIdTarea   = int.Parse(Utilidades.decodpar(Request.QueryString["t"].ToString()));
            nObligaest = int.Parse(Utilidades.decodpar(Request.QueryString["nObligaest"].ToString()));
            nPT        = int.Parse(Utilidades.decodpar(Request.QueryString["pt"].ToString()));
            sDesTarea  = Utilidades.decodpar(Request.QueryString["sDesTarea"].ToString());

            try
            {
                Utilidades.SetEventosFecha(this.txtFinEst);

                ObtenerDatosTarea();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos de la tarea", ex);
            }

            try
            {
                //string strTabla = ObtenerDocumentos(nIdTarea.ToString());
                //string[] aTabla = Regex.Split(strTabla, "@#@");
                //if (aTabla[0] == "OK") divCatalogoDoc.InnerHtml = aTabla[1];

                string sEstadoProy = TAREAPSP.getEstado(null, nIdTarea);
                string sPermiso    = "E";
                if (bEstadoLectura)
                {
                    sPermiso = "R";
                }
                div1.InnerHtml = Utilidades.ObtenerDocumentos("IAP_T", nIdTarea, sPermiso, sEstadoProy);
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos de la tarea", ex);
            }

            sEstado     = Utilidades.decodpar(Request.QueryString["estado"]);
            sImputacion = Utilidades.decodpar(Request.QueryString["imputacion"]);
            switch (sEstado) //Estado
            {
            case "0":        //Paralizada
                bEstadoLectura = true;
                break;

            case "1":    //Activo
                break;

            case "2":    //Pendiente
                bEstadoLectura = true;
                break;

            case "3":    //Finalizada
                if (sImputacion == "0")
                {
                    bEstadoLectura = true;
                }
                break;

            case "4":    //Cerrada
                if (sImputacion == "0")
                {
                    bEstadoLectura = true;
                }
                break;
            }
            if (bEstadoLectura)
            {
                ModoLectura.Poner(this.Controls);
            }

            //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);
        }
    }
コード例 #16
0
        // Ordena = campo de la select  TipoOrden = 1 asc 2 desc

        //public DetalleTarea()
        //{
        //    this.Title = "Detalle de la tarea";

        //    ArrayList aFuncionesJavaScript = new ArrayList();
        //    aFuncionesJavaScript.Add("Capa_Presentacion/Defiencias/Functions/funciones.js");
        //    aFuncionesJavaScript.Add("JavaScript/funciones.js");
        //    this.FuncionesJavaScript = aFuncionesJavaScript;
        //}

        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsCallback)
            {
                try
                {
                    if (Session["IDRED"] == null)
                    {
                        try
                        {
                            Response.Redirect("~/SesionCaducadaModal.aspx", true);
                        }
                        catch (System.Threading.ThreadAbortException) { return; }
                    }
                    //if (Request.QueryString["bNueva"] == "false")
                    //    strTitulo = "Modificación de la tarea";
                    //else
                    //    strTitulo = "Creación de una nueva tarea";

                    strTablaHtmlCatalogo      = "<table id='tblCatalogo' class='texto' style='width: 390px' cellSpacing='0' cellpadding='0' align='left' border='0'></table>";
                    strTablaHtmlSeleccionados = "<table id='tblSeleccionados' class='texto' style='width: 390px' cellSpacing='0' cellpadding='0' align='left' border='0'></table>";

                    strTitulo = "Detalle tarea";

                    cboAvance.Items.Insert(0, new ListItem("", "0"));
                    cboAvance.Items[0].Selected = true;

                    cboRtado.Items.Insert(0, new ListItem("", "0"));
                    cboRtado.Items[0].Selected = true;

                    hdnIDArea.Text      = Request.QueryString["IDAREA"].ToString();
                    hdnIDDefi.Text      = Request.QueryString["IDDEFICIENCIA"].ToString();
                    txtDeficiencia.Text = Request.QueryString["DEFICIENCIA"].ToString();
                    txtArea.Text        = Request.QueryString["AREA"];
                    hdnModoLectura.Text = Session["MODOLECTURA"].ToString();
                    hdnEstado.Text      = Request.QueryString["ESTADO"];
                    //Si anulada o aprobada ponemos en modo lectura
                    if (hdnEstado.Text == "12" || hdnEstado.Text == "11")
                    {
                        hdnModoLectura.Text = "1";
                    }

                    if (Request.QueryString["bNueva"].ToString() == "false")
                    {
                        #region Modificar tarea
                        #region Carga datos Tarea
                        hdnIDTarea.Text = Request.QueryString["IDTAREA"].ToString();
                        dr = null;
                        dr = TAREA.Select(null, short.Parse(Request.QueryString["IDTAREA"]));
                        if (dr.Read())
                        {
                            txtDenominacion.Text = (string)dr["T072_DENOMINACION"];

                            if (dr["T072_FECINIPREV"] == System.DBNull.Value)
                            {
                                txtFechaInicioPrevista.Text = "";
                            }
                            else
                            {
                                txtFechaInicioPrevista.Text = ((DateTime)dr["T072_FECINIPREV"]).ToShortDateString();
                            }

                            if (dr["T072_FECINIREAL"] == System.DBNull.Value)
                            {
                                txtFechaInicioReal.Text = "";
                            }
                            else
                            {
                                txtFechaInicioReal.Text = ((DateTime)dr["T072_FECINIREAL"]).ToShortDateString();
                            }

                            if (dr["T072_FECFINPREV"] == System.DBNull.Value)
                            {
                                txtFechaFinPrevista.Text = "";
                            }
                            else
                            {
                                txtFechaFinPrevista.Text = ((DateTime)dr["T072_FECFINPREV"]).ToShortDateString();
                            }

                            if (dr["T072_FECFINREAL"] == System.DBNull.Value)
                            {
                                txtFechaFinReal.Text = "";
                            }
                            else
                            {
                                txtFechaFinReal.Text = ((DateTime)dr["T072_FECFINREAL"]).ToShortDateString();
                            }

                            txtDescripcion.Text = (string)dr["T072_DESCRIPCION"];

                            txtIdTarea.Text         = dr["T072_IDTAREA"].ToString();
                            txtCausas.Text          = (string)dr["T072_CAUSA"];
                            txtIntervenciones.Text  = (string)dr["T072_INTERVENCION"];
                            txtConsideraciones.Text = (string)dr["T072_CONSIDERACION"];
                            cboRtado.SelectedValue  = dr["T072_RESULTADO"].ToString();
                            cboAvance.SelectedValue = dr["T072_AVANCE"].ToString();
                            hdnAvanceIn.Text        = dr["T072_AVANCE"].ToString();
                        }
                        dr.Close();
                        dr.Dispose();
                        dr = null;
                        #endregion
                        #region Solapa Especialistas

                        hdnEsCoordinador.Text = Request.QueryString["ES_COORDINADOR"].ToString();

                        strTablaHtmlCatalogo = CargarEspecialistas(int.Parse(hdnIDArea.Text));
                        string[] aTablaHtmlCatalogo = Regex.Split(strTablaHtmlCatalogo, @"##");

                        strTablaHtmlCatalogo  = aTablaHtmlCatalogo[0];
                        hdnEspecialistas.Text = aTablaHtmlCatalogo[1];
                        #endregion
                        if (hdnEsCoordinador.Text == "true")
                        {
                            this.hdnBusqueda.Text = "S";
                        }

                        strTablaHtmlSeleccionados = CargarEspecialistasSeleccionados(int.Parse(txtIdTarea.Text));

                        hdnAdmin.Text = Request.QueryString["ADMIN"];

                        int intCoordinador = (Request.QueryString["COORDINADOR"].ToString() == "") ? 0 : int.Parse(Request.QueryString["COORDINADOR"].ToString());

                        if (
                            (
                                (hdnModoLectura.Text == "1" || hdnEsTecnico.Text == "true")
                                &&
                                (hdnAdmin.Text != "A" && hdnEsCoordinador.Text != "true" || (hdnEsCoordinador.Text == "true" && intCoordinador != int.Parse(Session["IDFICEPI"].ToString())
                                                                                             )
                                )
                            )
                            ||
                            (hdnEstado.Text == "2" || hdnEstado.Text == "4" || hdnEstado.Text == "7" || hdnEstado.Text == "9" || hdnEstado.Text == "12" || hdnEstado.Text == "11")
                            ||
                            (hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "false")
                            )
                        {
                            System.Web.UI.Control Area = this.FindControl("frmDatos");
                            ModoLectura.Poner(Area.Controls);
                            //if (hdnEsTecnico.Text == "true" && (hdnEstado.Text != "12" && hdnEstado.Text != "11"))
                            if (hdnEsTecnico.Text == "true" && hdnEstado.Text == "8")
                            {
                                Habilitar_campos_Tecnico();
                                hdnModoLectura.Text = "0";
                            }
                            if ((hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "false") || (hdnEsCoordinador.Text == "false" && hdnEsTecnico.Text == "true" && hdnEstado.Text != "8") || (hdnEsCoordinador.Text == "true" && (hdnEstado.Text == "0" || hdnEstado.Text == "2" || hdnEstado.Text == "4" || hdnEstado.Text == "7" || hdnEstado.Text == "9")))
                            {
                                hdnModoLectura.Text = "1";
                            }
                        }
                        //12/05/2016 Por petición de Víctor solo podrán modificar fechas de tarea los coordinadores
                        //y en Órdenes(deficiencias) cuyos estados sean Tramitada, Aceptada, Es estudio, Pte. de resolución y En resolución
                        if (hdnModoLectura.Text == "0" && hdnEsCoordinador.Text == "true")
                        {
                            if (FechaModificable(hdnEstado.Text))
                            {
                                PonerEventosFecha();
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        PonerEventosFecha();
                        hdnEsCoordinador.Text = "true";
                        strTablaHtmlCatalogo  = CargarEspecialistas(int.Parse(hdnIDArea.Text));
                        string[] aTablaHtmlCatalogo = Regex.Split(strTablaHtmlCatalogo, @"##");

                        strTablaHtmlCatalogo  = aTablaHtmlCatalogo[0];
                        hdnEspecialistas.Text = aTablaHtmlCatalogo[1];
                    }

                    this.txtArea.Attributes.Add("readonly", "readonly");
                    this.txtDeficiencia.Attributes.Add("readonly", "readonly");
                    //this.txtDenominacion.Attributes.Add("readonly", "readonly");
                    this.txtIdTarea.Attributes.Add("readonly", "readonly");
                }
                catch (Exception ex)
                {
                    hdnErrores.Text = 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");
                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);
            }
        }
コード例 #17
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 (!(bool)Session["FORANEOS"])
            //{
            //    this.imgForaneo.Visible = false;
            //    this.lblForaneo.Visible = false;
            //}
            sErrores            = "";
            sLectura            = "false";
            sNodo               = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
            nIdAsunto           = int.Parse(Utilidades.decodpar(Request.QueryString["as"].ToString())); //nIdAsunto
            this.hdnAcceso.Text = Utilidades.decodpar(Request.QueryString["p"].ToString());             //Permiso
            nIdT = int.Parse(quitaPuntos(Utilidades.decodpar(Request.QueryString["t"].ToString())));    //nT
            this.hdnNodo.Value = TAREAPSP.GetNodo(tr, nIdT).ToString();
            try
            {
                Utilidades.SetEventosFecha(this.txtValNotif);
                Utilidades.SetEventosFecha(this.txtValLim);
                Utilidades.SetEventosFecha(this.txtValFin);

                ObtenerDatosAsunto();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos del asunto", ex);
            }
            try
            {
                //Datos de las personas asignadas al asunto
                string   strTabla  = ObtenerRecursos(nIdAsunto.ToString(), this.hdnNodo.Value);
                string[] aRecursos = Regex.Split(strTabla, "@#@");
                if (aRecursos[0] == "OK")
                {
                    divR.InnerHtml = aRecursos[1];
                }

                //Datos del historial del asunto
                strTabla = ObtenerHistorial(nIdAsunto.ToString());
                string[] aTareas = Regex.Split(strTabla, "@#@");
                if (aTareas[0] == "OK")
                {
                    divH.InnerHtml = aTareas[1];
                }

                //Datos de los documentos asociados al asunto
                //strTabla = ObtenerDocumentos(nIdAsunto.ToString());
                //string[] aTabla = Regex.Split(strTabla, "@#@");
                //if (aTabla[0] == "OK") divDoc.InnerHtml = aTabla[1];
                string sEstado = TAREAPSP.getEstado(null, nIdT);
                divDoc.InnerHtml = Utilidades.ObtenerDocumentos("AS_T", nIdAsunto, this.hdnAcceso.Text, sEstado);
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener datos complementarios", ex);
            }

            this.hdnAcceso.Text = Utilidades.decodpar(Request.QueryString["p"].ToString());//Permiso
            if (this.hdnAcceso.Text == "R")
            {
                ModoLectura.Poner(this.Controls);
                sLectura = "true";
            }
            //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);
        }
    }
コード例 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            try
            {
                sProfesional = Session["APELLIDO1"].ToString() + " " + Session["APELLIDO2"].ToString() + ", " + Session["NOMBRE"].ToString();
                obtenerTipos();

                // Leer tarifa de datos

                hdn_ficepi_actual.Text = Session["IDFICEPI_PC_ACTUAL"].ToString();

                if (Request.QueryString["t305_idproyectosubnodo"] != null)
                {
                    hdn_idproyectosubnodo.Text = Request.QueryString["t305_idproyectosubnodo"];
                }

                if (Request.QueryString["origen"] != null)
                {
                    sOrigen = Request.QueryString["origen"];
                }

                if (Request.QueryString["bNueva"] != "true")
                {
                    hdnID.Text = Request.QueryString["ID"].ToString();
                    SUPER.Capa_Datos.CAMPOS oCAMPOS = SUPER.Capa_Datos.CAMPOS.Select(null, int.Parse(hdnID.Text));

                    cboAmbito.SelectedValue = oCAMPOS.codAmbito.ToString();

                    txtDenominacion.Text      = oCAMPOS.t290_denominacion;
                    cboTipoDato.SelectedValue = oCAMPOS.t291_idtipodato.ToString();
                    txtCreador.Text           = oCAMPOS.profesional_creador;
                    hdn_ficepi_creador.Text   = oCAMPOS.t001_idficepi_creador.ToString();

                    switch (oCAMPOS.codAmbito.ToString())
                    {
                    case ("0"):
                        lblAmbitoSel.Style.Add("visibility", "hidden");
                        break;

                    case ("1"):
                        lblAmbitoSel.InnerText = oCAMPOS.profesional_owner;
                        break;

                    case ("2"):
                        lblAmbitoSel.InnerText = (oCAMPOS.t301_idproyecto.HasValue) ? ((int)oCAMPOS.t301_idproyecto).ToString("#,###,###") + "-" + oCAMPOS.denominacion_proyecto : "";
                        break;

                    case ("3"):
                        lblAmbitoSel.InnerText = (oCAMPOS.t302_idcliente.HasValue) ? ((int)oCAMPOS.t302_idcliente).ToString("#,###,###") + "-" + oCAMPOS.denominacion_cliente : "";
                        break;

                    case ("4"):
                        lblAmbitoSel.InnerText = (oCAMPOS.t303_idnodo.HasValue) ? ((int)oCAMPOS.t303_idnodo).ToString("#,###,###") + "-" + oCAMPOS.denominacion_nodo : "";
                        break;
                    }
                    ModoLectura.Poner(this.Controls);
                }
                else
                {
                    txtCreador.Text         = Session["APELLIDO1_ENTRADA"].ToString() + " " + Session["APELLIDO2_ENTRADA"].ToString() + ", " + Session["NOMBRE_ENTRADA"].ToString();
                    cboAmbito.SelectedValue = "0";
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos de la tarifa de 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);
        }
    }