Exemple #1
0
    private string GetProfesionales3(int idPSN, bool bConPerfil)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<table id='tblProf3' class='texto' style='width:440px;'>");
        sb.Append("<colgroup><col style='width:40px;'/><col style='width:20px;'/><col style='width:380px;'/></colgroup>");

        SqlDataReader dr = USUARIOPROYECTOSUBNODO.CatalogoUsuariosPerfil(idPSN, bConPerfil);

        while (dr.Read())
        {
            sb.Append("<tr id='" + dr["t314_idusuario"].ToString() + "'");
            sb.Append(" perf='" + dr["t333_idperfilproy"].ToString() + "'");
            sb.Append(" tipo='" + dr["tipo"].ToString() + "'");
            sb.Append(" sexo='" + dr["t001_sexo"].ToString() + "'");
            sb.Append(" desnodo=\"" + Utilidades.escape(dr["t303_denominacion"].ToString()) + "\"");
            sb.Append(" desempresa=\"" + Utilidades.escape(dr["empresa"].ToString()) + "\"");
            sb.Append(" style='height:20px'>");

            sb.Append("<td><input type='checkbox' style='width:30px' class='checkTabla'></td>");
            sb.Append("<td></td><td>" + dr["profesional"].ToString() + "</td></tr>");
        }
        sb.Append("</table>");
        dr.Close();
        dr.Dispose();

        return(sb.ToString());
    }
Exemple #2
0
    private string GetProfesionales2(int idPSN, bool bConPerfil)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<table id='tblProf2' class='texto' style='width:370px;'>");
        sb.Append("<colgroup><col style='width:20px;'/><col style='width:210px;'/><col style='width:140px;'/></colgroup>");

        SqlDataReader dr = USUARIOPROYECTOSUBNODO.CatalogoUsuariosPerfil(idPSN, bConPerfil);

        while (dr.Read())
        {
            sb.Append("<tr id='" + dr["t314_idusuario"].ToString() + "'");
            sb.Append(" perf='" + dr["t333_idperfilproy"].ToString() + "'");
            sb.Append(" tipo='" + dr["tipo"].ToString() + "'");
            sb.Append(" sexo='" + dr["t001_sexo"].ToString() + "'");
            sb.Append(" desnodo=\"" + Utilidades.escape(dr["t303_denominacion"].ToString()) + "\"");
            sb.Append(" desempresa=\"" + Utilidades.escape(dr["empresa"].ToString()) + "\"");
            sb.Append(" style='height:20px' onclick='ms(this);borrarTareas();getEstructura(this.id, this.perf)'>");

            sb.Append("<td></td><td>" + dr["profesional"].ToString() + "</td>");
            sb.Append("<td  title='" + dr["t333_denominacion"].ToString() + "'><nobr class='NBR W140'>" + dr["t333_denominacion"].ToString() + "</nobr></td></tr>");
        }
        sb.Append("</table>");
        dr.Close();
        dr.Dispose();

        return(sb.ToString());
    }
