zoukankan      html  css  js  c++  java
  • 动态生成Table

    Script:

     <tr>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanRiskFactors"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanGoals/Instructions"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanInterventions"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewPlanMedications"]%>

                        <%=ViewState["ViewCarePlanOtherMedications"]%>

                    </table>

                </td>

                <td valign="top">

               <asp:Label runat="server" ID="lblPractitioner"/>

                </td>

            </tr>

    Code:

        protected void CreateSectionAndItemStrBasic(Dictionary<string, MyBasicProtocolStructure[]> dictStruc,

                Dictionary<string, MyPatientProtocolItem[]> dictPatientItem,ref string str, string prefixstr, string parentId)

            {

                if (dictStruc.ContainsKey(parentId))

                {

                    MyBasicProtocolStructure[] myBasicProtocolStruList = dictStruc[parentId] as MyBasicProtocolStructure[];

                    foreach (MyBasicProtocolStructure myBasicProtocolStruc in myBasicProtocolStruList)

                    {

                        str += "<tr><td>" + prefixstr + myBasicProtocolStruc.Name + "</td></tr>";

     

                        CreateSectionAndItemStrBasic(dictStruc, dictPatientItem, ref str, "&nbsp;&nbsp;&nbsp;&nbsp;" + prefixstr, myBasicProtocolStruc.Id);

                    }

                }

                if (dictPatientItem.ContainsKey(parentId))

                {

                    MyPatientProtocolItem[] myPatientProtocolItemList = dictPatientItem[parentId] as MyPatientProtocolItem[];

     

                    foreach (MyPatientProtocolItem myPatientProtocolItem in myPatientProtocolItemList)

                    {

                        str += "<tr><td>" + prefixstr + myPatientProtocolItem.Content + "</td></tr>";

                    }

                }

            }

  • 相关阅读:
    Google黑板报上连载的长文
    sql server2000 数据同步
    sql server 2000 数据同步(2)
    reset sql server express sa password
    Fetion分析之二:服务器地址从何而来——变态的配置文件(转)
    CentOS软件安装血泪经验(转)
    《Unix & Linux 大学教程》(转)
    有关CentOS6的man报错
    linux 命令行学习笔记
    ubuntu 無法掛載ntfs分區
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2283953.html
Copyright © 2011-2022 走看看