Web/Views/NewsMain/NewsList.cshtml

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

@model Conris.Controls.MVC.PagedList<Conris.DBA.Model.NewsMain>
@using Conris.Controls.MVC
@using Conris.Services
 <table class="tablelist">
    	<thead>
    	<tr>
        <th>序号<i class="sort"><img src="/Content/images/px.gif" /></i></th>
        <th>新闻标题</th>
            <th>栏目</th>
              <th>发布时间</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
              @if (Model != null && Model.Count > 0)
{
    int i = 0; 
       
            foreach (var item in Model)
        {
            Conris.Services.CategoryService cateserver = new CategoryService();
            i++;    
        <tr>
        <td>@i</td>
        <td>  <a href="@Url.Action("NewsCreate", "NewsMain", new { ID = @item.ID })">@item.Title</a></td>
            <td>@cateserver.GetDepartmentName(item.Category)</td>
             <td>@Convert.ToDateTime(item.CreateTime).ToString("yyyy-MM-dd")</td>
        <td> <a href="/NewsMain/NewsDetail?ID=@item.ID" target="_blank"  >查看</a>           
            <a href="/NewsMain/NewsCreate?ID=@item.ID"   >修改</a> 
            <a href="#"  onclick="DelNews(this)" id="@item.ID">删除</a>
            </td>
        </tr>    
            }
} 
        </tbody>
    </table>
    

 <div class="pagination pagination-centered">
    	  @Html.Pager(Model, new PagerOptions { ShowFirstLast = false, PrevPageText = "上一页", NextPageText = "下一页", AlwaysShowFirstLastPageNumber = true }, "Paged", new { action = "NewsManager" })
    </div>
    
<script type="text/ecmascript">
    function DownNews(obj) {
        var href = encodeURIComponent($(obj).attr("id"));
        $("#aDown").attr("href", "/Document/DownloadFile?attachment=" + href);
    }

    function DelNews(obj) {
        var isdel = confirm("确定删除该新闻?");
        if (isdel) {
            var ID = $(obj).attr("id");
            $.ajax({
                type: "post",
                traditional: true,
                url: "/NewsMain/DelNews",
                data: { ID: ID },
                datatpye: "json",
                success: function (data) {
                    if (data) {
后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。