示例#1
0
    protected string Grabar(string strDatos)
    {
        string sResul = "";

        IB.SUPER.SIC.BLL.ReceptoresAvisos oLista = new IB.SUPER.SIC.BLL.ReceptoresAvisos();
        try
        {
            #region Genero lista de objetos
            List <IB.SUPER.SIC.Models.ReceptoresAvisos> Catalogo = new List <IB.SUPER.SIC.Models.ReceptoresAvisos>();
            string[] aClase = Regex.Split(strDatos, "///");
            foreach (string oClase in aClase)
            {
                if (oClase == "")
                {
                    continue;
                }
                string[] aValores = Regex.Split(oClase, "##");
                //0. ID Profesional
                //3. avisar

                IB.SUPER.SIC.Models.ReceptoresAvisos oElem = new IB.SUPER.SIC.Models.ReceptoresAvisos();
                oElem.bd            = "U";
                oElem.t001_idficepi = int.Parse(aValores[0]);
                if (aValores[1] == "0")
                {
                    oElem.t399_avisopreventa = false;
                }
                else
                {
                    oElem.t399_avisopreventa = true;
                }

                Catalogo.Add(oElem);
            }
            #endregion

            oLista.GrabarLista(Catalogo);

            sResul = "OK@#@";
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al grabar.", ex, false);
        }
        finally
        {
            oLista.Dispose();
        }
        return(sResul);
    }
示例#2
0
    private string Catalogo()
    {
        StringBuilder sb   = new StringBuilder();
        string        sRes = "";

        sb.Append("<table id='tblDatos' class='texto' style='width:500px; text-align:left;' mantenimiento='1' border='0'>");
        sb.Append("<colgroup><col style='width:20px;' /><col style='width:430px;'><col style='width:50px;'></colgroup>");
        sb.Append("<tbody>");

        IB.SUPER.SIC.BLL.ReceptoresAvisos oP = new IB.SUPER.SIC.BLL.ReceptoresAvisos();
        try
        {
            List <IB.SUPER.SIC.Models.ReceptoresAvisos> oLista = oP.Catalogo();
            foreach (IB.SUPER.SIC.Models.ReceptoresAvisos oElem in oLista)
            {
                sb.Append("<tr bd='' id='" + oElem.t001_idficepi.ToString() + "' style='height:20px'>");
                sb.Append("<td><img src='../../../../../images/imgFN.gif' /></td>");
                sb.Append("<td onmouseover='TTip(event)' style='width:430px;'><span class='NBR W420'>" + oElem.denProfesional + "</span></td>");
                sb.Append("<td><input type='checkbox' class='check MANO' style='width:15px;margin-left:15px;' onclick='setFila(this.parentElement.parentElement)' ");
                if (oElem.t399_avisopreventa)
                {
                    sb.Append(" checked='true' /></td>");
                }
                else
                {
                    sb.Append(" /></td>");
                }
                sb.Append("</tr>");
            }
            sb.Append("</tbody>");
            sb.Append("</table>");
            strTablaHtml = sb.ToString();

            sRes = "OK@#@" + strTablaHtml;
        }
        catch (Exception ex)
        {
            sErrores += Errores.mostrarError("Error al cargar la lista de receptores de avisos de preventa", ex);
            sRes      = "ERROR@#@" + ex.Message;
            this.hdnMensajeError.Text = ex.Message;
        }
        finally
        {
            oP.Dispose();
        }
        return(sRes);
    }