zoukankan      html  css  js  c++  java
  • asp.net Table,数据重复 合并

    在这后台代码就不些了主要是前提循环

    @{
        ViewBag.Title = "QueryDetails";
        Business.BLL.DC_ProductSkillPhysicalBLL bll = new Business.BLL.DC_ProductSkillPhysicalBLL();
        System.Data.DataSet ds = bll.GetListPhysicalFirsts();//取大项
        System.Data.DataTable dt = ds.Tables[0];
    }
    <style>
        .listtable thead tr th {
            text-align: center;
        }
    
        .date {
            margin-top: 40px;
        }
    
        .divs {
            word-wrap: break-word;
            word-break: normal;
        }
    </style>
    <style>
        .tdTitle {
            text-align: right;
        }
    
        .querybar table tr td {
            padding-top: 2px;
            padding-bottom: 2px;
        }
    
            .querybar table tr td input {
                 203px;
            }
    
            .querybar table tr td select {
                 208px;
            }
    </style>
    <link href="~/Scripts/CSS/peixun.css" rel="stylesheet" />
    
    <form method="post" id="searchform" name="searchform" action="/ProductSkillPhysical/Index?@ViewBag.Query" >
        <div>
            <table border="0" class="listtable" style="text-align: center;">
                <thead>
                    <tr>
                        <th>盘点大项</th>
                        <th>盘点小项</th>
                        <th>选项</th>
                        <th>填写说明——在系统的某个地方展示</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (System.Data.DataRow var in dt.Rows) //循环取大项
                    {
                        System.Data.DataRow dr = var;
                        List<Data.Model.DC_ProductSkillPhysical> list = bll.GetListPhysicalSecond(@dr["PhysicalFirsts"].ToString()); //取小项
                        int s = list.Count + 1;
    
                        var dtTable = new System.Data.DataTable(); 
                        <tr>
                            <td rowspan="@s">@dr["PhysicalFirsts"]</td>
                        </tr>                                         
                        foreach (DC_ProductSkillPhysical item in list) //循环取小项
                        {
                            dtTable = bll.GetListQuery(dr["PhysicalFirsts"].ToString(), item.PhysicalSecond); //取后两项
                            int tss = dtTable.Rows.Count;
                           
                        <tr>
                            <td>
                                @item.PhysicalSecond
                            </td>
                            <td>
                                <table>
                                    @foreach (System.Data.DataRow dat in dtTable.Rows)//循环取后两项
                                    {
                                        <tr>
                                            <td style="text-align:left" title="@dat["Options"]">@dat["Options"].ToString().CutString(25)</td>
                                        </tr>                         
                                    }
                                </table>
                            </td>
                            <td>
                                <table>
                                    @foreach (System.Data.DataRow dat in dtTable.Rows)//循环取后两项
                                    {
                                        <tr>
                                            <td style="text-align:left" title="@dat["Declares"].ToString()">
                                                @dat["Declares"].ToString().CutString(70)</td>
                                        </tr>                         
                                    }
                                </table>
                            </td>
                        </tr>
                        }
                    }
                </tbody>
            </table>
        </div>
    </form>
    <script type="text/javascript">
        var query = '@ViewBag.Query' + "&display=1";
        var dialog = top.mainDialog;
        var appid = '@ViewBag.AppID';
        var iframeid = '@ViewBag.Iframeid';
    </script>
  • 相关阅读:
    maven_常用命令
    tomcat_server.xml常用配置
    tomcat线程池原理
    Tomcat处理HTTP请求原理&线程池
    javaweb-javaScript(一)
    javaweb-html快速入门
    javaweb-css
    javaweb-单元测试与注解
    javaweb-文件的上传下载
    javaweb-jsp开发模式+JSON插件
  • 原文地址:https://www.cnblogs.com/zmmlczy/p/4498198.html
Copyright © 2011-2022 走看看