Exemple #3
0
    private string getUsuarios(int idPSN, string sCualidad, string sMostrarBajas)
    {
        string        sResul = "";
        StringBuilder sb     = new StringBuilder();

        try
        {
            SqlDataReader dr = null;

            if (sCualidad == "J")
            {
                dr = USUARIOPROYECTOSUBNODO.CatalogoUsuariosRepJ(idPSN, (sMostrarBajas == "1") ? true : false);
            }
            else
            {
                dr = USUARIOPROYECTOSUBNODO.CatalogoUsuarios(idPSN, sCualidad, (sMostrarBajas == "1") ? true : false);
            }

            sb.Append("<TABLE id='tblDatos' class='texto MAM' style='width: 430px;'>");
            sb.Append("<colgroup>");
            sb.Append("    <col style='width: 20px;' />");
            sb.Append("    <col style='width: 210px;' />");
            sb.Append("    <col style='width: 200px;' />");
            sb.Append("</colgroup>");
            sb.Append("<tbody>");
            while (dr.Read())
            {
                sb.Append("<tr id='" + dr["t314_idusuario"].ToString() + "' ");
                sb.Append("tipo='" + dr["tipo"].ToString() + "' ");
                sb.Append("sexo='" + dr["t001_sexo"].ToString() + "' ");
                sb.Append("alta='" + dr["t314_falta"].ToString().Substring(0, 10) + "' ");
                sb.Append("baja='" + dr["baja"].ToString() + "' ");
                sb.Append("desnodo=\"" + Utilidades.escape(dr["t303_denominacion"].ToString()) + "\" ");
                //sb.Append("desempresa=\"" + Utilidades.escape(dr["empresa"].ToString()) + "\" ");
                sb.Append("idCal='" + dr["t066_idcal"].ToString() + "' ");
                sb.Append("onclick='mm(event)' ondblclick='insertarRecurso(this)' onmousedown='DD(event)' ");
                sb.Append("style='height:20px' >");
                //sb.Append("<td>" + int.Parse(dr["t314_idusuario"].ToString()).ToString("#,###") + "</td>");
                //sb.Append("<td></td><td><nobr class='NBR W210' style='noWrap:true;' title=\"cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../../images/info.gif' style='vertical-align:middle' />  Información] body=[<label style='width:60px;'>Profesional:</label>" + dr["Profesional"].ToString().Replace((char)34, (char)39) + "<br><label style='width:60px;'>Usuario:</label>" + int.Parse(dr["t314_idusuario"].ToString()).ToString("#,###") + "<br><label style='width:60px;'>" + Estructura.getDefCorta(Estructura.sTipoElem.NODO) + ":</label>" + dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "<br><label style='width:60px;'>Empresa:</label>" + dr["empresa"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\">" + dr["Profesional"].ToString() + "</nobr></td>");
                sb.Append("<td align='center'></td><td style='padding-left:5px;'><nobr class='NBR W205' style='noWrap:true;' title=\"cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../../images/info.gif' style='vertical-align:middle' />  Información] body=[<label style='width:60px;'>Profesional:</label>" + dr["Profesional"].ToString().Replace((char)34, (char)39) + "<br><label style='width:60px;'>Usuario:</label>" + int.Parse(dr["t314_idusuario"].ToString()).ToString("#,###") + "<br><label style='width:60px;'>" + Estructura.getDefCorta(Estructura.sTipoElem.NODO) + ":</label>" + dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\">" + dr["Profesional"].ToString() + "</nobr></td>");

                sb.Append("<td style='padding-left:5px;'><nobr class='NBR W198' style='noWrap:true;' title=\"" + dr["t066_descal"].ToString() + "\" >" + dr["t066_descal"].ToString() + "</nobr></td>");

                sb.Append("</tr>");
            }
            dr.Close();
            dr.Dispose();
            sb.Append("</tbody>");
            sb.Append("</table>");

            sResul = sb.ToString();
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al obtener la relación de profesionales.", ex);
        }

        return(sResul);
    }
Exemple #4
0
    private string PonerRecurso(int IdRecurso, int IdNodo, int iUltCierreEco, int IdPsn,
                                bool bDeriva, decimal costecon, decimal costerep, bool bNotif)
    {
        SqlConnection  oConn  = null;
        SqlTransaction tr     = null;
        string         sResul = "";

        try
        {
            oConn = Conexion.Abrir();
            tr    = Conexion.AbrirTransaccion(oConn);
            //lA FECHA DE alta en el proyecto será la siguiente al último mes cerrado del nodo
            DateTime dtFechaAlta = Fechas.AnnomesAFecha(Fechas.AddAnnomes(iUltCierreEco, 1));
            if (!TareaRecurso.AsociadoAProyecto(tr, IdPsn, IdRecurso))
            {
                //TareaRecurso.AsociarAProyecto(tr, IdNodo, IdRecurso, IdPsn, null, dtFechaAlta, null);
                //if (costecon == null) costecon = 0;
                USUARIOPROYECTOSUBNODO.Insert(tr, IdPsn, IdRecurso, costecon, costerep, bDeriva, dtFechaAlta, null, null);
            }
            else
            {
                //TareaRecurso.ReAsociarAProyecto(tr, IdRecurso, IdPsn);
                if (!USUARIOPROYECTOSUBNODO.AsociadoDeAltaProyecto(tr, IdPsn, IdRecurso))
                {
                    USUARIOPROYECTOSUBNODO.Update(tr, IdPsn, IdRecurso, costecon, costerep, bDeriva, dtFechaAlta, null, null);
                }
            }
            Conexion.CommitTransaccion(tr);
        }
        catch (Exception ex)
        {
            Conexion.CerrarTransaccion(tr);
            sResul = Errores.mostrarError("Error al grabar", ex);
        }
        finally
        {
            Conexion.Cerrar(oConn);
        }
        return(sResul);
    }
