Dapper显示
<h2>商品列表</h2>
<a id="a">导出列表</a>
<table class="table table-bordered">
<thead>
<tr>
<td>商品图片</td>
<td>商品名称</td>
<td>商品颜色</td>
<td>商品尺码</td>
<td>商品价格</td>
<td>操作</td>
</tr>
</thead>
<tbody id="tb"></tbody>
</table>
<table class="table table-bordered">
<tr>
<td><input id="Button1" type="button" value="首页" onclick="first()" /></td>
<td><input id="Button1" type="button" value="上一页" onclick="prev()" /></td>
<td><input id="Button1" type="button" value="下一页" onclick="next()" /></td>
<td><input id="Button1" type="button" value="尾页" onclick="last()" /></td>
</tr>
</table>
<script>
var index1 = 0; //获得当前页
var pagecount = 0;
function load(index) {
daoshu();
index1 = index;
$.ajax({
url: "http://localhost:51518/api/Shop/GetGoods2",
data: { index: index, size: 2 },
type: "get",
dataType: "json",
success:
function (d) {
$("#tb").empty();
$(d.List).each(function () {
$("#tb").append(
'<tr>' +
'<td><img src="http://localhost:51518' + this.GImg + '" width="80" height="60" /></td>' +
'<td>' + this.GName + '</td>' +
'<td>' + this.GColor + '</td>' +
'<td>' + this.GSize + '</td>' +
'<td>' + this.GPrice + '</td>' +
'<td><input id="Button1" type="button" value="删除" onclick="del(' + this.GId + ')" /> <input id="Button1" type="button" value="修改" onclick="upt(' + this.GId + ')" /></td>' +
'</tr>'
)
})
pagecount = d.PageCount;
}
})
}
load(1);
function first() {
index1 = 1;
daoshu();
load(index1);
}
function prev() {
index1--;
if (index1 == 0) {
index1 = 1;
}
daoshu();
load(index1);
}
function next() {
index1++;
if (index1 > pagecount) {
index1 = pagecount;
}
daoshu();
load(index1);
}
function last() {
daoshu();
load(pagecount);
}
//删除
function del(id) {
var obj = {
GId: id
};
$.ajax({
url: "http://localhost:51518/api/Shop/DeleteGood",
data: obj,
type: "post",
dataType: "json",
success:
function (d) {
if (d > 0) {
alert('删除成功!');
load();
}
else {
alert('删除失败!');
}
}
})
}
//修改
function upt(id) {
location.href = "/Default/Update";
document.cookie = id;
}
//导出
function daoshu() {
$("#a").prop("href", "http://localhost:51518/api/Shop/Export1?index=" + index1);
}
</script>
Dapper显示的更多相关文章
- Dapper,大规模分布式系统的跟踪系统--转
原文地址:http://bigbully.github.io/Dapper-translation/ 概述 当代的互联网的服务,通常都是用复杂的.大规模分布式集群来实现的.互联网应用构建在不同的软件模 ...
- Dapper学习 - Dapper.Rainbow(三) - Read
前面已经介绍了新增/修改/删除了, 接下来介绍一下Rainbow的Read方法. 一.Read -- Rainbow原生 1. 先看测试代码 var conStr = ConfigurationMan ...
- Emit学习(4) - Dapper解析之数据对象映射(一)
感觉好久没有写博客了, 这几天有点小忙, 接下来会更忙, 索性就先写一篇吧. 后面估计会有更长的一段时间不会更新博客了. 废话不多说, 先上菜. 一.示例 1. 先建类, 类的名称与读取的表名并没有什 ...
- Dapper ORM 用法—Net下无敌的ORM(转)
假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...
- Dapper ORM 用法—Net下无敌的ORM
假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...
- 【.NET框架】Dapper ORM 用法—Net下无敌的ORM
假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载 Dapper的优势: 1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编 ...
- csharp:Dapper Sample
You can find Dapper on Google Code here: http://code.google.com/p/dapper-dot-net/ and the GitHub dis ...
- Dapper ORM 用法
假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后就40K ...
- Dapper基础用法
假如你喜欢原生的Sql语句,又喜欢ORM的简单,那你一定会喜欢上Dapper这款ROM.点击下载Dapper的优势:1,Dapper是一个轻型的ORM类.代码就一个SqlMapper.cs文件,编译后 ...
- ASP.NET Core:使用Dapper和SwaggerUI来丰富你的系统框架
一.概述 1.用VS2017创建如下图的几个.NET Standard类库,默认版本为1.4,你可以通过项目属性进行修改,最高支持到1.6,大概五月份左右会更新至2.0,API会翻倍,很期待! 排名分 ...
随机推荐
- Python3开启自带http服务
1.基本方式Python中自带了简单的服务器程序,能较容易地打开服务.在python3中将原来的SimpleHTTPServer命令改为了http.server,使用方法如下: 1. cd www目录 ...
- ASP.NET Core实现自定义中间件的三种方式
一.什么是中间件 请求处理管道由一系列中间件组件组成.每个组件在 HttpContext 上执行操作,调用管道中的下一个中间件或终止请求. 详情请看另外一篇文章:白话管道中间件 下图是中间件的管道模型 ...
- SDN第三次实验
实验3:OpenFlow协议分析实践 实验目的 能够运用 wireshark 对 OpenFlow 协议数据交互过程进行抓包: 能够借助包解析工具,分析与解释 OpenFlow协议的数据包交互过程与机 ...
- NSA对下一代新技术的评估“网络透视”2010
时间线回到2010年,那时候做渗透测试流行找目标还是通过Google hack,Google dork去寻找目标比如inurl:asp?id= 寻找asp网站可利用的注入点,在厉害点一键爬取域名在配合 ...
- 小程序隐藏scroll-view滚动条的方法
在wxss文件上加上 ::-webkit-scrollbar{ width: 0; height: 0; color: transparent; }
- BundleFusion_Ubuntu_Pangolin 安装的一些error
/usr/bin/ld: 找不到 -lEigen3::Eigen 解决方法:find_package(Eigen3 REQUIRED)为list(APPEND CMAKE_INCLUDE_PATH & ...
- 关于服务器选择的chatgpt 的回答
I want to deploy linux as a server with low latency transactions. Which version of the operating sys ...
- laravel request lifecycle
1, index.php2, 生成service container3, service provider register/booted4, dispatch routing5, middlew ...
- Maven3.6.1 (转载大佬文章)
(30条消息) Maven3.6.1安装及配置_浅若清风过的博客-CSDN博客 1.下载https://archive.apache.org/dist/maven/maven-3/3.6.1/bina ...
- 配置全局路由表和VRF路由表之间的路由泄漏
1.拓扑图 2.R1配置 R1#sho run Building configuration... Current configuration : 1360 bytes ! upgrade fpd a ...