文件过期提醒功能

数据库脚本:

create view view_LiuYan
as
select 
mouldNo,
outUserName,
partName,
drawingNo,
rstartDate,

ostartDate,
oendDate,
supplierName , 
  case when DATEDIFF (D,GETDATE(),ostartDate)<=3 and DATEDIFF(D,GETDATE(),ostartDate)>0 then 'tryellow'
  when DATEDIFF(D,GETDATE(),ostartDate)<=0 then 'trred' else ''  end trclass,
  contractNO
 from liuyan
 

页面处理

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Maxuni.Entity.VOutProceSchedule>>" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title>VOutProceSchedule</title>
    <style type="text/css">
      .trred
        {
            color:Red;
        }
        .tryellow
        {
            color: orange;
        }
        .trgreen
        {
            color:Green;
        }
    </style>
</head>
<body>
    <div class="pageHeader">
        <% using (Html.BeginForm("Index", "VOutProceSchedule", FormMethod.Post, new { id = "pagerForm", onsubmit = "return navTabSearch(this);" }))
           {%><%=Html.Hidden("pageNum", ViewData["pageNum"])%>
        <%=Html.Hidden("numPerPage", ViewData["numPerPage"])%>
        <%=Html.Hidden("totalcount", ViewData["totalcount"])%>
        <%=Html.Hidden("pagenumshown", ViewData["pagenumshown"])%>
        <%=Html.Hidden("wid", ViewData["wid"])%>
        <%=Html.Hidden("mid", ViewData["mid"])%>
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        模具编号:
                        <input name="outSchedule.partNo" value="<%=ViewData["partNo"] %>" type="text" suggestfields="partNo"
                            size="20" suggesturl="basematerialGl/MouldInfo/GetMouldNo" lookupgroup="outSchedule" />
                        &nbsp;&nbsp;&nbsp;
                    </td>
                    <td>
                        零件:
                        <input name="mpartname" value="<%=ViewData["mpartname"] %>" size="20" />
                    </td>
                    <td>
                        图号:
                        <input name="mpartno" value="<%=ViewData["mpartno"] %>" size="20" />
                    </td>
                    <td>
                        实际发出日期:
                        <input type="text" value='<%=ViewData["ostartDate"] %>' readonly="readonly" class="date"
                            name="dateStart" />
                    </td>
                    <td>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button></div>
                        </div>
                    </td>
                </tr>
            </table>
            <span style="color: Red">提示:(<span style="background-color: violet"> 红色</span>的代表,实际返还日间已经过期)&nbsp;&nbsp;(<span
                style="background-color: Yellow"> 黄色</span>的代表(3-1)天,将要到期,要催货了) </span>
                   (<span style="background-color:green"> 绿色</span>的代表:外协已返回来)</span>         
        </div>
        <%} %></div>
    <div class="pageContent">
        <%--  <div class="panelBar">
     <ul class="toolBar">
                <li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" posttype="string" href="VOutProceSchedule/BachDelete"
                    class="delete"><span>删除</span></a></li><li class="line">line</li>
            </ul>
        </div>--%>
        <table class="table" width="100%" layouth="100">
            <thead>
                <tr>
                    <%-- <th width="22">
                        <input type="checkbox" group="ids" class="checkboxCtrl">
                    </th>--%>
                    <th>
                        模具编号
                    </th>
                    <th>
                        外协发出人
                    </th>
                    <th>
                        零件名称
                    </th>
                    <th>
                        图号
                    </th>
                    <th>
                        申请外协加工日期
                    </th>
                    <%--          <th>
                        计划外协返回日期
                    </th>--%>
                    <th>
                        实际发出日期
                    </th>
                    <th>
                        实际返回日期
                    </th>
                    <th>
                        供应商
                    </th>
                    <th>
                        备注
                    </th>
                    <th>
                        外协发出单号
                    </th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var item in Model)
                   { %><tr target="sid_user" rel="<%: item.Id %>" class="<%: item.trclass %>">
                       <%--                       <td>
                           <input name="ids" value="<%: item.Id %>" type="checkbox">
                       </td>--%>
                       <td>
                           <%: item.mouldNo %>
                       </td>
                       <td>
                           <%: item.outUserName %>
                       </td>
                       <td>
                           <%: item.partName %>
                       </td>
                       <td>
                           <%: item.drawingNo %>
                       </td>
                       <td>
                           <%: item.rstartDate.ToString("yyyy-MM-dd HH")%>
                       </td>
                       <td>
                           <%:item.ostartDate == null ? "" : item.ostartDate.Value.ToString("yyyy-MM-dd HH")%>
                       </td>
                       <td>
                           <%:item.oendDate == null ? "" : item.oendDate.Value.ToString("yyyy-MM-dd HH")%>
                       </td>
                       <td>
                           <%: item.supplierName %>
                       </td>
                       <td>
                           <%: item.workflownode %>
                       </td>
                       <td>
                           <%: item.contractNO %>
                       </td>
                   </tr>
                <% } %>
            </tbody>
        </table>
        <div class="panelBar">
            <div class="pages">
                <span>总共:<%=ViewData["totalcount"]%>条记录</span>
            </div>
            <div class="pagination" targettype="navTab" totalcount='<%=ViewData["totalcount"]%>'
                numperpage='<%=ViewData["numperpage"]%>' pagenumshown='<%=ViewData["pagenumshown"]%>'
                currentpage='<%=ViewData["currentpage"]%>'>
            </div>
        </div>
    </div>
</body>
</html>
原文地址:https://www.cnblogs.com/liuwj/p/3421725.html