zoukankan      html  css  js  c++  java
  • DateTable导出添加时间段

    --定义字段  
     String mCostStartDate = RequestHelper.GetQueryString("CostStartDate");
        String mCostEndDate = RequestHelper.GetQueryString("CostEndDate");

    --带上字段
        mDicInputParam.Add(new DbParam("CostStartDate", mCostStartDate));
        mDicInputParam.Add(new DbParam("CostEndDate", mCostEndDate));
    --时间选择不显示缺少的JS引用
        <%=HtmlControlHelper.GetRelJs(ResolveUrl("~/Res/Datepicker/WdatePicker.js"))%>
    --导出时的参数不能少
     $('#btnExport').click(function () {
                             var mCostStartDate = document.getElementById("CostStartDate").value;
                             var mCostEndDate = document.getElementById("CostEndDate").value;
                             var sUrl = "<%=RequestHelper.GetPageName()%>?IsExport=1&CostStartDate="+mCostStartDate+"&CostEndDate="+mCostEndDate;
                             window.open(sUrl);
                             return false;
                         });
    --查询参数要正确
    $('#btnQuery').click(function () {
                             var mCostStartDate = $('#CostStartDate').val();
                             var mCostEndDate = $('#CostEndDate').val();
                             var sUrl = "<%=RequestHelper.GetPageName() %>?CostStartDate=" + mCostStartDate + "&CostEndDate=" + mCostEndDate;
                             location.href = sUrl;
                             return false;
                         });

    --选择框
     <table>
            <tr>
                <td style="padding-left: 4px; 80px;">
                    开始时间:
                </td>
                <td>
                    <%=HtmlControlHelper.GetDateTime("CostStartDate", mCostStartDate, "", "")%>
                </td>
                <td>
                    结束时间:
                </td>
                <td>
                    <%=HtmlControlHelper.GetDateTime("CostEndDate", mCostEndDate, "", "")%>
                </td>
                <td>
                    <%=HtmlControlHelper.GetHrefInfo("btnQuery", "查询", "Javascript:void(0);", "toolMenu", "")%>
                </td>
            </tr>
        </table>

    --存储过程条件要正确,4种情况:前为空,后为空,两者都为空,两者都不为空
    WHERE (Asset_Contract_ChargePlan.CostStartDate between @pi_CostStartDate and @pi_CostEndDate or @pi_CostStartDate='' or @pi_CostEndDate='')

  • 相关阅读:
    asp.net 添加引用类型自动变为GAC
    FPDFCJK.BIN下载(Foxit Reader中/日/韩CJK文字符支持包)
    Failed to access IIS metabase.
    Failed to access IIS metabase.
    判断用户计算机是否安装了sql server
    (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer)
    当你被利用的价值越来越小时,路会越来越窄.
    tomcat 6.0如何配置虚拟目录?tomcat 6.0 不能列目录?
    史上最高科技,Big Data奥运
    基于ping命令的网络故障排查方法
  • 原文地址:https://www.cnblogs.com/howie/p/2734866.html
Copyright © 2011-2022 走看看