Exemple #5
0
    private string GetProfesionales(int idPSN, bool bConPerfil)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<table id='tblDatos' class='texto' style='width:700px;'>");
        //sb.Append(" class='texto MANO' style='width:700px;table-layout:fixed;' cellSpacing='0' border='0'>");
        sb.Append("<colgroup>");
        sb.Append(" <col style='width:20px;' />");
        sb.Append(" <col style='width:450px;' />");
        sb.Append(" <col style='width:230px;' />");
        sb.Append("</colgroup>");

        SqlDataReader dr = USUARIOPROYECTOSUBNODO.CatalogoUsuariosPerfil(idPSN, bConPerfil);

        while (dr.Read())
        {
            sb.Append("<tr id='" + dr["t314_idusuario"].ToString() + "'");
            sb.Append("perf='" + dr["t333_idperfilproy"].ToString() + "' ");
            sb.Append("tipo='" + dr["tipo"].ToString() + "' ");
            sb.Append("sexo='" + dr["t001_sexo"].ToString() + "'");
            sb.Append("desnodo=\"" + Utilidades.escape(dr["t303_denominacion"].ToString()) + "\" ");
            sb.Append("desempresa=\"" + Utilidades.escape(dr["empresa"].ToString()) + "\" ");
            //sb.Append("desofi=\"" + Utilidades.escape(dr["T010_DESOFICINA"].ToString()) + "\" ");
            sb.Append("style='height:20px' >");
            //sb.Append("style='height:20px' onclick='msse(this);'>");

            sb.Append("<td></td><td>" + dr["profesional"].ToString() + "</td>");
            sb.Append("<td><nobr class='NBR W230' >" + dr["t333_denominacion"].ToString() + "</nobr></td></tr>");
        }
        dr.Close();
        dr.Dispose();
        sb.Append("</table>");
        strTablaHtml = sb.ToString();

        return("OK@#@" + sb.ToString());
    }
Exemple #6
0
    private string Grabar(string sRecursos, string sProys)
    {
        string  sResul = "", sItem;
        int     idPSN, idUser;
        bool    bDeriva, bNotif = false;
        decimal costecon = 0, costerep = 0;

        try
        {
            if (sRecursos == "" || sProys == "")
            {//Tenemos lista vacía. No hacemos nada
            }
            else
            {//Con la cadenas generamos listas y las recorremos para grabar cada elemento
                string[] aRecursos = Regex.Split(sRecursos, @"##");
                for (int i = 0; i < aRecursos.Length; i++)
                {
                    idUser = int.Parse(aRecursos[i]);

                    string[] aItems = Regex.Split(sProys, @"##");
                    for (int j = 0; j < aItems.Length; j++)
                    {
                        sItem = aItems[j];
                        string[] aIt = Regex.Split(sItem, @",");
                        idPSN = int.Parse(aIt[0]);
                        if (aIt[3] == "T")
                        {
                            bDeriva = true;
                        }
                        else
                        {
                            bDeriva = false;
                        }
                        costecon = 0;
                        costerep = 0;
                        SqlDataReader dr = USUARIOPROYECTOSUBNODO.GetCoste(idPSN, idUser);
                        if (dr.Read())
                        {
                            costecon = decimal.Parse(dr["coste_con"].ToString());
                            costerep = decimal.Parse(dr["coste_rep"].ToString());
                        }
                        dr.Close();
                        dr.Dispose();
                        //ID item, id nodo, anomes del ultimo cierre economico, id proyectosubnodo
                        sResul += PonerRecurso(idUser, int.Parse(aIt[1]), int.Parse(aIt[2]), idPSN, bDeriva, costecon, costerep, bNotif);
                    }
                }//for
            }
            if (sResul != "")
            {
                sResul = "Error@#@" + sResul;
            }
            else
            {
                sResul = "OK@#@";
            }
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al grabar", ex);
        }
        return(sResul);
    }
