private string getUMCNP(string nPSN)
    {
        string sResul = "";

        try
        {
            PROYECTOSUBNODO oPSN = PROYECTOSUBNODO.Obtener(null, int.Parse(nPSN));
            sResul = "OK@#@" + oPSN.t303_ultcierreeco.ToString();
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al obtener el último mes cerrado del " + Estructura.getDefLarga(Estructura.sTipoElem.NODO) + " del proyecto.", ex);
        }
        return(sResul);
    }
Beispiel #2
0
    private string ObtenerPEs(string sIdPSN)
    {
        StringBuilder sb = new StringBuilder();

        try
        {
            //Obtengo los datos del proyecto
            PROYECTOSUBNODO oPSN  = PROYECTOSUBNODO.Obtener(tr, int.Parse(sIdPSN));
            PROYECTO        oProy = PROYECTO.Obtener(tr, oPSN.t301_idproyecto);
            return("OK@#@" + sb.ToString() + "@#@" + oPSN.t301_idproyecto.ToString("#,###") + "##" +
                   Utilidades.escape(oProy.t301_denominacion) + "##" +
                   Utilidades.escape(oProy.t302_denominacion) + "##" +
                   oProy.t301_estado + "##" + oProy.t301_categoria + "##" + oPSN.t305_cualidad + "##" +
                   oPSN.t303_denominacion + "##" + Utilidades.escape(oPSN.des_responsable) + "##" +
                   ObtenerMeses(sIdPSN, oProy.t301_estado));
        }
        catch (Exception ex)
        {
            Master.sErrores = Errores.mostrarError("Error al obtener el Proyecto Económico", ex);
            return("error@#@Error al obtener el Proyecto Económico " + ex.Message);
        }
    }
Beispiel #3
0
    private string Procesar(string strDatos)
    {
        string sResul = "";

        int idPSN = 0, responsable_origen = 0, responsable_destino = 0, subnodo_origen = 0, subnodo_destino = 0;

        try
        {
            REASIGNACIONPSN.DeleteAll(null, (int)Session["UsuarioActual"]);

            string[] aDatos = Regex.Split(strDatos, "///");
            foreach (string oProyecto in aDatos)
            {
                try
                {
                    if (oProyecto == "")
                    {
                        continue;
                    }
                    string[] aProyecto = Regex.Split(oProyecto, "##");
                    ///aProyecto[0] = idPSN
                    ///aProyecto[1] = responsable_origen
                    ///aProyecto[2] = responsable_destino
                    ///aProyecto[3] = subnodo_origen
                    ///aProyecto[4] = subnodo_destino
                    ///aProyecto[5] = procesado

                    idPSN = int.Parse(aProyecto[0]);
                    responsable_origen  = int.Parse(aProyecto[1]);
                    responsable_destino = int.Parse(aProyecto[2]);
                    subnodo_origen      = int.Parse(aProyecto[3]);
                    subnodo_destino     = int.Parse(aProyecto[4]);

                    REASIGNACIONPSN.Insertar(null, idPSN, (int)Session["UsuarioActual"], responsable_destino, subnodo_destino, false, "");

                    if (aProyecto[5] == "1" || (aProyecto[1] == aProyecto[2] && aProyecto[3] == aProyecto[4]))
                    {
                        REASIGNACIONPSN.Modificar(null, idPSN, (int)Session["UsuarioActual"], responsable_destino, subnodo_destino, true, "");
                        continue;
                    }

                    #region abrir conexión y transacción
                    try
                    {
                        oConn = Conexion.Abrir();
                        tr    = Conexion.AbrirTransaccionSerializable(oConn);
                    }
                    catch (Exception ex)
                    {
                        if (oConn.State == ConnectionState.Open)
                        {
                            Conexion.Cerrar(oConn);
                        }
                        sResul = "Error@#@" + Errores.mostrarError("Error al abrir la conexión", ex);
                        return(sResul);
                    }
                    #endregion

                    PROYECTOSUBNODO oPSN     = PROYECTOSUBNODO.Obtener(tr, int.Parse(aProyecto[0]));
                    SUBNODO         oSubnodo = SUBNODO.Obtener(tr, int.Parse(aProyecto[4]));

                    if (oPSN.t303_idnodo != oSubnodo.t303_idnodo)
                    {
                        throw (new NullReferenceException("El " + Estructura.getDefLarga(Estructura.sTipoElem.NODO) + " del proyecto y el " + Estructura.getDefLarga(Estructura.sTipoElem.NODO) + " del " + Estructura.getDefLarga(Estructura.sTipoElem.SUBNODO) + " destino no coinciden, por lo que no se puede realizar la reasignación."));
                    }

                    PROYECTOSUBNODO.UpdateReasignacion(tr, idPSN, responsable_destino, subnodo_destino);

                    //update proceso OK
                    REASIGNACIONPSN.Modificar(null, idPSN, (int)Session["UsuarioActual"], responsable_destino, subnodo_destino, true, "");

                    Conexion.CommitTransaccion(tr);
                }
                catch (Exception ex)
                {
                    Conexion.CerrarTransaccion(tr);
                    //update proceso KO
                    REASIGNACIONPSN.Modificar(null, idPSN, (int)Session["UsuarioActual"], responsable_destino, subnodo_destino, false, ex.Message);
                    sResul = "Error@#@" + Errores.mostrarError("Error al procesar la reasignación.", ex);
                }
                finally
                {
                    Conexion.Cerrar(oConn);
                }
            }// fin foreach
            sResul = "OK";
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al procesar la reasignación.", ex);
        }
        return(sResul);
    }
Beispiel #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;
        }
    }
Beispiel #5
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; }
                }

                if ((bool)Session["MODOLECTURA_PROYECTOSUBNODO"])
                {
                    sLecturaInsMes = "true";
                }

                PROYECTOSUBNODO oPSN = PROYECTOSUBNODO.Obtener(null, int.Parse(Request.QueryString["nPSN"].ToString()));
                sModeloImputacionGasvi = oPSN.t305_importaciongasvi.ToString();

                #region Monedas y denominaciones
                sMonedaProyecto             = Session["MONEDA_PROYECTOSUBNODO"].ToString();
                lblMonedaProyecto.InnerText = MONEDA.getDenominacion(Session["MONEDA_PROYECTOSUBNODO"].ToString());

                if (Session["MONEDA_VDP"] == null)
                {
                    sMonedaImportes             = sMonedaProyecto;
                    lblMonedaImportes.InnerText = MONEDA.getDenominacionImportes(sMonedaImportes);
                }
                else
                {
                    sMonedaImportes             = Session["MONEDA_VDP"].ToString();
                    lblMonedaImportes.InnerText = MONEDA.getDenominacionImportes(Session["MONEDA_VDP"].ToString());
                }
                #endregion

                //if (User.IsInRole("DIS") || ConfigurationManager.AppSettings["MOSTRAR_SOLODIS"] == "0")
                divMonedaImportes.Style.Add("visibility", "visible");

                string   strTabla = getDatos(Request.QueryString["nSegMesProy"], Request.QueryString["sEstadoMes"], Request.QueryString["sEstadoProy"], sModeloImputacionGasvi, sMonedaImportes);
                string[] aTabla   = Regex.Split(strTabla, "@#@");
                if (aTabla[0] != "Error")
                {
                    this.strTablaHTML  = aTabla[1];
                    this.strTablaHTML2 = aTabla[2];
                }
                else
                {
                    sErrores = aTabla[1];
                }
            }
            catch (Exception ex)
            {
                this.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);
        }
    }