代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
C#
】
MVC循环产生数据
作者:
睿杰
/ 发布于
2016/9/6
/
834
@using Webdiyer.WebControls.Mvc; @model PagedList<MyLibrary.WEB_KEHU> @{ int count = Model.Count(); int i = 1; } @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>客户管理</title> <link rel="shortcut icon" href="favicon.ico"> <link href="~/Contents/css/bootstrap.min14ed.css" rel="stylesheet" /> <link href="~/Contents/css/font-awesome.min93e3.css" rel="stylesheet" /> <link href="~/Contents/css/plugins/sweetalert/sweetalert.css" rel="stylesheet" /> <link href="~/Contents/css/animate.min.css" rel="stylesheet" /> <link href="~/Contents/css/style.min862f.css" rel="stylesheet" /> <link href="~/Contents/css/Site.css" rel="stylesheet" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox "> <div class="ibox-title"> <h5>客户增减员</h5> </div> <div class="ibox-content"> <div class="bars pull-left" style="padding-bottom:10px;"> <div class="btn-group hidden-xs" id="exampleToolbar" role="group"> <button type="button" class="btn btn-outline btn-default" title="添加一条新记录" onclick="check()"> <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> </button> <button type="button" class="btn btn-outline btn-default" title="编辑"> <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> </button> <button type="button" class="btn btn-outline btn-default" title="删除" onclick="del();"> <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> </button> </div> </div> <div class="columns columns-right btn-group pull-right" style="padding-bottom:10px;"> <button class="btn btn-default btn-outline" type="button" name="toggle" title="查询"> <i class="glyphicon glyphicon-search"></i> </button> <button class="btn btn-default btn-outline" type="button" name="refresh" title="刷新"> <i class="glyphicon glyphicon-repeat"></i> </button> </div> <div class="pull-right search" style="padding-bottom:10px;padding-right:6px;"> <input class="form-control input-outline" placeholder="搜索" type="text"> </div> <div id="articles"> <table class="table table-bordered" id="lab"> <thead> <tr> <th>序号</th> <th>职工名</th> <th>身份证号码</th> <th>大公司名称</th> <th>小公司名称</th> <th>户口身份</th> <th>社保基数</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 id="@Html.DisplayFor(modelItem => item.K_ID)" onclick="show(this.id);"> @{ if (i <= count) { <td>@i</td> i++; } <td>@Html.DisplayFor(modelItem => item.K_NAME)</td> <td>@Html.DisplayFor(modelItem => item.K_SFZID)</td> <td>@Html.DisplayFor(modelItem => item.K_DGS)</td> <td>@Html.DisplayFor(modelItem => item.K_XGS)</td> <td>@Html.DisplayFor(modelItem => item.K_YGSF)</td> <td>@Html.DisplayFor(modelItem => item.K_SBJS)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJJS)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJDWBL)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJGRBL)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJDWJNE)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJGRJNE)</td> <td>@Html.DisplayFor(modelItem => item.K_SBKSSJ)</td> <td>@Html.DisplayFor(modelItem => item.K_GJJKSSJ)</td> <td>@Html.DisplayFor(modelItem => item.K_HTKSSJ)</td> <td>@Html.DisplayFor(modelItem => item.K_HTJSSJ)</td> <td>@Html.DisplayFor(modelItem => item.K_WTD)</td> <td>@Html.DisplayFor(modelItem => item.K_BS)</td> } </tr> } } </tbody> </table> </div> <div class="text-center"> @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>" }).AjaxOptions(a => a.SetUpdateTargetId("articles")) </div> </div> </div> </div> <script src="~/Contents/js/jquery.min.js"></script> <script src="~/Contents/js/bootstrap.min.js"></script> <script src="~/Contents/js/content.min.js"></script> <script src="~/Contents/js/ajax_gl.js" type="text/javascript"></script> <script src="~/Contents/js/plugins/sweetalert/sweetalert.min.js"></script> </body> <!-- Mirrored from www.zi-han.net/theme/hplus/table_bootstrap.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:06 GMT --> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MyLibrary; using Webdiyer.WebControls.Mvc; namespace web.Controllers { public class HomeController : Controller { private Entities et = new Entities(); // GET: Home public ActionResult Index() { return View(); } public void delzg() { decimal id = decimal .Parse(Request.Params["id"]); var shanchu = et.WEB_KEHU.FirstOrDefault(k=>k.K_ID==id); et.WEB_KEHU.Remove(shanchu); et.SaveChanges(); Response.Write("1"); } public ActionResult AjaxPaging(int id = 1) { var model= et.WEB_KEHU.OrderByDescending(a=>a.K_ID).ToPagedList(id, 5); //Session["page"] = id; //int count = model.Count(); string sj = DateTime.Now.ToString("yyyyMMddhhmmss"); return View(model); } public ActionResult search() { return View(); } } }
试试其它关键字
同语言下
.
C#实现的html内容截取
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
.
实现对图片上传的接收
.
去除字符串中的空格,回车,换行符转变成‘;’在按‘
.
按照回车换行符分割字符串
.
文件MD5码 比较,检测文件是否一样
可能有用的
.
C#实现的html内容截取
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
.
实现对图片上传的接收
.
去除字符串中的空格,回车,换行符转变成‘;’在按‘
.
按照回车换行符分割字符串
.
文件MD5码 比较,检测文件是否一样
睿杰
贡献的其它代码
(
15
)
.
Python数据操作方法封装类
.
SQL server 数据库危险存储过程删除与恢复
.
按文章词频提取关键字
.
连接mysql并列出数据库中的表
.
替换THML标签
.
MVC循环产生数据
.
鼠标指向时变成手型
.
根据HTTP请求获取请求的json报文
.
按照插入顺序临时排序
.
使用对象字面量(literal)来定义属性
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3