Exemple #7
0
    private string Grabar(string sPSN, string sRecursos, string t305_avisorecursopst)
    {
        string  sResul = "", sItem;
        int     idPSN = int.Parse(sPSN), idUser;
        bool    bDeriva, bNotif;
        decimal costecon = 0, costerep = 0;

        try
        {
            if (sPSN == "" || sRecursos == "")
            {//Tenemos lista vacía. No hacemos nada
            }
            else
            {//Con la cadena generamos una lista y la recorremos para grabar cada elemento
                string[] aRecursos = Regex.Split(sRecursos, @"##");
                for (int i = 0; i < aRecursos.Length; i++)
                {
                    sItem = aRecursos[i];
                    string[] aIt = Regex.Split(sItem, @",");

                    idUser = int.Parse(aIt[0]);
                    if (aIt[3] == "T")
                    {
                        bDeriva = true;
                    }
                    else
                    {
                        bDeriva = false;
                    }

                    if (t305_avisorecursopst == "S")
                    {
                        bNotif = true;
                    }
                    else
                    {
                        bNotif = false;
                    }

                    costecon = 0;
                    costerep = 0;

                    SqlDataReader dr = USUARIOPROYECTOSUBNODO.GetCoste(idPSN, idUser);
                    if (dr.Read())
                    {
                        costecon = decimal.Parse(dr["coste_con"].ToString());
                        costerep = decimal.Parse(dr["coste_rep"].ToString());
                    }
                    dr.Close();
                    dr.Dispose();
                    sResul += PonerRecurso(idUser, int.Parse(aIt[2]), idPSN, bDeriva, costecon, costerep, bNotif);
                }//for
            }
            if (sResul != "")
            {
                sResul = "Error@#@" + sResul;
            }
            else
            {
                sResul = "OK@#@";
            }
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al grabar", ex);
        }
        return(sResul);
    }
Exemple #8
0
    private string ObtenerRecursos(string nPSN, string sCodUne)
    {// Devuelve el código HTML del catalogo de recursos asociados al proyecto
        StringBuilder sb = new StringBuilder();
        SqlDataReader dr;
        string        sDeriva;

        try
        {
            //sb.Append("<div style='background-image:url(../../../../Images/imgFT20.gif); width:460px; height:auto'>");
            sb.Append("<table id='tblOpciones3' class='texto' style='WIDTH: 460px;'>");
            sb.Append("<colgroup><col style='width:20px;'/><col style='width:420px'/><col style='width:20px'/></colgroup>");//style='padding-left:5px'
            sb.Append("<tbody>");
            if (nPSN != "")
            {
                dr = USUARIOPROYECTOSUBNODO.CatalogoUsuarios(int.Parse(nPSN), "C", false);
                while (dr.Read())
                {
                    sb.Append("<tr style='height:20px; noWrap:true;' bd='' id='" + dr["t314_idusuario"].ToString() + "' ");
                    //sb.Append("estado='" + dr["t336_estado"].ToString() + "' ");
                    sb.Append("sexo='" + dr["t001_sexo"].ToString() + "' ");
                    //sb.Append("baja='" + dr["baja"].ToString() + "' ");

                    //if (dr["t303_idnodo"].ToString() == "") sb.Append("tipo='E' ");
                    //else if (dr["t303_idnodo"].ToString() == sCodUne) sb.Append("tipo='P' ");
                    //else sb.Append("tipo='N' ");
                    sb.Append("tipo='" + dr["tipo"].ToString() + "' ");
                    sb.Append("nodo='" + dr["t303_idnodo"].ToString() + "' ");
                    sb.Append("cierre='" + dr["t303_ultcierreeco"].ToString() + "' ");

                    if ((bool)dr["t330_deriva"])
                    {
                        sDeriva = "T";
                    }
                    else
                    {
                        sDeriva = "F";
                    }
                    sb.Append("deriva='" + sDeriva + "' ");

                    sb.Append("title=\"cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../../images/info.gif' style='vertical-align:middle'> ");
                    sb.Append("Información] body=[<label style='width:60px'>Profesional&nbsp;:</label>");
                    sb.Append(dr["profesional"].ToString().Replace((char)34, (char)39));

                    sb.Append("<br><label style='width:60px'>Usuario&nbsp;:</label>");
                    sb.Append(int.Parse(dr["t314_idusuario"].ToString()).ToString("#,###"));

                    sb.Append("<br><label style='width:60px'>" + Estructura.getDefCorta(Estructura.sTipoElem.NODO) + "&nbsp;:</label>");
                    //sb.Append(dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "<br><label style='width:60px'>Empresa&nbsp;:</label>");
                    //sb.Append(dr["EMPRESA"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\"");
                    sb.Append(dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\"");

                    sb.Append("><td style='vertical-align:top;'></td><td><nobr class='NBR' style='width:410px;'>" + dr["Profesional"].ToString() + "</nobr></td>");
                    sb.Append("<td style='vertical-align:middle;'><input type='checkbox' style='width:15px; height:15px;' class='checkTabla' checked='true'></td>");
                    sb.Append("</tr>");
                }
                sb.Append("</tbody>");
                sb.Append("</table></div>");
                dr.Close(); dr.Dispose();
            }
            return("OK@#@" + sb.ToString());
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al obtener los profesionales ", ex));
        }
    }